From 5c0f57ed7b75a7638d2dc6d0faefcb965c3cff8b Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Fri, 10 Jan 2025 13:54:02 -0800 Subject: [PATCH] Test fixes Signed-off-by: Yury-Fridlyand --- .../src/main/java/glide/managers/ConnectionManager.java | 5 ++++- java/integTest/src/test/java/glide/SharedCommandTests.java | 2 +- .../src/test/java/glide/cluster/ClusterTransactionTests.java | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/java/client/src/main/java/glide/managers/ConnectionManager.java b/java/client/src/main/java/glide/managers/ConnectionManager.java index 1a7e3a887c..cff6e023b9 100644 --- a/java/client/src/main/java/glide/managers/ConnectionManager.java +++ b/java/client/src/main/java/glide/managers/ConnectionManager.java @@ -219,7 +219,10 @@ private ConnectionRequest.Builder setupConnectionRequestBuilderGlideClusterClien connectionRequestBuilder.setClusterModeEnabled(true); if (configuration.getSubscriptionConfiguration() != null) { - // TODO throw ConfigurationError if RESP2 + if (configuration.getProtocol() == ProtocolVersion.RESP2) { + throw new ConfigurationError( + "PubSub subscriptions require RESP3 protocol, but RESP2 was configured."); + } var subscriptionsBuilder = PubSubSubscriptions.newBuilder(); for (var entry : configuration.getSubscriptionConfiguration().getSubscriptions().entrySet()) { var channelsBuilder = PubSubChannelsOrPatterns.newBuilder(); diff --git a/java/integTest/src/test/java/glide/SharedCommandTests.java b/java/integTest/src/test/java/glide/SharedCommandTests.java index 5da658cbd1..52f7401551 100644 --- a/java/integTest/src/test/java/glide/SharedCommandTests.java +++ b/java/integTest/src/test/java/glide/SharedCommandTests.java @@ -12719,7 +12719,7 @@ public void sort_with_pattern_binary(BaseClient client) { assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("8.0.0"), "This feature added in version 8"); } - String prefix = "{setKey}-" + UUID.randomUUID(); + String prefix = "{" + UUID.randomUUID() + "}-"; GlideString listKey = gs(prefix + "listKey"); GlideString storeKey = gs(prefix + "storeKey"); GlideString nameField = gs("name"); diff --git a/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java b/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java index bfebd10fe4..277c40d4bc 100644 --- a/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java +++ b/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java @@ -323,8 +323,8 @@ public void spublish(GlideClusterClient clusterClient) { public void sort(GlideClusterClient clusterClient) { String key1 = "{key}:1" + UUID.randomUUID(); String key2 = "{key}:2" + UUID.randomUUID(); - String key3 = "{key}:3"; - String key4 = "{key}:4"; + String key3 = "{key}:3" + UUID.randomUUID(); + String key4 = "{key}:4" + UUID.randomUUID(); String key5 = "{key}:5" + UUID.randomUUID(); String key6 = "{key}:6" + UUID.randomUUID(); String[] descendingList = new String[] {"3", "2", "1"};