@Test public void testMultiDeleteNotFound() { TestWorkspaceAwareResource r1 = new TestWorkspaceAwareResource(1L, workspace, "name2"); Set<String> names = ImmutableSet.of("badname1", "name2", "badname3"); when(testRepository.findByNameInAndWorkspaceId(names, 1L)) .thenReturn(ImmutableSet.of(r1)); thrown.expect(NotFoundException.class); thrown.expectMessage("No resource(s) found with name(s) ''badname1', 'badname3''"); underTest.deleteMultipleByNameFromWorkspace(names, 1L); }
@Override public Set<T> deleteMultipleByNameFromWorkspace(Set<String> names, Long workspaceId) { Set<T> toBeDeleted = getByNamesForWorkspaceId(names, workspaceId); return delete(toBeDeleted); }
AbstractWorkspaceAwareResourceService implements WorkspaceAwareResourceService<T> { @Override public Set<T> deleteMultipleByNameFromWorkspace(Set<String> names, Long workspaceId) { Set<T> toBeDeleted = getByNamesForWorkspaceId(names, workspaceId); return delete(toBeDeleted); } }
AbstractWorkspaceAwareResourceService implements WorkspaceAwareResourceService<T> { @Override public Set<T> deleteMultipleByNameFromWorkspace(Set<String> names, Long workspaceId) { Set<T> toBeDeleted = getByNamesForWorkspaceId(names, workspaceId); return delete(toBeDeleted); }  }
AbstractWorkspaceAwareResourceService implements WorkspaceAwareResourceService<T> { @Override public Set<T> deleteMultipleByNameFromWorkspace(Set<String> names, Long workspaceId) { Set<T> toBeDeleted = getByNamesForWorkspaceId(names, workspaceId); return delete(toBeDeleted); }  @Override T createForLoggedInUser(T resource, @Nonnull Long workspaceId); @Override T create(T resource, @Nonnull Long workspaceId, User user); @Override T createWithMdcContextRestore(T resource, Workspace workspace, User user); @Override T create(T resource, Workspace workspace, User user); @Override T getByNameForWorkspace(String name, Workspace workspace); @Override Set<T> getByNamesForWorkspaceId(Set<String> names, Long workspaceId); @Override T getByNameForWorkspaceId(String name, Long workspaceId); @Override Set<T> findAllByWorkspace(Workspace workspace); @Override Set<T> findAllByWorkspaceId(Long workspaceId); @Override T deleteWithMdcContextRestore(T resource); @Override T delete(T resource); @Override Set<T> delete(Set<T> resources); @Override T deleteByNameFromWorkspace(String name, Long workspaceId); @Override Set<T> deleteMultipleByNameFromWorkspace(Set<String> names, Long workspaceId); @Override Iterable<T> findAll(); @Override T pureSave(T resource); @Override Iterable<T> pureSaveAll(Iterable<T> resources); WorkspaceService getWorkspaceService(); }
AbstractWorkspaceAwareResourceService implements WorkspaceAwareResourceService<T> { @Override public Set<T> deleteMultipleByNameFromWorkspace(Set<String> names, Long workspaceId) { Set<T> toBeDeleted = getByNamesForWorkspaceId(names, workspaceId); return delete(toBeDeleted); }  @Override T createForLoggedInUser(T resource, @Nonnull Long workspaceId); @Override T create(T resource, @Nonnull Long workspaceId, User user); @Override T createWithMdcContextRestore(T resource, Workspace workspace, User user); @Override T create(T resource, Workspace workspace, User user); @Override T getByNameForWorkspace(String name, Workspace workspace); @Override Set<T> getByNamesForWorkspaceId(Set<String> names, Long workspaceId); @Override T getByNameForWorkspaceId(String name, Long workspaceId); @Override Set<T> findAllByWorkspace(Workspace workspace); @Override Set<T> findAllByWorkspaceId(Long workspaceId); @Override T deleteWithMdcContextRestore(T resource); @Override T delete(T resource); @Override Set<T> delete(Set<T> resources); @Override T deleteByNameFromWorkspace(String name, Long workspaceId); @Override Set<T> deleteMultipleByNameFromWorkspace(Set<String> names, Long workspaceId); @Override Iterable<T> findAll(); @Override T pureSave(T resource); @Override Iterable<T> pureSaveAll(Iterable<T> resources); WorkspaceService getWorkspaceService();  }