use of doitincloud.rdbcache.supports.AnyKey in project rdbcache by rdbcache.
the class RequestTest method process1.
@Test
public void process1() {
try {
String key = "*";
Optional<String> tableOpt = Optional.of("tb1");
Optional<String> expireOpt = Optional.of("30");
String queryString = "id=1";
HttpServletRequest request = getRequest("get", key, null, tableOpt, expireOpt, queryString);
Context context = new Context();
AnyKey anyKey = Request.process(context, request, new KvPairs(key), tableOpt, expireOpt);
assertEquals(1, anyKey.size());
KeyInfo keyInfo = anyKey.getKeyInfo();
assertTrue(keyInfo.getIsNew());
assertEquals("KeyInfo(true, tb1, 30, {id: {=: [1]}})", keyInfo.toString());
} catch (Exception e) {
e.printStackTrace();
fail(e.getCause().getMessage());
}
}
Aggregations