Skip to content

Commit

Permalink
Don't harcode ex message for NamedFnRef tests in metaschema-framework…
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-stein-gsa committed Dec 24, 2024
1 parent 7994005 commit bb0e2bd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ void testForwardstepChild() {
static Stream<Arguments> testNamedFunctionRef() {
return Stream.of(
Arguments.of("fn:string#1", "fn:string", null),
Arguments.of("fn:string#4", null, "MSPT0017"));
Arguments.of("fn:string#4", null, "MPST0017: unable to find function with name 'fn:string' having arity '4'"));
}

@ParameterizedTest
@MethodSource
void testNamedFunctionRef(@NonNull String metapath, @NonNull String expectedQname,
@NonNull Exception expectedExceptionMessage) {
@NonNull String expectedExceptionMessage) {
StaticContext staticContext = StaticContext.builder().build();
DynamicContext dynamicContext = new DynamicContext(staticContext);

Expand All @@ -285,7 +285,7 @@ void testNamedFunctionRef(@NonNull String metapath, @NonNull String expectedQnam
MetapathException thrown = assertThrows(MetapathException.class,
() -> IMetapathExpression.compile(metapath, staticContext).evaluateAs(null,
IMetapathExpression.ResultType.ITEM, dynamicContext));
assertTrue(thrown.getMessage().contains("MSPT0017"));
assertTrue(thrown.getMessage().contains(expectedExceptionMessage));
}
}

Expand Down

0 comments on commit bb0e2bd

Please sign in to comment.