use of jakarta.nosql.tck.entities.Job in project jnosql-diana by eclipse.
the class DefaultDocumentEntityConverterTest method shouldConvertToEntityWhenHasConverter.
@Test
public void shouldConvertToEntityWhenHasConverter() {
Worker worker = new Worker();
Job job = new Job();
job.setCity("Sao Paulo");
job.setDescription("Java Developer");
worker.setName("Bob");
worker.setSalary(new Money("BRL", BigDecimal.TEN));
worker.setJob(job);
DocumentEntity entity = converter.toDocument(worker);
Worker worker1 = converter.toEntity(entity);
assertEquals(worker.getSalary(), worker1.getSalary());
assertEquals(job.getCity(), worker1.getJob().getCity());
assertEquals(job.getDescription(), worker1.getJob().getDescription());
}
use of jakarta.nosql.tck.entities.Job in project jnosql-diana by eclipse.
the class DefaultColumnEntityConverterTest method shouldConvertToEntityWhenHasConverter.
@Test
public void shouldConvertToEntityWhenHasConverter() {
Worker worker = new Worker();
Job job = new Job();
job.setCity("Sao Paulo");
job.setDescription("Java Developer");
worker.setName("Bob");
worker.setSalary(new Money("BRL", BigDecimal.TEN));
worker.setJob(job);
ColumnEntity entity = converter.toColumn(worker);
Worker worker1 = converter.toEntity(entity);
assertEquals(worker.getSalary(), worker1.getSalary());
assertEquals(job.getCity(), worker1.getJob().getCity());
assertEquals(job.getDescription(), worker1.getJob().getDescription());
}
use of jakarta.nosql.tck.entities.Job in project jnosql-diana by eclipse.
the class DefaultDocumentEntityConverterTest method shouldConvertToDocumentWhenHaConverter.
@Test
public void shouldConvertToDocumentWhenHaConverter() {
Worker worker = new Worker();
Job job = new Job();
job.setCity("Sao Paulo");
job.setDescription("Java Developer");
worker.setName("Bob");
worker.setSalary(new Money("BRL", BigDecimal.TEN));
worker.setJob(job);
DocumentEntity entity = converter.toDocument(worker);
assertEquals("Worker", entity.getName());
assertEquals("Bob", entity.find("name").get().get());
assertEquals("Sao Paulo", entity.find("city").get().get());
assertEquals("Java Developer", entity.find("description").get().get());
assertEquals("BRL 10", entity.find("money").get().get());
}
use of jakarta.nosql.tck.entities.Job in project jnosql-diana by eclipse.
the class DefaultColumnEntityConverterTest method shouldConvertToColumnWhenHaConverter.
@Test
public void shouldConvertToColumnWhenHaConverter() {
Worker worker = new Worker();
Job job = new Job();
job.setCity("Sao Paulo");
job.setDescription("Java Developer");
worker.setName("Bob");
worker.setSalary(new Money("BRL", BigDecimal.TEN));
worker.setJob(job);
ColumnEntity entity = converter.toColumn(worker);
assertEquals("Worker", entity.getName());
assertEquals("Bob", entity.find("name").get().get());
assertEquals("Sao Paulo", entity.find("city").get().get());
assertEquals("Java Developer", entity.find("description").get().get());
assertEquals("BRL 10", entity.find("money").get().get());
}
Aggregations