Search in sources :

Example 1 with SMoveParser

use of org.apache.rocketmq.connect.redis.parser.SMoveParser in project rocketmq-externals by apache.

the class ParserTest method testSMoveParser.

@Test
public void testSMoveParser() {
    String command = "SMOVE source destination member";
    KVEntry builder = new SMoveParser().parse(parseCommand(command));
    Assert.assertEquals("SMOVE", builder.getCommand());
    Assert.assertEquals("source", builder.getKey());
    List<String> res = (List<String>) builder.getValue();
    Assert.assertEquals(2, res.size());
    Assert.assertEquals("destination", res.get(0));
    Assert.assertEquals("member", res.get(1));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) SMoveParser(org.apache.rocketmq.connect.redis.parser.SMoveParser) List(java.util.List) Test(org.junit.Test)

Aggregations

List (java.util.List)1 SMoveParser (org.apache.rocketmq.connect.redis.parser.SMoveParser)1 KVEntry (org.apache.rocketmq.connect.redis.pojo.KVEntry)1 Test (org.junit.Test)1