Search in sources :

Example 1 with KeyValueEntity

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"));
}
Also used : KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 2 with KeyValueEntity

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"));
}
Also used : KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 3 with KeyValueEntity

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());
}
Also used : KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 4 with KeyValueEntity

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());
}
Also used : KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 5 with KeyValueEntity

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());
}
Also used : User(org.jnosql.artemis.model.User) KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Aggregations

KeyValueEntity (org.jnosql.diana.api.key.KeyValueEntity)12 Test (org.junit.jupiter.api.Test)12 User (org.jnosql.artemis.model.User)4 Duration (java.time.Duration)2 User (org.jnosql.diana.hazelcast.key.model.User)1 User (org.jnosql.diana.infinispan.key.model.User)1