Skip to content

Commit c2b31e1

Browse files
committed
Add test for DatedVehicleJourneyRef referencing DatedServiceJourney
Verify that the ReferenceToValidEntityTypeValidator allows DatedVehicleJourneyRef to reference DatedServiceJourney entities.
1 parent ce3e960 commit c2b31e1

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/test/java/org/entur/netex/validation/validator/id/ReferenceToValidEntityTypeValidatorTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,31 @@ void testValidReferenceType() {
104104
);
105105
Assertions.assertTrue(validationIssues.isEmpty());
106106
}
107+
108+
@Test
109+
void testDatedVehicleJourneyRefReferencingDatedServiceJourney() {
110+
IdVersion idVersion = new IdVersion(
111+
"XXX:DatedServiceJourney:1",
112+
null,
113+
"DatedVehicleJourneyRef",
114+
null,
115+
null,
116+
0,
117+
0
118+
);
119+
List<IdVersion> localRefs = List.of(idVersion);
120+
XPathValidationContext xPathValidationContext = new XPathValidationContext(
121+
null,
122+
null,
123+
TEST_CODESPACE,
124+
null,
125+
Set.of(),
126+
localRefs,
127+
validationReport.getValidationReportId()
128+
);
129+
List<ValidationIssue> validationIssues = referenceToValidEntityTypeValidator.validate(
130+
xPathValidationContext
131+
);
132+
Assertions.assertTrue(validationIssues.isEmpty());
133+
}
107134
}

0 commit comments

Comments
 (0)