From 5f747a2754b75752d35acf6403919b2cf60c0e55 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:37:11 +0600 Subject: [PATCH] Test SEARCH module CONFIG support --- .../RedisModulesControlCommandsTest.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/test/java/redis/clients/jedis/modules/RedisModulesControlCommandsTest.java diff --git a/src/test/java/redis/clients/jedis/modules/RedisModulesControlCommandsTest.java b/src/test/java/redis/clients/jedis/modules/RedisModulesControlCommandsTest.java new file mode 100644 index 0000000000..ce0c39fad8 --- /dev/null +++ b/src/test/java/redis/clients/jedis/modules/RedisModulesControlCommandsTest.java @@ -0,0 +1,34 @@ +package redis.clients.jedis.modules; + +import static org.junit.Assert.assertEquals; + +import java.util.Collections; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import redis.clients.jedis.RedisProtocol; +import redis.clients.jedis.commands.jedis.JedisCommandsTestBase; + +@RunWith(Parameterized.class) +public class RedisModulesControlCommandsTest extends JedisCommandsTestBase { + + public RedisModulesControlCommandsTest(RedisProtocol redisProtocol) { + super(redisProtocol); + } + + @Test + public void dialectConfig() { + final String configParam = "search-default-dialect"; + // confirm default + assertEquals(Collections.singletonMap(configParam, "1"), jedis.configGet(configParam)); + + try { + assertEquals("OK", jedis.configSet(configParam, "2")); + assertEquals(Collections.singletonMap(configParam, "2"), jedis.configGet(configParam)); + + } finally { + // restore to default + assertEquals("OK", jedis.configSet(configParam, "1")); + } + } +}