Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertNotSame, assertReflectionEquals

0
    public void markBranchAsReadedTest() { 
        session.save(user); 
        session.save(branch); 
        BranchReadedMarker marker = dao.markBranchAsRead(user, branch); 
 
        assertNotSame(0, marker.getId()); 
        session.evict(marker); 
 
        BranchReadedMarker result = (BranchReadedMarker)session.get(BranchReadedMarker.class, marker.getId()); 
        assertReflectionEquals(marker, result); 
    } 
 
    @Test 
    public void testGetMarkerFor() { 
        session.save(user); 
        session.save(branch); 
        BranchReadedMarker marker = new BranchReadedMarker(user, branch); 
        session.save(marker); 
 
        session.evict(marker);