From 7a847db62b1dc06be40d173f94eeca99ef017df4 Mon Sep 17 00:00:00 2001 From: Marie Verdonck Date: Fri, 8 Nov 2019 09:02:39 +0100 Subject: [PATCH] Feedback on PR 2561 --- .../rest/matcher/SubmissionFormFieldMatcher.java | 14 ++++---------- dspace/config/submission-forms.xml | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java index bf070d582c..67f2494cf3 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java @@ -13,8 +13,6 @@ import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; -import javax.annotation.Nullable; - import org.hamcrest.Matcher; /** @@ -128,14 +126,12 @@ public class SubmissionFormFieldMatcher { String relationshipType, String filter, String searchConfiguration, - @Nullable Boolean nameVariants) { + boolean nameVariants) { return allOf( hasJsonPath("$.selectableRelationship.relationshipType", is(relationshipType)), hasJsonPath("$.selectableRelationship.filter", is(filter)), hasJsonPath("$.selectableRelationship.searchConfiguration", is(searchConfiguration)), - nameVariants != null ? - hasJsonPath("$.selectableRelationship.nameVariants", is(nameVariants.toString())) - : hasNoJsonPath("$.selectableRelationship.nameVariants"), + hasJsonPath("$.selectableRelationship.nameVariants", is(String.valueOf(nameVariants))), matchFormFieldDefinition(type, label, mandatoryMessage, repeatable, hints, metadata)); } @@ -169,14 +165,12 @@ public class SubmissionFormFieldMatcher { String relationshipType, String filter, String searchConfiguration, - @Nullable Boolean nameVariants) { + boolean nameVariants) { return allOf( hasJsonPath("$.selectableRelationship.relationshipType", is(relationshipType)), hasJsonPath("$.selectableRelationship.filter", is(filter)), hasJsonPath("$.selectableRelationship.searchConfiguration", is(searchConfiguration)), - nameVariants != null ? - hasJsonPath("$.selectableRelationship.nameVariants", is(nameVariants.toString())) - : hasNoJsonPath("$.selectableRelationship.nameVariants"), + hasJsonPath("$.selectableRelationship.nameVariants", is(String.valueOf(nameVariants))), hasJsonPath("$.label", is(label)), mandatoryMessage != null ? hasJsonPath("$.mandatoryMessage", containsString(mandatoryMessage)) : hasNoJsonPath("$.mandatoryMessage"), diff --git a/dspace/config/submission-forms.xml b/dspace/config/submission-forms.xml index c3296d4df9..52d4cf4ce9 100644 --- a/dspace/config/submission-forms.xml +++ b/dspace/config/submission-forms.xml @@ -14,7 +14,7 @@ - +