use of org.activityinfo.server.database.hibernate.entity.Bounds in project activityinfo by bedatadriven.
the class AdminEntityMappingTest method testBounds.
@Test
public void testBounds() {
Bounds bounds = new Bounds();
bounds.setX1(1.0);
bounds.setY1(2.0);
bounds.setX2(3.0);
bounds.setY2(4.0);
AdminLevel level = new AdminLevel();
level.setId(81);
level.setName("My Level");
AdminEntity parent = new AdminEntity();
parent.setId(93);
AdminEntity entity = new AdminEntity();
entity.setLevel(level);
entity.setParent(parent);
entity.setBounds(bounds);
AdminEntityDTO dto = mapper.map(entity, AdminEntityDTO.class);
Assert.assertEquals("parentId", parent.getId(), dto.getParentId().intValue());
Assert.assertEquals("levelId", level.getId(), dto.getLevelId());
Assert.assertNotNull("bounds", dto.getBounds());
Assert.assertEquals("x1", bounds.getX1(), dto.getBounds().getMinLon());
Assert.assertEquals("y1", bounds.getY1(), dto.getBounds().getMinLat());
Assert.assertEquals("x2", bounds.getX2(), dto.getBounds().getMaxLon());
Assert.assertEquals("y2", bounds.getY2(), dto.getBounds().getMaxLat());
}
Aggregations