diff --git a/CHANGELOG.md b/CHANGELOG.md index d2abf52540..b7ddacf1e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Github workflow for dependabot PRs ([#247](https://github.com/opensearch-project/opensearch-java/pull/247)) ### Changed +- Update tests to use JUnit's Assert ([#244]https://github.com/opensearch-project/opensearch-java/pull/244) ### Deprecated diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2BulkRequestIT.java b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2BulkRequestIT.java index 85fcb75a53..36672582ac 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2BulkRequestIT.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2BulkRequestIT.java @@ -9,7 +9,7 @@ package org.opensearch.client.opensearch.integTest.aws; import org.junit.Test; -import org.locationtech.jts.util.Assert; +import org.junit.Assert; import org.opensearch.client.opensearch.OpenSearchClient; import org.opensearch.client.opensearch._types.Refresh; import org.opensearch.client.opensearch._types.query_dsl.Query; @@ -49,7 +49,7 @@ public void testBulkRequest() throws Exception { .operations(ops) .refresh(Refresh.WaitFor); BulkResponse bulkResponse = client.bulk(bulkReq.build()); - Assert.equals(3, bulkResponse.items().size()); + Assert.assertEquals(3, bulkResponse.items().size()); Query query = Query.of(qb -> qb.match(mb -> mb.field("title").query(fv -> fv.stringValue("Document")))); final SearchRequest.Builder searchReq = new SearchRequest.Builder() @@ -60,6 +60,6 @@ public void testBulkRequest() throws Exception { .ignoreThrottled(false) .query(query); SearchResponse searchResponse = client.search(searchReq.build(), SimplePojo.class); - Assert.equals(3, searchResponse.hits().hits().size()); + Assert.assertEquals(3, searchResponse.hits().hits().size()); } } diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2SearchIT.java b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2SearchIT.java index f81c84ccbd..b138ff8545 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2SearchIT.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2SearchIT.java @@ -9,7 +9,7 @@ package org.opensearch.client.opensearch.integTest.aws; import org.junit.Test; -import org.locationtech.jts.util.Assert; +import org.junit.Assert; import org.opensearch.client.opensearch.OpenSearchAsyncClient; import org.opensearch.client.opensearch.OpenSearchClient; import org.opensearch.client.opensearch._types.OpType; @@ -55,18 +55,18 @@ void testClient(boolean async) throws Exception { addDoc(client, "id3", doc3, true); SearchResponse response = query(client, "NotPresent", null); - Assert.equals(0, response.hits().hits().size()); + Assert.assertEquals(0, response.hits().hits().size()); response = query(client, "Document", null); - Assert.equals(3, response.hits().hits().size()); + Assert.assertEquals(3, response.hits().hits().size()); response = query(client, "1", null); - Assert.equals(1, response.hits().hits().size()); - Assert.equals(doc1, response.hits().hits().get(0).source()); + Assert.assertEquals(1, response.hits().hits().size()); + Assert.assertEquals(doc1, response.hits().hits().get(0).source()); response = query(client, null, "wait"); - Assert.equals(1, response.hits().hits().size()); - Assert.equals(doc3, response.hits().hits().get(0).source()); + Assert.assertEquals(1, response.hits().hits().size()); + Assert.assertEquals(doc3, response.hits().hits().get(0).source()); } void testClientAsync(boolean async) throws Exception { @@ -93,14 +93,14 @@ void testClientAsync(boolean async) throws Exception { }).get(); SearchResponse response = results.get(0); - Assert.equals(0, response.hits().hits().size()); + Assert.assertEquals(0, response.hits().hits().size()); response = results.get(1); - Assert.equals(3, response.hits().hits().size()); + Assert.assertEquals(3, response.hits().hits().size()); response = results.get(2); - Assert.equals(1, response.hits().hits().size()); - Assert.equals(doc1, response.hits().hits().get(0).source()); + Assert.assertEquals(1, response.hits().hits().size()); + Assert.assertEquals(doc1, response.hits().hits().get(0).source()); }