Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertNull

0
 
    @Test 
    public void testGetInvalidId() { 
        Component result = componentDao.get(-567890L); 
 
        assertNull(result); 
    } 
 
    @Test 
    public void testUpdate() { 
        String newUuid = "1234-1231-1231"; 
        Component component = PersistedObjectsFactory.getDefaultComponent(); 
        session.save(component); 
        component.setUuid(newUuid); 
 
        componentDao.saveOrUpdate(component); 
        session.flush(); 
        session.evict(component); 
        Component result = (Component) session.get(Component.class, component.getId());