BlueprintDAO { @Transactional public void remove(BlueprintEntity blueprintEntity) { ensureStackIdSet(blueprintEntity); entityManagerProvider.get().remove(merge(blueprintEntity)); }  @RequiresSession BlueprintEntity findByName(String blueprint_name); @RequiresSession List<BlueprintEntity> findAll(); @Transactional void refresh(BlueprintEntity blueprintEntity); @Transactional void create(BlueprintEntity blueprintEntity); @Transactional BlueprintEntity merge(BlueprintEntity blueprintEntity); @Transactional void remove(BlueprintEntity blueprintEntity); @Transactional void removeByName(String blueprint_name);  }
@Test public void testRemove() { BlueprintEntity entity = new BlueprintEntity(); BlueprintEntity entity2 = new BlueprintEntity(); expect(entityManager.merge(eq(entity))).andReturn(entity2); entityManager.remove(eq(entity2)); replay(entityManager); BlueprintDAO dao = new BlueprintDAO(); dao.entityManagerProvider = entityManagerProvider; dao.remove(entity); verify(entityManagerProvider, entityManager); }