Search in sources :

Example 1 with MSetParser

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

the class ParserTest method testMSetParser.

@Test
public void testMSetParser() {
    String command = "mset k1 v1 k2 v2";
    KVEntry builder = new MSetParser().parse(parseCommand(command));
    Assert.assertEquals("mset", 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) MSetParser(org.apache.rocketmq.connect.redis.parser.MSetParser) Map(java.util.Map) Test(org.junit.Test)

Aggregations

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