@Test public void testGetWhenDatabaseHasEntryWithProvidedIdThenThatactualShouldReturn() { FileSystem expected = createFileSystem(); when(fileSystemRepository.findById(TEST_FILES_SYSTEM_ID)).thenReturn(Optional.of(expected)); FileSystem actual = underTest.getByIdFromAnyAvailableWorkspace(TEST_FILES_SYSTEM_ID); Assert.assertEquals(expected, actual); Assert.assertEquals(expected.getId(), actual.getId()); verify(fileSystemRepository, times(1)).findById(TEST_FILES_SYSTEM_ID); }
public FileSystem getByIdFromAnyAvailableWorkspace(Long id) { return fileSystemRepository.findById(id).orElseThrow(notFound("File system", id)); }
FileSystemConfigService extends AbstractWorkspaceAwareResourceService<FileSystem> { public FileSystem getByIdFromAnyAvailableWorkspace(Long id) { return fileSystemRepository.findById(id).orElseThrow(notFound("File system", id)); } }
FileSystemConfigService extends AbstractWorkspaceAwareResourceService<FileSystem> { public FileSystem getByIdFromAnyAvailableWorkspace(Long id) { return fileSystemRepository.findById(id).orElseThrow(notFound("File system", id)); }  }
FileSystemConfigService extends AbstractWorkspaceAwareResourceService<FileSystem> { public FileSystem getByIdFromAnyAvailableWorkspace(Long id) { return fileSystemRepository.findById(id).orElseThrow(notFound("File system", id)); }  @Override WorkspaceResourceRepository<FileSystem, Long> repository(); FileSystem getByIdFromAnyAvailableWorkspace(Long id); }
FileSystemConfigService extends AbstractWorkspaceAwareResourceService<FileSystem> { public FileSystem getByIdFromAnyAvailableWorkspace(Long id) { return fileSystemRepository.findById(id).orElseThrow(notFound("File system", id)); }  @Override WorkspaceResourceRepository<FileSystem, Long> repository(); FileSystem getByIdFromAnyAvailableWorkspace(Long id);  }