[java-identity-provider] 03/03: JSPT-95 Fix over eager tests.
Rod Widdowson
rdw at steadingsoftware.com
Mon May 4 14:38:46 UTC 2020
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch dev/JSPT-95
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=c4f469b27be742a9f9b38f4bd94ddc8c0f67af24
commit c4f469b27be742a9f9b38f4bd94ddc8c0f67af24
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon May 4 15:05:25 2020 +0100
JSPT-95 Fix over eager tests.
https://issues.shibboleth.net/jira/browse/JSPT-95
It looks as though this is provoked by the current lack of proper "compiler"
support from the GraalVM based Nashorn plugin.
---
.../resolver/spring/ad/ScriptedAttributeParserTest.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/ScriptedAttributeParserTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/ScriptedAttributeParserTest.java
index e8f4207c3..651985c8e 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/ScriptedAttributeParserTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/ScriptedAttributeParserTest.java
@@ -25,7 +25,10 @@ import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.testng.annotations.Test;
+import net.shibboleth.idp.attribute.resolver.ResolutionException;
import net.shibboleth.idp.attribute.resolver.ad.impl.ScriptedAttributeDefinition;
+import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
+import net.shibboleth.idp.attribute.resolver.context.AttributeResolverWorkContext;
import net.shibboleth.idp.attribute.resolver.spring.BaseAttributeDefinitionParserTest;
import net.shibboleth.idp.attribute.resolver.spring.ad.impl.ScriptedAttributeDefinitionParser;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
@@ -72,11 +75,14 @@ public class ScriptedAttributeParserTest extends BaseAttributeDefinitionParserTe
assertEquals(StringSupport.trim(attrDef.getScript().getScript()), "foo=bar();");
}
- @Test public void bad() {
+ @Test public void bad() throws ResolutionException {
try {
- getAttributeDefn("resolver/scriptedAttributeBad.xml", ScriptedAttributeDefinition.class);
+ final ScriptedAttributeDefinition attrdef = getAttributeDefn("resolver/scriptedAttributeBad.xml", ScriptedAttributeDefinition.class);
+ AttributeResolutionContext arc = new AttributeResolutionContext();
+ arc.getSubcontext(AttributeResolverWorkContext.class, true);
+ attrdef.resolve(arc);
fail("Bad script worked?");
- } catch (BeanDefinitionStoreException | BeanCreationException e) {
+ } catch (BeanDefinitionStoreException | BeanCreationException | ResolutionException e) {
// OK
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list