[java-idp-plugin-duo] branch dev/JDUO-71 updated: Fix tests and plugin/module imports

Phil Smart philip.smart at jisc.ac.uk
Tue Jul 4 13:35:09 UTC 2023


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

philsmart pushed a commit to branch dev/JDUO-71
in repository java-idp-plugin-duo.

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

The following commit(s) were added to refs/heads/dev/JDUO-71 by this push:
     new 47a76c3  Fix tests and plugin/module imports
47a76c3 is described below

commit 47a76c30ba3751b9fdfc816d28032da051e74504
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Jul 4 14:35:06 2023 +0100

    Fix tests and plugin/module imports
---
 idp-duo-nimbus-client-impl/pom.xml                            | 11 +++++------
 .../idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java    |  8 ++++----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/idp-duo-nimbus-client-impl/pom.xml b/idp-duo-nimbus-client-impl/pom.xml
index 57af438..640d632 100644
--- a/idp-duo-nimbus-client-impl/pom.xml
+++ b/idp-duo-nimbus-client-impl/pom.xml
@@ -45,7 +45,11 @@
             <artifactId>oidc-common-crypto-api</artifactId>
             <scope>provided</scope>
         </dependency>
-
+        <dependency>
+            <groupId>${shib-shared.groupId}</groupId>
+            <artifactId>shib-profile-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
         <!-- Needed for module/plugin impls. -->
         <dependency>
             <groupId>${idp.groupId}</groupId>
@@ -68,11 +72,6 @@
             <artifactId>spring-core</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>${shib-shared.groupId}</groupId>
-            <artifactId>shib-profile-api</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <build>
diff --git a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java
index 2abf22e..cdd8e47 100644
--- a/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java
+++ b/idp-duo-nimbus-client-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientTest.java
@@ -222,7 +222,7 @@ public class NimbusClientTest {
         final HttpClient httpClient = Mockito.mock(HttpClient.class);
         final ClassicHttpResponse httpResponse = Mockito.mock(ClassicHttpResponse.class);
 
-        Mockito.when(httpResponse.getCode()).thenReturn(500);
+        Mockito.when(httpResponse.getCode()).thenReturn(200);
         Mockito.when(httpResponse.getEntity()).thenReturn(new StringEntity(HEALTH_CHECK_REPONSE));
         Mockito.when(httpClient.executeOpen((HttpHost) Mockito.any(), (ClassicHttpRequest) Mockito.any(), 
                 (HttpContext) Mockito.any())).thenReturn(httpResponse);
@@ -246,7 +246,7 @@ public class NimbusClientTest {
         final HttpClient httpClient = Mockito.mock(HttpClient.class);
         final ClassicHttpResponse httpResponse = Mockito.mock(ClassicHttpResponse.class);
 
-        Mockito.when(httpResponse.getCode()).thenReturn(500);
+        Mockito.when(httpResponse.getCode()).thenReturn(200);
         Mockito.when(httpResponse.getEntity()).thenReturn(new StringEntity(HEALTH_CHECK_REPONSE_MORE_FIELDS));
         Mockito.when(httpClient.executeOpen((HttpHost) Mockito.any(), (ClassicHttpRequest) Mockito.any(), 
                 (HttpContext) Mockito.any())).thenReturn(httpResponse);
@@ -270,7 +270,7 @@ public class NimbusClientTest {
         final HttpClient httpClient = Mockito.mock(HttpClient.class);
         final ClassicHttpResponse httpResponse = Mockito.mock(ClassicHttpResponse.class);
 
-        Mockito.when(httpResponse.getCode()).thenReturn(500);
+        Mockito.when(httpResponse.getCode()).thenReturn(200);
         Mockito.when(httpResponse.getEntity()).thenReturn(new StringEntity(HEALTH_CHECK_REPONSE_ERROR));
         Mockito.when(httpClient.executeOpen((HttpHost) Mockito.any(), (ClassicHttpRequest) Mockito.any(), 
                 (HttpContext) Mockito.any())).thenReturn(httpResponse);
@@ -285,7 +285,7 @@ public class NimbusClientTest {
     @Test(expectedExceptions = DuoClientException.class)
     public void testHealthEndpointTimeout() throws Exception {
         final HttpClient httpClient = Mockito.mock(HttpClient.class);
-        Mockito.when(httpClient.executeOpen(null, (HttpUriRequest) Mockito.any(), 
+        Mockito.when(httpClient.executeOpen((HttpHost) Mockito.any(), (HttpUriRequest) Mockito.any(), 
                 (HttpContext) Mockito.any())).thenThrow(IOException.class);
         
         // create new client with mock response

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


More information about the commits mailing list