Skip to content

Commit

Permalink
Integration test: Fix auth error message test failure
Browse files Browse the repository at this point in the history
Update the test to expect the new auth error message.

Display a better error message if the assertion
fails in the future.

Change-Id: Id28bc582ee2fd271a61d9c48bbb49c9554a805e4
Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/212624
Tested-by: Build Bot <[email protected]>
Reviewed-by: David Nault <[email protected]>
  • Loading branch information
dnault committed Jul 12, 2024
1 parent b5ae40f commit d4507f5
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down Expand Up @@ -156,7 +157,7 @@ protected void initChannel(SocketChannel ch) {
}
});

assertAuthenticationFailure(bootstrap, "Authentication Failure");
assertAuthenticationFailure(bootstrap, "User authentication failed");
}

@Test
Expand All @@ -178,7 +179,7 @@ protected void initChannel(SocketChannel ch) {
}
});

assertAuthenticationFailure(bootstrap, "Authentication Failure");
assertAuthenticationFailure(bootstrap, "User authentication failed");
}

@Test
Expand Down Expand Up @@ -220,7 +221,7 @@ private void assertAuthenticationFailure(final Bootstrap bootstrap, final String
assertFalse(f.get().isSuccess());
Throwable ex = f.get().cause();
assertInstanceOf(AuthenticationFailureException.class, ex);
assertTrue(ex.getMessage().contains(msg));
assertThat(ex.getMessage()).contains(msg);
}

}

0 comments on commit d4507f5

Please sign in to comment.