use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testIncrByParser.
@Test
public void testIncrByParser() {
String command = "INCRBY key 100";
KVEntry builder = new IncrByParser().parse(parseCommand(command));
Assert.assertEquals("INCRBY", 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 testPfAddParser.
@Test
public void testPfAddParser() {
String command = "PFADD key e1 e2";
KVEntry builder = new PfAddParser().parse(parseCommand(command));
Assert.assertEquals("PFADD", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("e1", res.get(0));
Assert.assertEquals("e2", res.get(1));
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testMultiParser.
@Test
public void testMultiParser() {
String command = "Multi";
KVEntry builder = new MultiParser().parse(parseCommand(command));
Assert.assertEquals("Multi", builder.getCommand());
}
use of org.apache.rocketmq.connect.redis.pojo.KVEntry in project rocketmq-externals by apache.
the class ParserTest method testUnLinkParser.
@Test
public void testUnLinkParser() {
String command = "UnLink k1 k2";
KVEntry builder = new UnLinkParser().parse(parseCommand(command));
Assert.assertEquals("UnLink", builder.getCommand());
Assert.assertEquals("k1", 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 testPersistParser.
@Test
public void testPersistParser() {
String command = "PERSIST key";
KVEntry builder = new PersistParser().parse(parseCommand(command));
Assert.assertEquals("PERSIST", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
}
Aggregations