Feedback on PR 2561

This commit is contained in:
Marie Verdonck
2019-11-08 09:02:39 +01:00
parent df7ee6410c
commit 7a847db62b
2 changed files with 5 additions and 11 deletions

View File

@@ -13,8 +13,6 @@ import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import javax.annotation.Nullable;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
/** /**
@@ -128,14 +126,12 @@ public class SubmissionFormFieldMatcher {
String relationshipType, String relationshipType,
String filter, String filter,
String searchConfiguration, String searchConfiguration,
@Nullable Boolean nameVariants) { boolean nameVariants) {
return allOf( return allOf(
hasJsonPath("$.selectableRelationship.relationshipType", is(relationshipType)), hasJsonPath("$.selectableRelationship.relationshipType", is(relationshipType)),
hasJsonPath("$.selectableRelationship.filter", is(filter)), hasJsonPath("$.selectableRelationship.filter", is(filter)),
hasJsonPath("$.selectableRelationship.searchConfiguration", is(searchConfiguration)), hasJsonPath("$.selectableRelationship.searchConfiguration", is(searchConfiguration)),
nameVariants != null ? hasJsonPath("$.selectableRelationship.nameVariants", is(String.valueOf(nameVariants))),
hasJsonPath("$.selectableRelationship.nameVariants", is(nameVariants.toString()))
: hasNoJsonPath("$.selectableRelationship.nameVariants"),
matchFormFieldDefinition(type, label, mandatoryMessage, repeatable, hints, metadata)); matchFormFieldDefinition(type, label, mandatoryMessage, repeatable, hints, metadata));
} }
@@ -169,14 +165,12 @@ public class SubmissionFormFieldMatcher {
String relationshipType, String relationshipType,
String filter, String filter,
String searchConfiguration, String searchConfiguration,
@Nullable Boolean nameVariants) { boolean nameVariants) {
return allOf( return allOf(
hasJsonPath("$.selectableRelationship.relationshipType", is(relationshipType)), hasJsonPath("$.selectableRelationship.relationshipType", is(relationshipType)),
hasJsonPath("$.selectableRelationship.filter", is(filter)), hasJsonPath("$.selectableRelationship.filter", is(filter)),
hasJsonPath("$.selectableRelationship.searchConfiguration", is(searchConfiguration)), hasJsonPath("$.selectableRelationship.searchConfiguration", is(searchConfiguration)),
nameVariants != null ? hasJsonPath("$.selectableRelationship.nameVariants", is(String.valueOf(nameVariants))),
hasJsonPath("$.selectableRelationship.nameVariants", is(nameVariants.toString()))
: hasNoJsonPath("$.selectableRelationship.nameVariants"),
hasJsonPath("$.label", is(label)), hasJsonPath("$.label", is(label)),
mandatoryMessage != null ? hasJsonPath("$.mandatoryMessage", containsString(mandatoryMessage)) : mandatoryMessage != null ? hasJsonPath("$.mandatoryMessage", containsString(mandatoryMessage)) :
hasNoJsonPath("$.mandatoryMessage"), hasNoJsonPath("$.mandatoryMessage"),

View File

@@ -14,7 +14,7 @@
<!-- Each form set contains an ordered set of pages; each page defines --> <!-- Each form set contains an ordered set of pages; each page defines -->
<!-- one submission metadata entry screen. Each page has an ordered list --> <!-- one submission metadata entry screen. Each page has an ordered list -->
<!-- of field definitions, Each field definition corresponds to one --> <!-- of field definitions, Each field definition corresponds to one -->
<!-- metadata entry (a so-called row), which has a DC element name, a --> <!-- metadata entry (a so-called row), which has a DC element name, a -->
<!-- displayed label, a text string prompt which is called a hint, and --> <!-- displayed label, a text string prompt which is called a hint, and -->
<!-- an input-type. Each field also may hold optional elements: DC --> <!-- an input-type. Each field also may hold optional elements: DC -->
<!-- qualifier name, a repeatable flag, and a text string whose presence --> <!-- qualifier name, a repeatable flag, and a text string whose presence -->