From ce1dba0d191e60eb5dfe20259d47ffb5678c7921 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Mon, 17 Oct 2022 13:59:21 -0400 Subject: [PATCH] Update tests to use JUnit's Assert Signed-off-by: Andriy Redko --- .../integTest/aws/AwsSdk2BulkRequestIT.java | 6 ++--- .../integTest/aws/AwsSdk2SearchIT.java | 22 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) 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()); }