use of uk.ac.bbsrc.tgac.miso.core.data.BoxPosition in project miso-lims by miso-lims.
the class HibernateBoxDaoIT method testAddItem.
@Test
public void testAddItem() throws IOException {
Box box = dao.get(1L);
String insertPos = "A02";
assertEquals(2, box.getBoxPositions().size());
assertFalse(box.getBoxPositions().containsKey(insertPos));
BoxPosition bp = new BoxPosition(box, insertPos, EntityType.LIBRARY, 1L);
box.getBoxPositions().put(insertPos, bp);
dao.save(box);
sessionFactory.getCurrentSession().flush();
sessionFactory.getCurrentSession().clear();
Box saved = dao.get(1L);
assertEquals(3, saved.getBoxPositions().size());
assertTrue(box.getBoxPositions().containsKey(insertPos));
}
Aggregations