@Test @DisplayName("Creates persistent group data") void testCreateGroupData(@Mock DatabaseAccessor accessor) throws Exception { when(group.getName()).thenReturn("test.new.data"); when(storageProvider.exists(any())).thenReturn(false); when(databaseProvider.create(any(), anyString())).thenReturn(accessor); GroupData groupData = dataStore.getGroupData(group); assertThat(groupData).isInstanceOf(PersistedGroupData.class); assertThat(groupData.getGroup()).isSameAs(group); assertThat(groupData.getEntries()).hasSize(0); verify(databaseProvider).create(storageProvider, "test.new.data"); }
@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);  }