use of org.apache.rocketmq.connect.redis.parser.LinsertParser in project rocketmq-externals by apache.
the class ParserTest method testLinsertParserBefore.
@Test
public void testLinsertParserBefore() {
String command = "Linsert key BEFORE pivot value";
KVEntry builder = new LinsertParser().parse(parseCommand(command));
Assert.assertEquals("Linsert", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("pivot", res.get(0));
Assert.assertEquals("value", res.get(1));
Assert.assertEquals(true, builder.getParam(Options.REDIS_BEFORE));
}
use of org.apache.rocketmq.connect.redis.parser.LinsertParser in project rocketmq-externals by apache.
the class ParserTest method testLinsertParserAfter.
@Test
public void testLinsertParserAfter() {
String command = "Linsert key AFTER pivot value";
KVEntry builder = new LinsertParser().parse(parseCommand(command));
Assert.assertEquals("Linsert", builder.getCommand());
Assert.assertEquals("key", builder.getKey());
List<String> res = (List<String>) builder.getValue();
Assert.assertEquals(2, res.size());
Assert.assertEquals("pivot", res.get(0));
Assert.assertEquals("value", res.get(1));
Assert.assertEquals(true, builder.getParam(Options.REDIS_AFTER));
}
Aggregations