@Test public void testGetWhenThereIsNoEntryWithGivenIdThenFileSystemConfigExceptionShouldComeInsteadOfNull() { when(fileSystemRepository.findById(NOT_EXISTING_ID)).thenReturn(Optional.ofNullable(null)); expectedException.expect(NotFoundException.class); expectedException.expectMessage(String.format(NOT_FOUND_EXCEPTION_MESSAGE, NOT_EXISTING_ID)); underTest.getByIdFromAnyAvailableWorkspace(NOT_EXISTING_ID); verify(fileSystemRepository, times(1)).findById(NOT_EXISTING_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);  }