Skip to content

Commit

Permalink
Merge pull request #274 from entur/fix_service_link_validation
Browse files Browse the repository at this point in the history
Fix validation ServiceLink rule
  • Loading branch information
vpaturet authored Jan 9, 2025
2 parents fb404f0 + 8a00494 commit fd56306
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ public ValidationTreeBuilder builder() {
)
.withRule(
new ValidateNotExist(
"serviceLinks/ServiceLink/projections/LinkSequenceProjection/g:LineString[count(g:pos) < 2]",
"serviceLinks/ServiceLink/projections/LinkSequenceProjection/g:LineString[count(g:pos) = 1]",
CODE_SERVICE_LINK_5,
"ServiceLink less than 2 points",
"Less then 2 points on ServiceLink",
"Less than 2 points on ServiceLink",
Severity.WARNING
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,17 @@ void testServiceLinkWithTwoPoints() {
);
assertTrue(validationIssues.isEmpty());
}

@Test
void testServiceLinkWithPosList() {
XPathRuleValidationContext xpathValidationContext =
TestValidationContextBuilder
.ofNetexFragment(NETEX_FRAGMENT_SERVICE_LINK_VALID_COORDINATE_LIST)
.build();
List<ValidationIssue> validationIssues = validationTree.validate(
xpathValidationContext,
CODE_SERVICE_LINK_5
);
assertTrue(validationIssues.isEmpty());
}
}

0 comments on commit fd56306

Please sign in to comment.