use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-artemis by eclipse.
the class DefaultKeyValueTemplateTest method shouldPut.
@Test
public void shouldPut() {
User user = new User(KEY, "otavio", 27);
subject.put(user);
Mockito.verify(manager).put(captor.capture());
KeyValueEntity entity = captor.getValue();
assertEquals(KEY, entity.getKey());
assertEquals(user, entity.getValue().get());
}
use of org.jnosql.diana.api.key.KeyValueEntity in project jnosql-artemis by eclipse.
the class DefaultKeyValueTemplateTest method shouldPutTTLIterable.
@Test
public void shouldPutTTLIterable() {
Duration duration = Duration.ofSeconds(2L);
User user = new User(KEY, "otavio", 27);
subject.put(singletonList(user), duration);
Mockito.verify(manager).put(captor.capture(), Mockito.eq(duration));
KeyValueEntity entity = captor.getValue();
assertEquals(KEY, entity.getKey());
assertEquals(user, entity.getValue().get());
}