[java-idp-plugin-oidc-rp] branch main updated: JOIDCRP-42 - Unit tests fails on windows

Phil Smart philip.smart at jisc.ac.uk
Fri Aug 11 10:10:31 UTC 2023


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

philsmart pushed a commit to branch main
in repository java-idp-plugin-oidc-rp.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-oidc-rp.git;a=commit;h=f7c1f707fd2b8b17f37c6f01502357beff341b14

The following commit(s) were added to refs/heads/main by this push:
     new f7c1f70  JOIDCRP-42 - Unit tests fails on windows
f7c1f70 is described below

commit f7c1f707fd2b8b17f37c6f01502357beff341b14
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Aug 11 11:10:28 2023 +0100

    JOIDCRP-42 - Unit tests fails on windows
    
     - Hard code 'localhost' into the test MockServer certificate SAN
     - Re-enabled all SWF flow tests on Windows
    
    https://shibboleth.atlassian.net/browse/JOIDCRP-42
---
 .../OIDCRPFlowFromAuthenticationResponseTest.java  | 53 +++++++---------------
 .../oidc/rp/impl/OIDCRPFlowPreRedirectTest.java    | 13 +++---
 .../plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java  |  3 +-
 3 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowFromAuthenticationResponseTest.java b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowFromAuthenticationResponseTest.java
index 412fd72..45359bf 100644
--- a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowFromAuthenticationResponseTest.java
+++ b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowFromAuthenticationResponseTest.java
@@ -19,7 +19,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.lang3.SystemUtils;
 import org.junit.Test;
 import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.profile.context.ProfileRequestContext;
@@ -125,8 +124,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
      */
     @Test 
     public void test_IDTokenHS256_PlainUserInfo() throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+           
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -161,9 +159,8 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
      * @throws Exception on error.
      */
     @Test 
-    public void test_IDTokenHS256_PlainUserInfo_ClientSecretJWTClientAuth() throws Exception {
+    public void test_IDTokenHS256_PlainUserInfo_ClientSecretJWTClientAuth() throws Exception {       
         
-        if (SystemUtils.IS_OS_WINDOWS) return;
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -227,8 +224,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
      */
     @Test 
     public void test_IDTokenHS256_PlainUserInfo_PrivateKeyJWTClientAuth() throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+                
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -286,8 +282,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     
     @Test 
     public void test_IDTokenHS256_UserInfoHS256() throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+                
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -320,8 +315,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     
     @Test 
     public void test_IDTokenHS256_UserInfoJWTNotSigned() throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+              
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -353,9 +347,8 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     
     @Test 
     public void test_IDTokenHS256_DirA128CBC_HS256_UserInfoES256_RSA_OAEP_256A256GCM() 
-            throws Exception {
+            throws Exception {       
         
-        if (SystemUtils.IS_OS_WINDOWS) return;
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -452,8 +445,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     @Test 
     public void test_IDTokenHS256_RSA_OAEP_256_A256GCM_PlainUserInfo() 
             throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+               
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -528,8 +520,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     @Test 
     public void test_IDTokenHS256_PlainJWTUserInfoResponse() 
             throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+               
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -558,8 +549,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     @Test 
     public void test_IDTokenHS256_UserInfoHS256_WithACRAMRTranslation() 
             throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+                
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -614,8 +604,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     @Test 
     public void testUnsupportedOIDCFlow() 
             throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+             
         basicSetup();
         
         final var flowExecution = (FlowExecutionImpl)getFlowExecutionFactory()
@@ -650,8 +639,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     @Test 
     public void testErrorAuthenticationResponse() 
             throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+               
         basicSetup();
 
         final FlowExecutionImpl flowExecution = (FlowExecutionImpl)getFlowExecutionFactory()
@@ -699,8 +687,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
      */
     @Test 
     public void test_IDTokenHS256_NoIssuer_PlainUserInfo() throws Exception {
-        
-        if (SystemUtils.IS_OS_WINDOWS) return;
+              
         basicSetup();
         
         final MockWebServer mockOPServer = createSimpleServer();
@@ -731,8 +718,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     */
    @Test 
    public void test_IDTokenHS256_NoSub_PlainUserInfo() throws Exception {
-       
-       if (SystemUtils.IS_OS_WINDOWS) return;
+              
        basicSetup();
        
        final MockWebServer mockOPServer = createSimpleServer();       
@@ -763,8 +749,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
     */
    @Test 
    public void test_IDTokenHS256_NoAudience_PlainUserInfo() throws Exception {
-       
-       if (SystemUtils.IS_OS_WINDOWS) return;
+            
        basicSetup();
        
        final MockWebServer mockOPServer = createSimpleServer();
@@ -794,8 +779,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
    */
   @Test 
   public void test_IDTokenHS256_NoIssuedAt_PlainUserInfo() throws Exception {
-      
-      if (SystemUtils.IS_OS_WINDOWS) return;
+          
       basicSetup();
       
       final MockWebServer mockOPServer = createSimpleServer();
@@ -829,8 +813,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
    */
   @Test 
   public void test_IDTokenHS256_InvalidNonce_PlainUserInfo() throws Exception {
-      
-      if (SystemUtils.IS_OS_WINDOWS) return;
+        
       basicSetup();
       
       final MockWebServer mockOPServer = createSimpleServer();
@@ -861,8 +844,7 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
    */
   @Test 
   public void test_IDTokenHS256_InvalidPlainUserInfo_NoSub() throws Exception {
-      
-      if (SystemUtils.IS_OS_WINDOWS) return;
+        
       basicSetup();
       
       final MockWebServer mockOPServer = createSimpleServer();
@@ -898,7 +880,6 @@ public class OIDCRPFlowFromAuthenticationResponseTest extends OIDCRPFlowTest {
   @Test 
   public void test_IDTokenHS256_InvalidPlainUserInfo_SubDoesNotMatchIdToken() throws Exception {
       
-      if (SystemUtils.IS_OS_WINDOWS) return;
       basicSetup();
       
       final MockWebServer mockOPServer = createSimpleServer();
diff --git a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowPreRedirectTest.java b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowPreRedirectTest.java
index 3606123..515ec79 100644
--- a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowPreRedirectTest.java
+++ b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowPreRedirectTest.java
@@ -20,7 +20,6 @@ import java.util.Map;
 
 import javax.annotation.Nonnull;
 
-import org.apache.commons.lang3.SystemUtils;
 import org.junit.Test;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
@@ -58,7 +57,7 @@ public class OIDCRPFlowPreRedirectTest extends OIDCRPFlowTest {
      */
     @Test
     public void testFlowToAuthorizationRedirect() throws Exception {
-        if (SystemUtils.IS_OS_WINDOWS) return;
+        
         setFlowPath(FLOW);
         setFlowModelResources(flowResources);
         setSubflows(subflows);
@@ -109,7 +108,7 @@ public class OIDCRPFlowPreRedirectTest extends OIDCRPFlowTest {
      */
     @Test
     public void testUsingRequestObject() throws Exception {
-        if (SystemUtils.IS_OS_WINDOWS) return;
+        
         setFlowPath(FLOW);
         setFlowModelResources(flowResources);
         setSubflows(subflows);
@@ -162,7 +161,7 @@ public class OIDCRPFlowPreRedirectTest extends OIDCRPFlowTest {
      */
     @Test
     public void testUsingRequestObject_WithEncryption() throws Exception {
-        if (SystemUtils.IS_OS_WINDOWS) return;
+        
         setFlowPath(FLOW);
         setFlowModelResources(flowResources);
         setSubflows(subflows);
@@ -237,7 +236,7 @@ public class OIDCRPFlowPreRedirectTest extends OIDCRPFlowTest {
      */
     @Test
     public void testUsingRequestObject_RSA256Signature() throws Exception {
-        if (SystemUtils.IS_OS_WINDOWS) return;
+        
         setFlowPath(FLOW);
         setFlowModelResources(flowResources);
         setSubflows(subflows);
@@ -301,7 +300,7 @@ public class OIDCRPFlowPreRedirectTest extends OIDCRPFlowTest {
     @Test
     public void testFail_UsingRequestObject_UnsupportedSignatureAlgorithm()
             throws Exception {
-        if (SystemUtils.IS_OS_WINDOWS) return;
+        
         setFlowPath(FLOW);
         setFlowModelResources(flowResources);
         setSubflows(subflows);
@@ -364,7 +363,7 @@ public class OIDCRPFlowPreRedirectTest extends OIDCRPFlowTest {
      */
     @Test
     public void testWithACRs() throws Exception {
-        if (SystemUtils.IS_OS_WINDOWS) return;
+        
         setFlowPath(FLOW);
         setFlowModelResources(flowResources);
         setSubflows(subflows);
diff --git a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java
index 0635d69..89334ab 100644
--- a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java
+++ b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java
@@ -327,9 +327,8 @@ public class OIDCRPFlowTest extends AbstractAuthnXmlFlowExecutionTests {
     protected MockWebServer createSimpleServer() throws UnknownHostException {
         //start mock server
         final MockWebServer mockServer = new MockWebServer();
-        final String localhost = InetAddress.getByName("localhost").getCanonicalHostName();
         final HeldCertificate localhostCertificate = new HeldCertificate.Builder()
-            .addSubjectAlternativeName(localhost)
+            .addSubjectAlternativeName("localhost")
             .build();
         final HandshakeCertificates serverCertificates = new HandshakeCertificates.Builder()
                 .heldCertificate(localhostCertificate)

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


More information about the commits mailing list