Search in sources :

Example 1 with PfMergeParser

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

the class ParserTest method testPfMergeParser.

@Test
public void testPfMergeParser() {
    String command = "PFMERGE destkey sourcekey1 sourcekey2";
    KVEntry builder = new PfMergeParser().parse(parseCommand(command));
    Assert.assertEquals("PFMERGE", builder.getCommand());
    Assert.assertEquals("destkey", builder.getKey());
    List<String> res = (List<String>) builder.getValue();
    Assert.assertEquals(2, res.size());
    Assert.assertEquals("sourcekey1", res.get(0));
    Assert.assertEquals("sourcekey2", res.get(1));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) PfMergeParser(org.apache.rocketmq.connect.redis.parser.PfMergeParser) List(java.util.List) Test(org.junit.Test)

Aggregations

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