Search in sources :

Example 1 with HSetParser

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

the class ParserTest method testHSetParser.

@Test
public void testHSetParser() {
    String command = "hset key field value";
    KVEntry builder = new HSetParser().parse(parseCommand(command));
    Assert.assertEquals("hset", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    Map<String, String> res = (Map<String, String>) builder.getValue();
    Assert.assertEquals(1, res.size());
    Assert.assertEquals("value", res.get("field"));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) HSetParser(org.apache.rocketmq.connect.redis.parser.HSetParser) Map(java.util.Map) Test(org.junit.Test)

Aggregations

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