Search in sources :

Example 1 with MSetNxParser

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

the class ParserTest method testMSetNxParser.

@Test
public void testMSetNxParser() {
    String command = "msetnx k1 v1 k2 v2";
    KVEntry builder = new MSetNxParser().parse(parseCommand(command));
    Assert.assertEquals("msetnx", builder.getCommand());
    Assert.assertEquals("k1", builder.getKey());
    Map<String, String> res = (Map<String, String>) builder.getValue();
    Assert.assertEquals("v1", res.get("k1"));
    Assert.assertEquals("v2", res.get("k2"));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) MSetNxParser(org.apache.rocketmq.connect.redis.parser.MSetNxParser) Map(java.util.Map) Test(org.junit.Test)

Aggregations

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