use of com.quorum.tessera.data.EntityManagerTemplate in project tessera by ConsenSys.
the class PrivacyGroupDAOTest method retrieveOrSaveThrows.
@Test(expected = IllegalStateException.class)
public void retrieveOrSaveThrows() {
EntityManagerTemplate template = new EntityManagerTemplate(ENTITY_MANAGER.get().getEntityManagerFactory());
Supplier<PrivacyGroupEntity> mockRetriever = mock(Supplier.class);
when(mockRetriever.get()).thenReturn(null);
Supplier<PrivacyGroupEntity> mockFactory = mock(Supplier.class);
when(mockFactory.get()).thenThrow(new IllegalStateException("OUCH"));
template.retrieveOrSave(mockRetriever, mockFactory);
}
Aggregations