Skip to content

Commit

Permalink
Test SEARCH module CONFIG support
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Dec 26, 2024
1 parent d4a569c commit 5f747a2
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"));
}
}
}

0 comments on commit 5f747a2

Please # to comment.