diff --git a/src/main/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactory.java b/src/main/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactory.java index 808237b..a8ba800 100644 --- a/src/main/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactory.java +++ b/src/main/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactory.java @@ -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 ) ) diff --git a/src/test/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactoryTest.java b/src/test/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactoryTest.java index e8ac85f..628b323 100644 --- a/src/test/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactoryTest.java +++ b/src/test/java/org/entur/netex/validation/validator/xpath/tree/DefaultServiceFrameValidationTreeFactoryTest.java @@ -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 validationIssues = validationTree.validate( + xpathValidationContext, + CODE_SERVICE_LINK_5 + ); + assertTrue(validationIssues.isEmpty()); + } }