Search in sources :

Example 36 with KeyValueEntity

use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana by eclipse.

the class DefaultKeyValueEntityConverterTest method shouldConvertToKeyValue.

@Test
public void shouldConvertToKeyValue() {
    User user = new User("nickname", "name", 24);
    KeyValueEntity keyValueEntity = converter.toKeyValue(user);
    assertEquals("nickname", keyValueEntity.getKey());
    assertEquals(user, keyValueEntity.getValue());
}
Also used : User(jakarta.nosql.tck.entities.User) KeyValueEntity(jakarta.nosql.keyvalue.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 37 with KeyValueEntity

use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana-driver by eclipse.

the class DynamoDBKeyValueEntityManagerTest 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(jakarta.nosql.keyvalue.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Example 38 with KeyValueEntity

use of jakarta.nosql.keyvalue.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(jakarta.nosql.keyvalue.KeyValueEntity) Test(org.junit.jupiter.api.Test)

Aggregations

KeyValueEntity (jakarta.nosql.keyvalue.KeyValueEntity)38 Test (org.junit.jupiter.api.Test)31 User (jakarta.nosql.tck.entities.User)11 Duration (java.time.Duration)7 Value (jakarta.nosql.Value)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 ValueSource (org.junit.jupiter.params.provider.ValueSource)6 TypeReference (jakarta.nosql.TypeReference)3 KeyValuePreparedStatement (jakarta.nosql.keyvalue.KeyValuePreparedStatement)3 Params (jakarta.nosql.Params)2 QueryException (jakarta.nosql.QueryException)1 KeyValueEntityPostPersist (jakarta.nosql.mapping.keyvalue.KeyValueEntityPostPersist)1 KeyValueEntityPrePersist (jakarta.nosql.mapping.keyvalue.KeyValueEntityPrePersist)1 PutQuery (jakarta.nosql.query.PutQuery)1 Car (jakarta.nosql.tck.entities.Car)1 Person (jakarta.nosql.tck.entities.Person)1 User (org.eclipse.jnosql.communication.hazelcast.keyvalue.model.User)1 User (org.eclipse.jnosql.communication.infinispan.keyvalue.model.User)1 User (org.eclipse.jnosql.communication.memcached.keyvalue.model.User)1