use of org.redisson.api.RedissonClient in project redisson by redisson.
the class RedissonCodecTest method testAvro.
@Test
public void testAvro() throws IOException {
AvroMapper am = new AvroMapper();
AvroSchema schema = am.schemaFor(TestObject.class);
Codec avroCodec = new AvroJacksonCodec(TestObject.class, schema);
Config config = createConfig();
config.setCodec(avroCodec);
RedissonClient redisson = Redisson.create(config);
RBucket<TestObject> b = redisson.getBucket("bucket");
b.set(new TestObject("1", "2"));
assertThat(b.get()).isEqualTo(new TestObject("1", "2"));
}
use of org.redisson.api.RedissonClient in project redisson by redisson.
the class RedissonCodecTest method testListOfStrings.
@Test
public void testListOfStrings() {
Config config = createConfig();
config.setCodec(new JsonJacksonCodec());
RedissonClient redisson = Redisson.create(config);
RMap<String, List<String>> map = redisson.getMap("list of strings", jsonListOfStringCodec);
map.put("foo", new ArrayList<String>(Arrays.asList("bar")));
RMap<String, List<String>> map2 = redisson.getMap("list of strings", jsonListOfStringCodec);
assertThat(map2).isEqualTo(map);
redisson.shutdown();
}
use of org.redisson.api.RedissonClient in project redisson by redisson.
the class RedissonCodecTest method testJson.
@Test
public void testJson() {
Config config = createConfig();
config.setCodec(jsonCodec);
RedissonClient redisson = Redisson.create(config);
test(redisson);
}
use of org.redisson.api.RedissonClient in project redisson by redisson.
the class RedissonCodecTest method testCbor.
@Test
public void testCbor() {
Config config = createConfig();
config.setCodec(cborCodec);
RedissonClient redisson = Redisson.create(config);
test(redisson);
}
Aggregations