Search in sources :

Example 1 with ExpireParser

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

the class ParserTest method testExpireParser.

@Test
public void testExpireParser() {
    String command = "expire key 500";
    KVEntry builder = new ExpireParser().parse(parseCommand(command));
    Assert.assertEquals("expire", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    Assert.assertTrue(500L == builder.getParam(Options.EXPIRED_TIME));
    Assert.assertEquals(ExpiredType.SECOND, builder.getParam(Options.EXPIRED_TYPE));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) ExpireParser(org.apache.rocketmq.connect.redis.parser.ExpireParser) PExpireParser(org.apache.rocketmq.connect.redis.parser.PExpireParser) Test(org.junit.Test)

Aggregations

ExpireParser (org.apache.rocketmq.connect.redis.parser.ExpireParser)1 PExpireParser (org.apache.rocketmq.connect.redis.parser.PExpireParser)1 KVEntry (org.apache.rocketmq.connect.redis.pojo.KVEntry)1 Test (org.junit.Test)1