All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.joschi.nosqlunit.elasticsearch.http.DefaultElasticsearchComparisonStrategy Maven / Gradle / Ivy

package com.github.joschi.nosqlunit.elasticsearch.http;

import com.github.joschi.nosqlunit.elasticsearch.http.parser.DataReader;
import com.lordofthejars.nosqlunit.core.NoSqlAssertionError;
import io.searchbox.client.JestClient;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

public class DefaultElasticsearchComparisonStrategy implements ElasticsearchComparisonStrategy {
    @Override
    public boolean compare(ElasticsearchConnectionCallback connection, InputStream dataset) throws NoSqlAssertionError,
            Throwable {
        final JestClient jestClient = connection.client();
        final List> documents = DataReader.getDocuments(dataset);
        ElasticsearchAssertion.strictAssertEquals(documents, jestClient);
        return true;
    }

    @Override
    public void setIgnoreProperties(String[] ignoreProperties) {
        // NOP
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy