use of jakarta.nosql.tck.entities.Car in project jnosql-diana by eclipse.
the class DefaultKeyValueEntityConverterTest method shouldConvertToKeyWhenThereIsConverterAnnotation.
@Test
public void shouldConvertToKeyWhenThereIsConverterAnnotation() {
Car car = new Car();
car.setPlate(Plate.of("123-BRL"));
car.setName("Ferrari");
KeyValueEntity entity = converter.toKeyValue(car);
Assertions.assertEquals("123-BRL", entity.getKey());
Assertions.assertEquals(car, entity.getValue());
}
use of jakarta.nosql.tck.entities.Car in project jnosql-diana by eclipse.
the class DefaultKeyValueEntityConverterTest method shouldConvertToEntityKeyWhenThereIsConverterAnnotation.
@Test
public void shouldConvertToEntityKeyWhenThereIsConverterAnnotation() {
Car car = new Car();
car.setName("Ferrari");
Car ferrari = converter.toEntity(Car.class, KeyValueEntity.of("123-BRL", car));
assertEquals(Plate.of("123-BRL"), ferrari.getPlate());
assertEquals(car.getName(), ferrari.getName());
}
Aggregations