Search in sources :

Example 1 with SetExParser

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

the class ParserTest method testSetExParser.

@Test
public void testSetExParser() {
    String command = "setex key 100 value";
    KVEntry builder = new SetExParser().parse(parseCommand(command));
    Assert.assertEquals("setex", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    Assert.assertEquals("value", builder.getValue());
    Assert.assertTrue(100 == builder.getParam(Options.REDIS_EX));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) PSetExParser(org.apache.rocketmq.connect.redis.parser.PSetExParser) SetExParser(org.apache.rocketmq.connect.redis.parser.SetExParser) Test(org.junit.Test)

Aggregations

PSetExParser (org.apache.rocketmq.connect.redis.parser.PSetExParser)1 SetExParser (org.apache.rocketmq.connect.redis.parser.SetExParser)1 KVEntry (org.apache.rocketmq.connect.redis.pojo.KVEntry)1 Test (org.junit.Test)1