Search in sources :

Example 1 with HmSetParser

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

the class ParserTest method testHmSetParser.

@Test
public void testHmSetParser() {
    String command = "hmset key f1 v1 f2 v2";
    KVEntry builder = new HmSetParser().parse(parseCommand(command));
    Assert.assertEquals("hmset", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    Map<String, String> res = (Map<String, String>) builder.getValue();
    Assert.assertEquals(2, res.size());
    Assert.assertEquals("v1", res.get("f1"));
    Assert.assertEquals("v2", res.get("f2"));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) HmSetParser(org.apache.rocketmq.connect.redis.parser.HmSetParser) Map(java.util.Map) Test(org.junit.Test)

Aggregations

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