Skip to content

Commit 4359f12

Browse files
committed
Confirm that services factories work fine in Matchers
I can no longer replicate the original problems: - Missing metadata values when matching EPerson created outside of builders (could be related to DSpace#10193) - NPE when retrieving services from factories in class body
1 parent 86f8c0d commit 4359f12

File tree

5 files changed

+0
-6
lines changed

5 files changed

+0
-6
lines changed

dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/BitstreamMatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.hamcrest.Matcher;
2929

3030
public class BitstreamMatcher {
31-
// todo: this may not work in all cases!
3231
private static final BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
3332
private static final BundleService bundleService = ContentServiceFactory.getInstance().getBundleService();
3433

dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/EPersonMatcher.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.hamcrest.Matchers;
2727

2828
public class EPersonMatcher {
29-
// todo: this may not work in all cases!
3029
public static final EPersonService epersonService = EPersonServiceFactory.getInstance().getEPersonService();
3130

3231
private EPersonMatcher() { }
@@ -91,7 +90,6 @@ public static Matcher<? super Object> matchProperties(EPerson ePerson) {
9190
hasJsonPath("$.type", is("eperson")),
9291
hasJsonPath("$.canLogIn", not(empty())),
9392
hasJsonPath("$.metadata", Matchers.allOf(
94-
// todo: this fails when matching against the eperson from AbstractIntegrationTestWithDatabase
9593
MetadataMatcher.matchMetadata("eperson.firstname", epersonService.getFirstName(ePerson)),
9694
MetadataMatcher.matchMetadata("eperson.lastname", epersonService.getLastName(ePerson))
9795
))

dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/ItemMatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
* @author Raf Ponsaerts (raf dot ponsaerts at atmire dot com)
3030
*/
3131
public class ItemMatcher {
32-
// todo: this may not work in all cases!
3332
private static final ItemService itemService = ContentServiceFactory.getInstance().getItemService();
3433

3534
private ItemMatcher() { }

dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SiteMatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.hamcrest.Matcher;
1919

2020
public class SiteMatcher {
21-
// todo: this may not work in all cases!
2221
private static final SiteService siteService = ContentServiceFactory.getInstance().getSiteService();
2322

2423
private SiteMatcher() { }

dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/WorkflowDefinitionMatcher.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
* @author Maria Verdonck (Atmire) on 03/01/2020
2727
*/
2828
public class WorkflowDefinitionMatcher {
29-
// todo: this may not work in all cases!
3029
private static XmlWorkflowFactory xmlWorkflowFactory = XmlWorkflowServiceFactory.getInstance().getWorkflowFactory();
3130

3231
private static final String WORKFLOW_DEFINITIONS_ENDPOINT

0 commit comments

Comments
 (0)