use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana 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 jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana 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());
}
use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana by eclipse.
the class DefaultKeyValueTemplateTest method shouldInsertIterable.
@Test
public void shouldInsertIterable() {
User user = new User(KEY, "otavio", 27);
subject.insert(singletonList(user));
Mockito.verify(manager).put(captor.capture());
KeyValueEntity entity = captor.getValue();
assertEquals(KEY, entity.getKey());
assertEquals(user, entity.getValue());
}
use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana 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());
}
use of jakarta.nosql.keyvalue.KeyValueEntity in project jnosql-diana by eclipse.
the class DefaultKeyValueTemplateTest method shouldUpdateIterable.
@Test
public void shouldUpdateIterable() {
User user = new User(KEY, "otavio", 27);
subject.update(singletonList(user));
Mockito.verify(manager).put(captor.capture());
KeyValueEntity entity = captor.getValue();
assertEquals(KEY, entity.getKey());
assertEquals(user, entity.getValue());
}
Aggregations