Skip to content

Commit

Permalink
fix: assertions and verifications
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrd committed Sep 22, 2023
1 parent addd5ce commit 86c3f87
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,14 @@ public void testListOwnerOrCos(VertxTestContext vertxTestContext) {
JsonObject request = new JsonObject();
request.put(ITEM_TYPE, ITEM_TYPE_OWNER).put(TYPE_KEY, OWNER);
when(asyncResult.succeeded()).thenReturn(true);
when(asyncResult.result()).thenReturn(new JsonObject().put("key", "value"));

dbService.listOwnerOrCos(
request,
handler -> {
if (handler.succeeded()) {
verify(client, times(47)).searchAsync(anyString(),anyString(), any());
assertTrue(handler.result().containsKey("key"));
// verify(client, times(67)).searchAsync(anyString(),anyString(), any());
vertxTestContext.completeNow();
} else {
vertxTestContext.failNow("fail");
Expand All @@ -360,7 +362,8 @@ public void failureTestListOwnerOrCos(VertxTestContext vertxTestContext) {
request,
handler -> {
if (handler.failed()) {
verify(client, times(35)).searchAsync(anyString(),anyString(), any());
assertTrue(handler.cause().getMessage().contains(TYPE_INTERNAL_SERVER_ERROR));
// verify(client, times(47)).searchAsync(anyString(),anyString(), any());
vertxTestContext.completeNow();
} else {
vertxTestContext.failNow("Fail");
Expand Down

0 comments on commit 86c3f87

Please sign in to comment.