use of jakarta.nosql.tck.entities.Actor in project jnosql-diana by eclipse.
the class DefaultColumnEntityConverterTest method shouldReturnErrorWhenToEntityIsNull.
@Test
public void shouldReturnErrorWhenToEntityIsNull() {
ColumnEntity entity = ColumnEntity.of("Actor");
Stream.of(columns).forEach(entity::add);
Actor actor = Actor.actorBuilder().build();
assertThrows(NullPointerException.class, () -> converter.toEntity(null, entity));
assertThrows(NullPointerException.class, () -> converter.toEntity(actor, null));
}
use of jakarta.nosql.tck.entities.Actor in project jnosql-diana by eclipse.
the class DefaultColumnEntityConverterTest method shouldConvertColumnEntityToEntity2.
@Test
public void shouldConvertColumnEntityToEntity2() {
ColumnEntity entity = ColumnEntity.of("Actor");
Stream.of(columns).forEach(entity::add);
Actor actor = converter.toEntity(entity);
assertNotNull(actor);
assertEquals(10, actor.getAge());
assertEquals(12L, actor.getId());
assertEquals(asList("234", "2342"), actor.getPhones());
assertEquals(Collections.singletonMap("JavaZone", "Jedi"), actor.getMovieCharacter());
assertEquals(Collections.singletonMap("JavaZone", 10), actor.getMovieRating());
}
use of jakarta.nosql.tck.entities.Actor in project jnosql-diana by eclipse.
the class DefaultColumnEntityConverterTest method shouldConvertColumnEntityToEntity.
@Test
public void shouldConvertColumnEntityToEntity() {
ColumnEntity entity = ColumnEntity.of("Actor");
Stream.of(columns).forEach(entity::add);
Actor actor = converter.toEntity(Actor.class, entity);
assertNotNull(actor);
assertEquals(10, actor.getAge());
assertEquals(12L, actor.getId());
assertEquals(asList("234", "2342"), actor.getPhones());
assertEquals(Collections.singletonMap("JavaZone", "Jedi"), actor.getMovieCharacter());
assertEquals(Collections.singletonMap("JavaZone", 10), actor.getMovieRating());
}
use of jakarta.nosql.tck.entities.Actor in project jnosql-diana by eclipse.
the class DefaultColumnEntityConverterTest method shouldConvertColumnEntityToExistEntity.
@Test
public void shouldConvertColumnEntityToExistEntity() {
ColumnEntity entity = ColumnEntity.of("Actor");
Stream.of(columns).forEach(entity::add);
Actor actor = Actor.actorBuilder().build();
Actor result = converter.toEntity(actor, entity);
assertSame(actor, result);
assertEquals(10, actor.getAge());
assertEquals(12L, actor.getId());
assertEquals(asList("234", "2342"), actor.getPhones());
assertEquals(Collections.singletonMap("JavaZone", "Jedi"), actor.getMovieCharacter());
assertEquals(Collections.singletonMap("JavaZone", 10), actor.getMovieRating());
}
Aggregations