Search in sources :

Example 1 with HSetNxParser

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

the class ParserTest method testHSetNxParser.

@Test
public void testHSetNxParser() {
    String command = "hsetnx key field value";
    KVEntry builder = new HSetNxParser().parse(parseCommand(command));
    Assert.assertEquals("hsetnx", 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) HSetNxParser(org.apache.rocketmq.connect.redis.parser.HSetNxParser) Map(java.util.Map) Test(org.junit.Test)

Aggregations

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