[TEST] make CountRequestBuilder#toString and SearchRequestBuilder#toString tests non platform dependent
This commit is contained in:
parent
54f2a91aff
commit
b8caa52e7c
|
@ -35,6 +35,7 @@ import org.junit.Test;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
||||
public class CountRequestBuilderTests extends ElasticsearchTestCase {
|
||||
|
@ -72,7 +73,7 @@ public class CountRequestBuilderTests extends ElasticsearchTestCase {
|
|||
CountRequestBuilder countRequestBuilder = new CountRequestBuilder(client);
|
||||
String query = "{ \"match_all\" : {} }";
|
||||
countRequestBuilder.setQuery(new BytesArray(query));
|
||||
assertThat(countRequestBuilder.toString(), equalTo("{\n \"query\":{ \"match_all\" : {} }\n}"));
|
||||
assertThat(countRequestBuilder.toString(), containsString("\"query\":{ \"match_all\" : {} }"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.junit.Test;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
||||
public class SearchRequestBuilderTests extends ElasticsearchTestCase {
|
||||
|
@ -83,7 +84,7 @@ public class SearchRequestBuilderTests extends ElasticsearchTestCase {
|
|||
SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client);
|
||||
String query = "{ \"match_all\" : {} }";
|
||||
searchRequestBuilder.setQuery(query);
|
||||
assertThat(searchRequestBuilder.toString(), equalTo("{\n \"query\":{ \"match_all\" : {} }\n}"));
|
||||
assertThat(searchRequestBuilder.toString(), containsString("\"query\":{ \"match_all\" : {} }"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue