Search in sources :

Example 1 with SRemParser

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

the class ParserTest method testSRemParser.

@Test
public void testSRemParser() {
    String command = "SREM key m1 m2";
    KVEntry builder = new SRemParser().parse(parseCommand(command));
    Assert.assertEquals("SREM", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    List<String> res = (List<String>) builder.getValue();
    Assert.assertEquals(2, res.size());
    Assert.assertEquals("m1", res.get(0));
    Assert.assertEquals("m2", res.get(1));
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) List(java.util.List) SRemParser(org.apache.rocketmq.connect.redis.parser.SRemParser) Test(org.junit.Test)

Aggregations

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