use of org.jnosql.diana.api.key.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"));
}
use of org.jnosql.diana.api.key.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 org.jnosql.diana.api.key.KeyValueEntity in project jnosql-artemis by eclipse.
the class DefaultKeyValueEventPersistManagerTest method shouldFirePreColumn.
@Test
public void shouldFirePreColumn() {
KeyValueEntity entity = KeyValueEntity.of("key", "value");
subject.firePreKeyValue(entity);
ArgumentCaptor<KeyValueEntityPrePersist> captor = ArgumentCaptor.forClass(KeyValueEntityPrePersist.class);
verify(keyValueEntityPrePersistEvent).fire(captor.capture());
KeyValueEntityPrePersist captorValue = captor.getValue();
assertEquals(entity, captorValue.getEntity());
}
use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-artemis by eclipse.
the class DefaultKeyValueEventPersistManagerTest method shouldFirePostColumn.
@Test
public void shouldFirePostColumn() {
KeyValueEntity entity = KeyValueEntity.of("key", "value");
subject.firePostKeyValue(entity);
ArgumentCaptor<KeyValueEntityPostPersist> captor = ArgumentCaptor.forClass(KeyValueEntityPostPersist.class);
verify(keyValueEntityPostPersistEvent).fire(captor.capture());
KeyValueEntityPostPersist captorValue = captor.getValue();
assertEquals(entity, captorValue.getEntity());
}
use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-artemis by eclipse.
the class DefaultKeyValueTemplateTest method shouldPutIterable.
@Test
public void shouldPutIterable() {
User user = new User(KEY, "otavio", 27);
subject.put(singletonList(user));
Mockito.verify(manager).put(captor.capture());
KeyValueEntity entity = captor.getValue();
assertEquals(KEY, entity.getKey());
assertEquals(user, entity.getValue().get());
}