Search in sources :

Example 6 with KeyValueEntity

use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-diana-driver by eclipse.

the class RiakBucketManagerTest 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 7 with KeyValueEntity

use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-diana-driver by eclipse.

the class KeyValueEntityManagerTest 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 : User(org.jnosql.diana.infinispan.key.model.User) KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 8 with KeyValueEntity

use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-diana-driver by eclipse.

the class HazelcastBucketManagerTest 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 : User(org.jnosql.diana.hazelcast.key.model.User) KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 9 with KeyValueEntity

use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-diana-driver by eclipse.

the class CouchbaseBucketManagerTest method shouldMultiGet.

@Test
public void shouldMultiGet() {
    User user = new User(KEY_OTAVIO);
    KeyValueEntity keyValue = KeyValueEntity.of(KEY_OTAVIO, Value.of(user));
    keyValueEntityManager.put(keyValue);
    assertNotNull(keyValueEntityManager.get(KEY_OTAVIO));
}
Also used : KeyValueEntity(org.jnosql.diana.api.key.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 10 with KeyValueEntity

use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-artemis by eclipse.

the class DefaultKeyValueTemplateTest method shouldPutTTL.

@Test
public void shouldPutTTL() {
    Duration duration = Duration.ofSeconds(2L);
    User user = new User(KEY, "otavio", 27);
    subject.put(user, duration);
    Mockito.verify(manager).put(captor.capture(), Mockito.eq(duration));
    KeyValueEntity entity = captor.getValue();
    assertEquals(KEY, entity.getKey());
    assertEquals(user, entity.getValue().get());
}
Also used : User(org.jnosql.artemis.model.User) Duration(java.time.Duration) 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