use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana by eclipse.
the class DefaultKeyValueTemplateTest method shouldInsertTTL.
@Test
public void shouldInsertTTL() {
Duration duration = Duration.ofSeconds(2L);
User user = new User(KEY, "otavio", 27);
subject.insert(user, duration);
Mockito.verify(manager).put(captor.capture(), Mockito.eq(duration));
KeyValueEntity entity = captor.getValue();
assertEquals(KEY, entity.getKey());
assertEquals(user, entity.getValue());
}
use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana by eclipse.
the class DefaultKeyValueTemplateTest method shouldInsert.
@Test
public void shouldInsert() {
User user = new User(KEY, "otavio", 27);
subject.insert(user);
Mockito.verify(manager).put(captor.capture());
KeyValueEntity entity = captor.getValue();
assertEquals(KEY, entity.getKey());
assertEquals(user, entity.getValue());
}
use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana-driver by eclipse.
the class MemcachedBucketManagerTest method shouldMultiGet.
@Test
public void shouldMultiGet() {
User user = new User("otavio");
KeyValueEntity keyValue = KeyValueEntity.of("otavio", Value.of(user));
keyValueEntityManager.put(keyValue);
assertNotNull(keyValueEntityManager.get("otavio"));
}
use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana-driver by eclipse.
the class RedisBucketManagerTest method shouldMultiGet.
@Test
public void shouldMultiGet() {
User user = new User("otavio");
KeyValueEntity keyValue = KeyValueEntity.of("otavio", Value.of(user));
keyValueEntityManager.put(keyValue);
assertNotNull(keyValueEntityManager.get("otavio"));
}
use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana-driver by eclipse.
the class ArangoDBKeyValueEntityManagerTest method shouldMultiGet.
@Test
public void shouldMultiGet() {
User user = new User("otavio");
KeyValueEntity keyValue = KeyValueEntity.of("otavio", Value.of(user));
keyValueEntityManager.put(keyValue);
assertNotNull(keyValueEntityManager.get("otavio"));
}
Aggregations