diff --git a/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java b/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java index 1c635bbc64..9c0663331f 100644 --- a/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java +++ b/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java @@ -2,11 +2,9 @@ package glide.cluster; import static glide.TestConfiguration.SERVER_VERSION; -import static glide.TestUtilities.commonClientConfig; import static glide.TestUtilities.commonClusterClientConfig; import static glide.TestUtilities.getRandomString; import static glide.api.BaseClient.OK; -import static glide.api.models.configuration.RequestRoutingConfiguration.SimpleMultiNodeRoute.ALL_NODES; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -14,23 +12,17 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import glide.api.GlideClient; import glide.api.GlideClusterClient; import glide.api.models.configuration.ServerCredentials; import glide.api.models.exceptions.ClosingException; -import glide.api.models.exceptions.ConnectionException; import glide.api.models.exceptions.RequestException; import java.util.Map; import java.util.UUID; import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; import lombok.SneakyThrows; import org.apache.commons.lang3.RandomStringUtils; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; @Timeout(30) // seconds public class ClusterClientTests { @@ -175,10 +167,12 @@ public void closed_client_throws_ExecutionException_with_ClosingException_as_cau @SneakyThrows @Test public void test_update_connection_password() { - GlideClusterClient adminClient = GlideClusterClient.createClient(commonClusterClientConfig().build()).get(); + GlideClusterClient adminClient = + GlideClusterClient.createClient(commonClusterClientConfig().build()).get(); String pwd = UUID.randomUUID().toString(); - try (GlideClusterClient testClient = GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { + try (GlideClusterClient testClient = + GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { // validate that we can use the client assertNotNull(testClient.info().get()); @@ -207,15 +201,16 @@ public void test_update_connection_password() { @Test public void test_update_connection_password_auth_non_valid_pass() { // Test Client fails on call to updateConnectionPassword with invalid parameters - try (GlideClusterClient testClient = GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { + try (GlideClusterClient testClient = + GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { var emptyPasswordException = - assertThrows( - ExecutionException.class, () -> testClient.updateConnectionPassword("", true).get()); + assertThrows( + ExecutionException.class, () -> testClient.updateConnectionPassword("", true).get()); assertInstanceOf(RequestException.class, emptyPasswordException.getCause()); var noPasswordException = - assertThrows( - ExecutionException.class, () -> testClient.updateConnectionPassword(true).get()); + assertThrows( + ExecutionException.class, () -> testClient.updateConnectionPassword(true).get()); assertInstanceOf(RequestException.class, noPasswordException.getCause()); } } @@ -225,14 +220,15 @@ public void test_update_connection_password_auth_non_valid_pass() { public void test_update_connection_password_no_server_auth() { var pwd = UUID.randomUUID().toString(); - try (GlideClusterClient testClient = GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { + try (GlideClusterClient testClient = + GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { // validate that we can use the client assertNotNull(testClient.info().get()); // Test that immediate re-authentication fails when no server password is set. var exception = - assertThrows( - ExecutionException.class, () -> testClient.updateConnectionPassword(pwd, true).get()); + assertThrows( + ExecutionException.class, () -> testClient.updateConnectionPassword(pwd, true).get()); assertInstanceOf(RequestException.class, exception.getCause()); } } @@ -242,7 +238,8 @@ public void test_update_connection_password_no_server_auth() { public void test_update_connection_password_long() { var pwd = RandomStringUtils.randomAlphabetic(1000); - try (GlideClusterClient testClient = GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { + try (GlideClusterClient testClient = + GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { // validate that we can use the client assertNotNull(testClient.info().get()); @@ -258,8 +255,10 @@ public void test_replace_password_immediateAuth_wrong_password() { var pwd = UUID.randomUUID().toString(); var notThePwd = UUID.randomUUID().toString(); - GlideClusterClient adminClient = GlideClusterClient.createClient(commonClusterClientConfig().build()).get(); - try (GlideClusterClient testClient = GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { + GlideClusterClient adminClient = + GlideClusterClient.createClient(commonClusterClientConfig().build()).get(); + try (GlideClusterClient testClient = + GlideClusterClient.createClient(commonClusterClientConfig().build()).get()) { // validate that we can use the client assertNotNull(testClient.info().get()); @@ -268,8 +267,8 @@ public void test_replace_password_immediateAuth_wrong_password() { // Test that re-authentication fails when using wrong password. var exception = - assertThrows( - ExecutionException.class, () -> testClient.updateConnectionPassword(pwd, true).get()); + assertThrows( + ExecutionException.class, () -> testClient.updateConnectionPassword(pwd, true).get()); assertInstanceOf(RequestException.class, exception.getCause()); // But using something else password returns OK