Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4fdac28
Update selenium to 4.43.0 & testcontainers to 1.21.4
maximthomas Apr 16, 2026
4256497
Make IT_SetupWithOpenDJ more stable
maximthomas Apr 16, 2026
07c84d2
Make IT_SetupWithOpenDJ more stable
maximthomas Apr 16, 2026
fc3b6a8
Initial plan
Copilot Apr 16, 2026
4ec6ee2
Make IT_SetupWithOpenDJ more stable
maximthomas Apr 16, 2026
cee98f6
Upgrade PowerMock from 1.7.4 to 2.0.9, replace Matchers with Argument…
Copilot Apr 16, 2026
cca455f
Fix CLILicensePresenterTest: replace mockito-all with mockito-core in…
Copilot Apr 16, 2026
e27b246
Set debug level to 'warning' in integration tests
maximthomas Apr 16, 2026
edc0889
Fix ExternalLdapConfigTest: update verifyStatic calls to PowerMock 2.…
Copilot Apr 16, 2026
78278b7
Fix openam-core: replace mockito-all with mockito-core for PowerMock …
Copilot Apr 16, 2026
4afbe07
fix: fix 46 test failures caused by Mockito 2.x null-matching behavio…
Copilot Apr 16, 2026
957f713
fix: fix remaining 7 test failures - authenticationEvent nullable stu…
Copilot Apr 16, 2026
0b97650
fix: replace mockito-all with mockito-core in openam-rest pom.xml
Copilot Apr 16, 2026
1fcff0f
fix: fix Mockito 2.x null matching issues in openam-rest tests
Copilot Apr 16, 2026
af9c9bf
fix: replace mockito-all with mockito-core in openam-scripting pom
Copilot Apr 16, 2026
aba20ce
fix: use nullable(String.class) in ScriptResourceTest for Mockito 2.x…
Copilot Apr 16, 2026
c7746b8
fix: replace mockito-all with mockito-core in openam-auth-common pom
Copilot Apr 16, 2026
acd8c3d
fix: use nullable() matcher for null CallbackHandler in verify calls
Copilot Apr 16, 2026
e9b9fd5
fix: replace mockito-all with mockito-core in openam-auth-nt
Copilot Apr 16, 2026
ac49757
fix: replace mockito-all with mockito-core in all pom.xml files
Copilot Apr 16, 2026
6e3b5f9
fix: fix IOFactoryTest for Mockito 2.x - stub contentConverter and fi…
Copilot Apr 16, 2026
850baf4
fix: fix 6 Mockito 2.x test failures in openam-core-rest
Copilot Apr 17, 2026
fcb808d
fix: fix 12 Mockito 2.x test failures in openam-auth-persistentcookie
Copilot Apr 17, 2026
86d6645
fix: fix 11 Mockito 2.x test failures in PersistentCookieAuthModuleTe…
Copilot Apr 17, 2026
f14a839
fix: fix 3 Mockito 2.x null-matching failures in IDPSSOFederateTest
Copilot Apr 17, 2026
af5c976
fix: fix 12 Mockito 2.x null-matching failures in openam-oauth2 tests
Copilot Apr 17, 2026
51fc5dd
fix: fix 4 remaining Mockito 2.x null-matching failures in openam-oauth2
Copilot Apr 17, 2026
dac5c62
set logback level to WARN in test
maximthomas Apr 17, 2026
c395a95
fix: fix 8 Mockito 2.x null-matching failures in openam-uma tests
Copilot Apr 17, 2026
746332c
fix: fix ArgumentMatcher extends→implements for Mockito 2.x in Upgrad…
Copilot Apr 17, 2026
211ac6e
fix: fix Mockito 2.x null-matching NPEs in 3 openam-upgrade test classes
Copilot Apr 17, 2026
5414837
Make IT_SetupWithOpenDJ more stable
maximthomas Apr 17, 2026
7cc0062
fix: increase Selenium wait timeout in BaseTest from 10s to 30s to av…
Copilot Apr 17, 2026
1d9d9ec
chore: add/update 'Portions copyright 2026 3A Systems, LLC.' in all 1…
Copilot Apr 17, 2026
1f7acf6
merge: maximthomas:issues/stabilize-integration-test
Copilot Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openam-authentication/openam-auth-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013-2016 ForgeRock AS.
* Portions Copyrighted 2025 3A Systems LLC.
* Portions Copyrighted 2025-2026 3A Systems, LLC.
*/

package org.forgerock.openam.authentication.modules.common;
Expand All @@ -38,7 +38,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.mockito.Matchers;
import org.mockito.ArgumentMatchers;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -106,8 +106,8 @@ public void shouldCallOnLoginSuccessAndThrowAuthenticationExceptionWhenAuthExcep
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper, never()).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper, never()).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand All @@ -121,16 +121,16 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendSuccess() throw
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
.willReturn(AuthStatus.SEND_SUCCESS);

//When
jaspiPostAuthPlugin.onLoginSuccess(requestParamsMap, request, response, ssoToken);

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
}

@Test
Expand All @@ -143,7 +143,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
.willReturn(AuthStatus.SEND_FAILURE);

//When
Expand All @@ -157,9 +157,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand All @@ -174,7 +174,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
.willReturn(AuthStatus.SEND_CONTINUE);

//When
Expand All @@ -188,9 +188,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand All @@ -204,7 +204,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsElse() throws Authe
HttpServletResponse response = mock(HttpServletResponse.class);
SSOToken ssoToken = mock(SSOToken.class);

given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
.willReturn(AuthStatus.SUCCESS);

//When
Expand All @@ -218,9 +218,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsElse() throws Authe
}

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
assertTrue(onLoginSuccessMethodCalled);
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
verify(jaspiAuthWrapper).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013-2016 ForgeRock AS.
* Portions Copyrighted 2025 3A Systems LLC.
* Portions Copyrighted 2025-2026 3A Systems, LLC.
*/

package org.forgerock.openam.authentication.modules.common;
Expand All @@ -37,7 +37,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.mockito.Matchers;
import org.mockito.ArgumentMatchers;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -99,7 +99,7 @@ public void shouldInitialiseAuthenticationModuleWrapper() throws Exception {
jaspiAuthLoginModule.init(subject, sharedState, options);

//Then
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
}

@Test
Expand Down Expand Up @@ -131,15 +131,15 @@ public void shouldProcessCallbacksWhenValidateRequestReturnsSuccess() throws Log
Callback[] callbacks = new Callback[0];
int state = ISAuthConstants.LOGIN_START;

given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
.willReturn(AuthStatus.SUCCESS);

//When
int returnedState = jaspiAuthLoginModule.process(callbacks, state);

//Then
assertTrue(processMethodCalled);
verify(jaspiAuthWrapper).validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject());
verify(jaspiAuthWrapper).validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject());
assertEquals(returnedState, ISAuthConstants.LOGIN_SUCCEED);
}

Expand All @@ -150,15 +150,15 @@ public void shouldProcessCallbacksWhenValidateRequestReturnsSendSuccess() throws
Callback[] callbacks = new Callback[0];
int state = ISAuthConstants.LOGIN_START;

given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
.willReturn(AuthStatus.SEND_SUCCESS);

//When
int returnedState = jaspiAuthLoginModule.process(callbacks, state);

//Then
assertTrue(processMethodCalled);
verify(jaspiAuthWrapper).validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject());
verify(jaspiAuthWrapper).validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject());
assertEquals(returnedState, ISAuthConstants.LOGIN_SUCCEED);
}

Expand All @@ -169,7 +169,7 @@ public void shouldProcessCallbacksWhenValidateRequestReturnsSendFailure() throws
Callback[] callbacks = new Callback[0];
int state = ISAuthConstants.LOGIN_START;

given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
.willReturn(AuthStatus.SEND_FAILURE);

//When
Expand All @@ -184,7 +184,7 @@ public void shouldProcessCallbacksWhenValidateRequestReturnsSendFailure() throws

//Then
assertTrue(processMethodCalled);
verify(jaspiAuthWrapper).validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject());
verify(jaspiAuthWrapper).validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject());
assertTrue(exceptionCaught);
assertEquals(exception.getErrorCode(), "authFailed");
}
Expand All @@ -196,15 +196,15 @@ public void shouldProcessCallbacksWhenValidateRequestReturnsSendContinue() throw
Callback[] callbacks = new Callback[0];
int state = ISAuthConstants.LOGIN_START;

given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
.willReturn(AuthStatus.SEND_CONTINUE);

//When
int returnedState = jaspiAuthLoginModule.process(callbacks, state);

//Then
assertTrue(processMethodCalled);
verify(jaspiAuthWrapper).validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject());
verify(jaspiAuthWrapper).validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject());
assertEquals(returnedState, ISAuthConstants.LOGIN_IGNORE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013-2016 ForgeRock AS.
* Portions Copyrighted 2025 3A Systems LLC.
* Portions Copyrighted 2025-2026 3A Systems, LLC.
*/

package org.forgerock.openam.authentication.modules.common;
Expand All @@ -32,7 +32,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.mockito.Matchers;
import org.mockito.ArgumentMatchers;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -66,7 +66,7 @@ public void shouldInitialiseAuthenticationModule() throws Exception {
jaspiAuthWrapper.initialize(callbackHandler, config);

//Then
verify(serverAuthModule).initialize(Matchers.<MessagePolicy>anyObject(), (MessagePolicy) isNull(),
verify(serverAuthModule).initialize(ArgumentMatchers.<MessagePolicy>anyObject(), (MessagePolicy) isNull(),
eq(callbackHandler), eq(config));
}
}
2 changes: 1 addition & 1 deletion openam-authentication/openam-auth-device-id/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
* Portions copyright 2026 3A Systems, LLC.
*/

package org.forgerock.openam.authentication.modules.deviceprint;
Expand All @@ -32,7 +33,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.forgerock.openam.utils.Time.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
* Portions copyright 2026 3A Systems, LLC.
*/

package org.forgerock.openam.authentication.modules.fr.oath;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.*;

import com.sun.identity.shared.debug.Debug;
Expand Down
4 changes: 2 additions & 2 deletions openam-authentication/openam-auth-nt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
10 changes: 5 additions & 5 deletions openam-authentication/openam-auth-oauth2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>1.7.4</version>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>1.7.4</version>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.4</version>
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.9</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2018-2025 3A Systems LLC.
* Copyright 2018-2026 3A Systems LLC.
*/

package org.forgerock.openam.authentication.modules.oauth2;

import org.openidentityplatform.bouncycastle.openssl.jcajce.JcaPEMWriter;
import org.forgerock.openam.authentication.modules.oauth2.service.ESIAServiceUrlProvider;
import org.forgerock.openam.authentication.modules.oauth2.service.esia.Signer;
import org.mockito.Matchers;
import org.mockito.ArgumentMatchers;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
Expand Down Expand Up @@ -53,7 +53,7 @@ public class ESIATest extends PowerMockTestCase {
public void syncOffsetTest() throws Exception {
HttpRequestContent httpRequestContent = mock(HttpRequestContent.class);
Map<String, List<String>> headers = Collections.singletonMap("Date", Collections.singletonList("Mon, 11 Mar 2019 07:07:25 GMT"));
when(httpRequestContent.getHeadersUsingHEAD(Matchers.anyString())).thenReturn(headers);
when(httpRequestContent.getHeadersUsingHEAD(ArgumentMatchers.anyString())).thenReturn(headers);
PowerMockito.mockStatic(HttpRequestContent.class);
PowerMockito.when(HttpRequestContent.getInstance()).thenReturn(httpRequestContent);
ESIAServiceUrlProvider.getSyncOffset();
Expand Down
2 changes: 1 addition & 1 deletion openam-authentication/openam-auth-oidc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion openam-authentication/openam-auth-persistentcookie/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Loading
Loading