From bb0e2bd80e7acfd05c3ae8c0bc015f5f3c49effd Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Tue, 24 Dec 2024 13:47:35 -0500 Subject: [PATCH] Don't harcode ex message for NamedFnRef tests in #283 --- .../metaschema/core/metapath/cst/BuildCstVisitorTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java index c16149294..91cebe1f8 100644 --- a/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java +++ b/core/src/test/java/gov/nist/secauto/metaschema/core/metapath/cst/BuildCstVisitorTest.java @@ -267,13 +267,13 @@ void testForwardstepChild() { static Stream 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); @@ -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)); } }