Skip to content

Commit

Permalink
Remove useless method and modify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ppouchin committed Feb 23, 2024
1 parent 53a5742 commit 76791a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
21 changes: 1 addition & 20 deletions src/main/java/fr/igred/omero/AnnotatableWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ public List<FileAnnotationWrapper> getFileAnnotations(Client client)
*/
public <A extends GenericAnnotationWrapper<?>> void unlink(Client client, A annotation)
throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException {
removeLink(client, annotationLinkType(), annotation.getId());
removeLinks(client, annotationLinkType(), Collections.singletonList(annotation.getId()));
}


Expand All @@ -861,25 +861,6 @@ public <A extends GenericAnnotationWrapper<?>> void unlink(Client client, Collec
}


/**
* Removes the link of the given type with the given child ID.
*
* @param client The client handling the connection.
* @param linkType The link type.
* @param childId Link child ID.
*
* @throws ServiceException Cannot connect to OMERO.
* @throws AccessException Cannot access data.
* @throws ExecutionException A Facility can't be retrieved or instantiated.
* @throws OMEROServerError Server error.
* @throws InterruptedException If block(long) does not return.
*/
protected void removeLink(Client client, String linkType, long childId)
throws ServiceException, OMEROServerError, AccessException, ExecutionException, InterruptedException {
removeLinks(client, linkType, Collections.singletonList(childId));
}


/**
* Removes the link of the given type with the given child IDs.
*
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/fr/igred/omero/repository/FolderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void testAddAndRemoveTagFromFolder() throws Exception {

List<TagAnnotationWrapper> tags = folder.getTags(client);
assertEquals(1, tags.size());
folder.unlink(client, tags.get(0));
folder.unlink(client, tags);

List<TagAnnotationWrapper> removed = folder.getTags(client);
assertEquals(0, removed.size());
Expand Down

0 comments on commit 76791a4

Please sign in to comment.