[java-idp-plugin-duo] branch master updated: Fix test JavaDoc

Phil Smart philip.smart at jisc.ac.uk
Mon Aug 10 09:45:42 UTC 2020


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch master
in repository java-idp-plugin-duo.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=27a006f4956c8873d7a685b4c091a8ba4ba945d4

The following commit(s) were added to refs/heads/master by this push:
       new  27a006f   Fix test JavaDoc
27a006f is described below

commit 27a006f4956c8873d7a685b4c091a8ba4ba945d4
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Mon Aug 10 10:45:36 2020 +0100

    Fix test JavaDoc
---
 .../impl/AbstractAuthnXmlFlowExecutionTests.java   | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractAuthnXmlFlowExecutionTests.java b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractAuthnXmlFlowExecutionTests.java
index db64e0f..63f24be 100644
--- a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractAuthnXmlFlowExecutionTests.java
+++ b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/AbstractAuthnXmlFlowExecutionTests.java
@@ -69,9 +69,10 @@ import net.shibboleth.utilities.java.support.security.impl.SecureRandomIdentifie
 
 
 /**
- * <p>Base test class for FINISH</p>
+ * <p>Base test class for testing webflows in isolation from the rest of the IdP.</p>
  * 
- * <p>One flow per concrete implementation!? One initalisation, so one set of variables?!</p>
+ * <p>Each flow test reinitialises the mock beans. See {@link #setUp()} and 
+ * {@link #registerMockBeanDefinitions(MockFlowBuilderContext)}.</p>
  * 
  * <p>Note, you can not use test context creation annotations e.g. @SpringJUnitWebConfig to help
  * build the application context, because the {@link AbstractExternalizedFlowExecutionTests} creates a 
@@ -254,10 +255,6 @@ public abstract class AbstractAuthnXmlFlowExecutionTests extends AbstractXmlFlow
 
         //create a real JSON parser
         builderContext.registerBean("shibboleth.JSONObjectMapper", new com.fasterxml.jackson.databind.ObjectMapper());
-
-        //register a disabled metric registry in case we are using IdP v4.0.0 and not v4.0.1 or greater.
-        final FilteredMetricRegistry filterRegistry = new FilteredMetricRegistry();
-        ConfigurationService.register(MetricRegistry.class, filterRegistry);
         
         //register shibboleth function constants.
         addBeanDefinition(builderContext, "shibboleth.Functions.Constant",BeanDefinitionBuilder.
@@ -287,12 +284,13 @@ public abstract class AbstractAuthnXmlFlowExecutionTests extends AbstractXmlFlow
         assertNotNull(bean);
         assertTrue( builderContext.getApplicationContext() instanceof ConfigurableApplicationContext);
         
-        BeanFactory factory = ((ConfigurableApplicationContext) builderContext.getApplicationContext()).getBeanFactory();
+        final BeanFactory factory = ((ConfigurableApplicationContext) builderContext.
+                getApplicationContext()).getBeanFactory();
         
         assertNotNull(factory);
         assertTrue(factory instanceof DefaultListableBeanFactory);
         
-        ((DefaultListableBeanFactory)factory).registerBeanDefinition(beanName, bean);;
+        ((DefaultListableBeanFactory)factory).registerBeanDefinition(beanName, bean);
         
     }
     
@@ -318,18 +316,20 @@ public abstract class AbstractAuthnXmlFlowExecutionTests extends AbstractXmlFlow
         //add test specific mocks
         mockProperties.forEach((key,value) -> mock.setProperty(key, value));
         
-        ((StandardEnvironment)builderContext.getApplicationContext().getEnvironment()).getPropertySources().addFirst(mock);
+        ((StandardEnvironment)builderContext.getApplicationContext().getEnvironment()).
+            getPropertySources().addFirst(mock);
         
     }
     
     /**
-     * Build a {@link ProfileRequestContext} by configuring a suitable context tree e.g. a {@link AuthenticationContext}.
+     * Build a {@link ProfileRequestContext} by configuring a suitable context tree e.g. a 
+     * {@link AuthenticationContext}.
      * 
      * @param forceAuthn force authentication
      * @return a profile request context.
      */
     @Nonnull protected ProfileRequestContext buildProfileRequestContext(@Nonnull final boolean forceAuthn,
-            @Nonnull boolean addC14Context) {
+            @Nonnull final boolean addC14Context) {
         
         final ProfileRequestContext prc = new ProfileRequestContext();
         final AuthenticationContext ac = new AuthenticationContext();
@@ -338,6 +338,7 @@ public abstract class AbstractAuthnXmlFlowExecutionTests extends AbstractXmlFlow
         ac.setAttemptedFlow(afd);
         ac.addSubcontext(new RelyingPartyUIContext());
         ac.setForceAuthn(forceAuthn);
+        
         prc.addSubcontext(ac);
         if (addC14Context) {
         final SubjectCanonicalizationContext scc = new SubjectCanonicalizationContext();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list