@Test void testGetFolder() { String folderId = "myFolderId"; Package packageParent = mock(Package.class); when(packageParent.getId()).thenReturn("parentId"); when(packageParent.getLabel()).thenReturn("parentLabel"); Package aPackage = mock(Package.class); when(aPackage.getId()).thenReturn(folderId); when(aPackage.getLabel()).thenReturn("packageLabel"); when(aPackage.getParent()).thenReturn(packageParent); when(dataService.findOneById(PACKAGE, folderId, Package.class)).thenReturn(aPackage); assertEquals( create(folderId, "packageLabel", create("parentId", "parentLabel", null)), navigatorServiceImpl.getFolder(folderId)); }
@Transactional(readOnly = true) @Override public @Nullable @CheckForNull Folder getFolder(@Nullable @CheckForNull String folderId) { Package aPackage = getPackage(folderId); return toFolder(aPackage); }
NavigatorServiceImpl implements NavigatorService { @Transactional(readOnly = true) @Override public @Nullable @CheckForNull Folder getFolder(@Nullable @CheckForNull String folderId) { Package aPackage = getPackage(folderId); return toFolder(aPackage); } }
NavigatorServiceImpl implements NavigatorService { @Transactional(readOnly = true) @Override public @Nullable @CheckForNull Folder getFolder(@Nullable @CheckForNull String folderId) { Package aPackage = getPackage(folderId); return toFolder(aPackage); } NavigatorServiceImpl(
      DataService dataService,
      JobExecutor jobExecutor,
      ResourceDownloadJobExecutionFactory downloadJobExecutionFactory,
      ResourceCopyJobExecutionFactory copyJobExecutionFactory,
      ResourceDeleteJobExecutionFactory resourceDeleteJobExecutionFactory); }
NavigatorServiceImpl implements NavigatorService { @Transactional(readOnly = true) @Override public @Nullable @CheckForNull Folder getFolder(@Nullable @CheckForNull String folderId) { Package aPackage = getPackage(folderId); return toFolder(aPackage); } NavigatorServiceImpl(
      DataService dataService,
      JobExecutor jobExecutor,
      ResourceDownloadJobExecutionFactory downloadJobExecutionFactory,
      ResourceCopyJobExecutionFactory copyJobExecutionFactory,
      ResourceDeleteJobExecutionFactory resourceDeleteJobExecutionFactory); @Transactional(readOnly = true) @Override @Nullable @CheckForNull Folder getFolder(@Nullable @CheckForNull String folderId); @Transactional(readOnly = true) @Override List<Resource> getResources(@Nullable @CheckForNull String folderId); @Transactional(readOnly = true) @Override List<Resource> findResources(String query); @Transactional @Override void moveResources(
      List<ResourceIdentifier> resources, @Nullable @CheckForNull String targetFolderId); @Override JobExecution copyResources(
      List<ResourceIdentifier> resources, @Nullable @CheckForNull String targetFolderId); @Override JobExecution downloadResources(List<ResourceIdentifier> resources); @Transactional @Override JobExecution deleteResources(List<ResourceIdentifier> resources); @Transactional @Override void updateResource(Resource resource); }
NavigatorServiceImpl implements NavigatorService { @Transactional(readOnly = true) @Override public @Nullable @CheckForNull Folder getFolder(@Nullable @CheckForNull String folderId) { Package aPackage = getPackage(folderId); return toFolder(aPackage); } NavigatorServiceImpl(
      DataService dataService,
      JobExecutor jobExecutor,
      ResourceDownloadJobExecutionFactory downloadJobExecutionFactory,
      ResourceCopyJobExecutionFactory copyJobExecutionFactory,
      ResourceDeleteJobExecutionFactory resourceDeleteJobExecutionFactory); @Transactional(readOnly = true) @Override @Nullable @CheckForNull Folder getFolder(@Nullable @CheckForNull String folderId); @Transactional(readOnly = true) @Override List<Resource> getResources(@Nullable @CheckForNull String folderId); @Transactional(readOnly = true) @Override List<Resource> findResources(String query); @Transactional @Override void moveResources(
      List<ResourceIdentifier> resources, @Nullable @CheckForNull String targetFolderId); @Override JobExecution copyResources(
      List<ResourceIdentifier> resources, @Nullable @CheckForNull String targetFolderId); @Override JobExecution downloadResources(List<ResourceIdentifier> resources); @Transactional @Override JobExecution deleteResources(List<ResourceIdentifier> resources); @Transactional @Override void updateResource(Resource resource);  }