[java-idp-testbed COMMIT] in /trunk/src/test/java/idp: saml1/AbstractSAML1FlowTest.java saml2/AbstractSAML2FlowTest.java

noreply at shibboleth.net noreply at shibboleth.net
Tue Apr 29 09:27:17 EDT 2014


Author: tzeller
Date: Tue Apr 29 09:27:16 2014
New Revision: 209

URL: http://svn.shibboleth.net/view/java-idp-testbed?rev=209&view=rev
Log:
Fill in some missing assert statements in testbed flow tests.

Modified:
    trunk/src/test/java/idp/saml1/AbstractSAML1FlowTest.java
    trunk/src/test/java/idp/saml2/AbstractSAML2FlowTest.java

Modified: trunk/src/test/java/idp/saml1/AbstractSAML1FlowTest.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/test/java/idp/saml1/AbstractSAML1FlowTest.java?rev=209&r1=208&r2=209&view=diff
==============================================================================
--- trunk/src/test/java/idp/saml1/AbstractSAML1FlowTest.java (original)
+++ trunk/src/test/java/idp/saml1/AbstractSAML1FlowTest.java Tue Apr 29 09:27:16 2014
@@ -217,20 +217,21 @@
     }
 
     /**
-     * Assert that the SAML 1 response is a success, the response version is correct, and the response contains a single
-     * assertion.
+     * Assert that :
+     * <ul>
+     * <li>the response ID is not null nor empty</li>
+     * <li>the response IssueInstant is not null</li>
+     * <li>the response version is {@link SAMLVersion#VERSION_11}</li>
+     * </ul>
      * 
      * @param response the SAML 1 response
      */
     public void assertResponse(@Nullable final Response response) {
         Assert.assertNotNull(response);
+        Assert.assertNotNull(response.getID());
+        Assert.assertFalse(response.getID().isEmpty());
+        Assert.assertNotNull(response.getIssueInstant());
         Assert.assertEquals(response.getVersion(), SAMLVersion.VERSION_11);
-        Assert.assertNotNull(response.getAssertions());
-        Assert.assertFalse(response.getAssertions().isEmpty());
-        Assert.assertEquals(response.getAssertions().size(), 1);
-        Assert.assertNotNull(response.getAssertions().get(0));
-        // TODO response.getIssueInstant()
-        // TODO response.getRecipient()
     }
     
     /**
@@ -257,17 +258,24 @@
     }
 
     /**
-     * Assert that the assertion version is {@link SAMLVersion#VERSION_11} and that the issuer is
-     * {@link AbstractFlowTest#IDP_ENTITY_ID}.
+     * Assert that :
+     * <ul>
+     * <li>the assertion ID is not null nor empty</li>
+     * <li>the assertion issue instant is not null</li>
+     * <li>the assertion version is {@link SAMLVersion#VERSION_11}</li>
+     * <li>the assertion issuer is {@link AbstractFlowTest#IDP_ENTITY_ID}</li>
+     * </ul>
      * 
      * @param assertion the assertion
      */
     public void assertAssertion(@Nullable final Assertion assertion) {
         Assert.assertNotNull(assertion);
+        Assert.assertNotNull(assertion.getID());
+        Assert.assertFalse(assertion.getID().isEmpty());
+        Assert.assertNotNull(assertion.getIssueInstant());
         Assert.assertEquals(assertion.getMajorVersion(), SAMLVersion.VERSION_11.getMajorVersion());
-        Assert.assertEquals(assertion.getMinorVersion(), SAMLVersion.VERSION_11.getMinorVersion());
+        Assert.assertEquals(assertion.getMinorVersion(), SAMLVersion.VERSION_11.getMinorVersion());        
         Assert.assertEquals(assertion.getIssuer(), IDP_ENTITY_ID);
-        // TODO assertion.getIssueInstant()
     }
 
     /**
@@ -283,14 +291,21 @@
     }
 
     /**
-     * Assert that the authentication statement has a subject.
+     * Assert that :
+     * <ul>
+     * <li>the authentication statement has a subject</li>
+     * <li>the authentication instant is not null</li>
+     * <li>the authentication method is not null nor empty</li>
+     * </ul>
      * 
      * @param authenticationStatement the authentication statement
      */
     public void assertAuthenticationStatement(@Nullable AuthenticationStatement authenticationStatement) {
         Assert.assertNotNull(authenticationStatement);
         Assert.assertNotNull(authenticationStatement.getSubject());
-        // TODO issueInstant
+        Assert.assertNotNull(authenticationStatement.getAuthenticationInstant());
+        Assert.assertNotNull(authenticationStatement.getAuthenticationMethod());
+        Assert.assertFalse(authenticationStatement.getAuthenticationMethod().isEmpty());
     }
 
     /**

Modified: trunk/src/test/java/idp/saml2/AbstractSAML2FlowTest.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/test/java/idp/saml2/AbstractSAML2FlowTest.java?rev=209&r1=208&r2=209&view=diff
==============================================================================
--- trunk/src/test/java/idp/saml2/AbstractSAML2FlowTest.java (original)
+++ trunk/src/test/java/idp/saml2/AbstractSAML2FlowTest.java Tue Apr 29 09:27:16 2014
@@ -220,15 +220,23 @@
     }
 
     /**
-     * Assert that the response issuer is {@link AbstractFlowTest#IDP_ENTITY_ID}, the status code is
-     * {@link StatusCode#SUCCESS_URI}.
-     * 
-     * @param response
+     * Assert that :
+     * <ul>
+     * <li>the response ID is not null nor empty</li>
+     * <li>the response issue instant is not null</li>
+     * <li>the response version is {@link SAMLVersion#VERSION_20}</li>

[... 77 lines stripped ...]


More information about the commits mailing list