use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testSInterStoreParser.
@Test
public void testSInterStoreParser() {
String command = "SINTERSTORE destination k1 k2";
KVEntry builder = new SInterStoreParser().parse(parseCommand(command));
Assert.assertEquals("SINTERSTORE", builder.getCommand());
Assert.assertEquals("destination", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("k1", res.get(0));
Assert.assertEquals("k2", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testZRemParser.
@Test
public void testZRemParser() {
String command = "ZRem key m1 m2";
KVEntry builder = new ZRemParser().parse(parseCommand(command));
Assert.assertEquals("ZRem", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("m1", res.get(0));
Assert.assertEquals("m2", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testGetsetParser.
@Test
public void testGetsetParser() {
String command = "Getset key value";
KVEntry builder = new GetsetParser().parse(parseCommand(command));
Assert.assertEquals("Getset", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertEquals("value", builder.getValue());
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testDecrByParser.
@Test
public void testDecrByParser() {
String command = "DECRBY key 100";
KVEntry builder = new DecrByParser().parse(parseCommand(command));
Assert.assertEquals("DECRBY", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
Assert.assertTrue(100L == builder.getParam(Options.REDIS_INCREMENT));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testSetNxParser.
@Test
public void testSetNxParser() {
String command = "SETNX a b";
KVEntry builder = new SetNxParser().parse(parseCommand(command));
Assert.assertEquals("SETNX", builder.getCommand());
Assert.assertEquals("a", builder.getKey());
Assert.assertEquals("b", builder.getValue());
}
Aggregations