Search in sources :

Example 1 with XAckParser

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

the class ParserTest method testXAckParser.

@Test
public void testXAckParser() {
    String command = "XAck key group 1526569498055-0 1526569498055-1";
    KVEntry builder = new XAckParser().parse(parseCommand(command));
    Assert.assertEquals("XAck", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    Assert.assertEquals("group", builder.getParam(Options.REDIS_GROUP));
    List<String> res = (List<String>) builder.getValue();
    Assert.assertEquals(2, res.size());
    Assert.assertEquals("1526569498055-0", res.get(0));
    Assert.assertEquals("1526569498055-1", res.get(1));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) List(java.util.List) XAckParser(org.apache.rocketmq.connect.redis.parser.XAckParser) Test(org.junit.Test)

Aggregations

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