@Test @DisplayName("Propagates Database Exception") void testCreateGroupDataException() throws Exception { when(group.getName()).thenReturn("test.new.data"); when(storageProvider.exists(any())).thenReturn(false); DatabaseException exception = new DatabaseException("Test"); when(databaseProvider.create(any(), any())).thenThrow(exception); assertThatThrownBy(() -> dataStore.getGroupData(group)) .hasCause(exception); }
@Override public GroupData getGroupData(InMemoryGroup group) { try { return getGroupData0(group); } catch (DatabaseException exc) { throw new IllegalStateException(exc); } }
PersistedGroupDataStore implements GroupDataStore { @Override public GroupData getGroupData(InMemoryGroup group) { try { return getGroupData0(group); } catch (DatabaseException exc) { throw new IllegalStateException(exc); } } }
PersistedGroupDataStore implements GroupDataStore { @Override public GroupData getGroupData(InMemoryGroup group) { try { return getGroupData0(group); } catch (DatabaseException exc) { throw new IllegalStateException(exc); } } PersistedGroupDataStore(StorageProvider storageProvider);  PersistedGroupDataStore(StorageProvider storageProvider, DatabaseProvider provider); }
PersistedGroupDataStore implements GroupDataStore { @Override public GroupData getGroupData(InMemoryGroup group) { try { return getGroupData0(group); } catch (DatabaseException exc) { throw new IllegalStateException(exc); } } PersistedGroupDataStore(StorageProvider storageProvider);  PersistedGroupDataStore(StorageProvider storageProvider, DatabaseProvider provider); @Override GroupData getGroupData(InMemoryGroup group); }
PersistedGroupDataStore implements GroupDataStore { @Override public GroupData getGroupData(InMemoryGroup group) { try { return getGroupData0(group); } catch (DatabaseException exc) { throw new IllegalStateException(exc); } } PersistedGroupDataStore(StorageProvider storageProvider);  PersistedGroupDataStore(StorageProvider storageProvider, DatabaseProvider provider); @Override GroupData getGroupData(InMemoryGroup group);  }