Skip to content

Commit 61b7723

Browse files
committed
Merge branch 'master' into issues/doc-build-error
2 parents 05e95d0 + a875c76 commit 61b7723

201 files changed

Lines changed: 862 additions & 618 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

openam-authentication/openam-auth-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</dependency>
5353
<dependency>
5454
<groupId>org.mockito</groupId>
55-
<artifactId>mockito-all</artifactId>
55+
<artifactId>mockito-core</artifactId>
5656
<scope>test</scope>
5757
</dependency>
5858
</dependencies>

openam-authentication/openam-auth-common/src/test/java/org/forgerock/openam/authentication/modules/common/JaspiAuthLoginModulePAPTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2013-2016 ForgeRock AS.
15-
* Portions Copyrighted 2025 3A Systems LLC.
15+
* Portions Copyrighted 2025-2026 3A Systems, LLC.
1616
*/
1717

1818
package org.forgerock.openam.authentication.modules.common;
@@ -38,7 +38,7 @@
3838
import jakarta.servlet.http.HttpServletRequest;
3939
import jakarta.servlet.http.HttpServletResponse;
4040

41-
import org.mockito.Matchers;
41+
import org.mockito.ArgumentMatchers;
4242
import org.testng.annotations.BeforeMethod;
4343
import org.testng.annotations.Test;
4444

@@ -106,8 +106,8 @@ public void shouldCallOnLoginSuccessAndThrowAuthenticationExceptionWhenAuthExcep
106106
}
107107

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

124-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
124+
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
125125
.willReturn(AuthStatus.SEND_SUCCESS);
126126

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

130130
//Then
131-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
131+
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
132132
assertTrue(onLoginSuccessMethodCalled);
133-
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
133+
verify(jaspiAuthWrapper).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
134134
}
135135

136136
@Test
@@ -143,7 +143,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
143143
HttpServletResponse response = mock(HttpServletResponse.class);
144144
SSOToken ssoToken = mock(SSOToken.class);
145145

146-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
146+
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
147147
.willReturn(AuthStatus.SEND_FAILURE);
148148

149149
//When
@@ -157,9 +157,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendFailure() throw
157157
}
158158

159159
//Then
160-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
160+
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
161161
assertTrue(onLoginSuccessMethodCalled);
162-
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
162+
verify(jaspiAuthWrapper).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
163163
assertTrue(exceptionCaught);
164164
assertEquals(exception.getErrorCode(), "authFailed");
165165
}
@@ -174,7 +174,7 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
174174
HttpServletResponse response = mock(HttpServletResponse.class);
175175
SSOToken ssoToken = mock(SSOToken.class);
176176

177-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
177+
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
178178
.willReturn(AuthStatus.SEND_CONTINUE);
179179

180180
//When
@@ -188,9 +188,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsSendContinue() thro
188188
}
189189

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

207-
given(jaspiAuthWrapper.secureResponse(Matchers.<MessageInfo>anyObject()))
207+
given(jaspiAuthWrapper.secureResponse(ArgumentMatchers.<MessageInfo>anyObject()))
208208
.willReturn(AuthStatus.SUCCESS);
209209

210210
//When
@@ -218,9 +218,9 @@ public void shouldCallOnLoginSuccessWhenSecureResponseReturnsElse() throws Authe
218218
}
219219

220220
//Then
221-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
221+
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
222222
assertTrue(onLoginSuccessMethodCalled);
223-
verify(jaspiAuthWrapper).secureResponse(Matchers.<MessageInfo>anyObject());
223+
verify(jaspiAuthWrapper).secureResponse(ArgumentMatchers.<MessageInfo>anyObject());
224224
assertTrue(exceptionCaught);
225225
assertEquals(exception.getErrorCode(), "authFailed");
226226
}

openam-authentication/openam-auth-common/src/test/java/org/forgerock/openam/authentication/modules/common/JaspiAuthLoginModuleTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2013-2016 ForgeRock AS.
15-
* Portions Copyrighted 2025 3A Systems LLC.
15+
* Portions Copyrighted 2025-2026 3A Systems, LLC.
1616
*/
1717

1818
package org.forgerock.openam.authentication.modules.common;
@@ -37,7 +37,7 @@
3737
import jakarta.servlet.http.HttpServletRequest;
3838
import jakarta.servlet.http.HttpServletResponse;
3939

40-
import org.mockito.Matchers;
40+
import org.mockito.ArgumentMatchers;
4141
import org.testng.annotations.BeforeMethod;
4242
import org.testng.annotations.Test;
4343

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

101101
//Then
102-
verify(jaspiAuthWrapper).initialize(any(CallbackHandler.class), eq(config));
102+
verify(jaspiAuthWrapper).initialize(ArgumentMatchers.nullable(CallbackHandler.class), eq(config));
103103
}
104104

105105
@Test
@@ -131,15 +131,15 @@ public void shouldProcessCallbacksWhenValidateRequestReturnsSuccess() throws Log
131131
Callback[] callbacks = new Callback[0];
132132
int state = ISAuthConstants.LOGIN_START;
133133

134-
given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
134+
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
135135
.willReturn(AuthStatus.SUCCESS);
136136

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

140140
//Then
141141
assertTrue(processMethodCalled);
142-
verify(jaspiAuthWrapper).validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject());
142+
verify(jaspiAuthWrapper).validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject());
143143
assertEquals(returnedState, ISAuthConstants.LOGIN_SUCCEED);
144144
}
145145

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

153-
given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
153+
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
154154
.willReturn(AuthStatus.SEND_SUCCESS);
155155

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

159159
//Then
160160
assertTrue(processMethodCalled);
161-
verify(jaspiAuthWrapper).validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject());
161+
verify(jaspiAuthWrapper).validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject());
162162
assertEquals(returnedState, ISAuthConstants.LOGIN_SUCCEED);
163163
}
164164

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

172-
given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
172+
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
173173
.willReturn(AuthStatus.SEND_FAILURE);
174174

175175
//When
@@ -184,7 +184,7 @@ public void shouldProcessCallbacksWhenValidateRequestReturnsSendFailure() throws
184184

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

199-
given(jaspiAuthWrapper.validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject()))
199+
given(jaspiAuthWrapper.validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject()))
200200
.willReturn(AuthStatus.SEND_CONTINUE);
201201

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

205205
//Then
206206
assertTrue(processMethodCalled);
207-
verify(jaspiAuthWrapper).validateRequest(Matchers.<MessageInfo>anyObject(), Matchers.<Subject>anyObject());
207+
verify(jaspiAuthWrapper).validateRequest(ArgumentMatchers.<MessageInfo>anyObject(), ArgumentMatchers.<Subject>anyObject());
208208
assertEquals(returnedState, ISAuthConstants.LOGIN_IGNORE);
209209
}
210210

openam-authentication/openam-auth-common/src/test/java/org/forgerock/openam/authentication/modules/common/JaspiAuthModuleWrapperTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2013-2016 ForgeRock AS.
15-
* Portions Copyrighted 2025 3A Systems LLC.
15+
* Portions Copyrighted 2025-2026 3A Systems, LLC.
1616
*/
1717

1818
package org.forgerock.openam.authentication.modules.common;
@@ -32,7 +32,7 @@
3232
import jakarta.servlet.http.HttpServletRequest;
3333
import jakarta.servlet.http.HttpServletResponse;
3434

35-
import org.mockito.Matchers;
35+
import org.mockito.ArgumentMatchers;
3636
import org.testng.annotations.BeforeMethod;
3737
import org.testng.annotations.Test;
3838

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

6868
//Then
69-
verify(serverAuthModule).initialize(Matchers.<MessagePolicy>anyObject(), (MessagePolicy) isNull(),
69+
verify(serverAuthModule).initialize(ArgumentMatchers.<MessagePolicy>anyObject(), (MessagePolicy) isNull(),
7070
eq(callbackHandler), eq(config));
7171
}
7272
}

openam-authentication/openam-auth-device-id/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</dependency>
4444
<dependency>
4545
<groupId>org.mockito</groupId>
46-
<artifactId>mockito-all</artifactId>
46+
<artifactId>mockito-core</artifactId>
4747
<scope>test</scope>
4848
</dependency>
4949
<dependency>

openam-authentication/openam-auth-device-id/src/test/java/org/forgerock/openam/authentication/modules/deviceprint/ProfilePersisterTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2014-2016 ForgeRock AS.
15+
* Portions copyright 2026 3A Systems, LLC.
1516
*/
1617

1718
package org.forgerock.openam.authentication.modules.deviceprint;
@@ -32,7 +33,7 @@
3233
import static org.assertj.core.api.Assertions.assertThat;
3334
import static org.forgerock.openam.utils.Time.*;
3435
import static org.mockito.BDDMockito.given;
35-
import static org.mockito.Matchers.eq;
36+
import static org.mockito.ArgumentMatchers.eq;
3637
import static org.mockito.Mockito.mock;
3738
import static org.mockito.Mockito.verify;
3839

openam-authentication/openam-auth-fr-oath/src/test/java/org/forgerock/openam/authentication/modules/fr/oath/OathMakerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2015-2016 ForgeRock AS.
15+
* Portions copyright 2026 3A Systems, LLC.
1516
*/
1617

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

1920
import static org.assertj.core.api.Assertions.*;
20-
import static org.mockito.Matchers.eq;
21+
import static org.mockito.ArgumentMatchers.eq;
2122
import static org.mockito.Mockito.*;
2223

2324
import com.sun.identity.shared.debug.Debug;

openam-authentication/openam-auth-nt/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
<dependency>
4040
<groupId>org.mockito</groupId>
41-
<artifactId>mockito-all</artifactId>
41+
<artifactId>mockito-core</artifactId>
4242
<scope>test</scope>
4343
</dependency>
4444
<dependency>
@@ -53,7 +53,7 @@
5353
</dependency>
5454
<dependency>
5555
<groupId>org.powermock</groupId>
56-
<artifactId>powermock-api-mockito</artifactId>
56+
<artifactId>powermock-api-mockito2</artifactId>
5757
<scope>test</scope>
5858
</dependency>
5959
<dependency>

openam-authentication/openam-auth-oauth2/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@
6161
</dependency>
6262
<dependency>
6363
<groupId>org.mockito</groupId>
64-
<artifactId>mockito-all</artifactId>
64+
<artifactId>mockito-core</artifactId>
6565
<scope>test</scope>
6666
</dependency>
6767
<dependency>
6868
<groupId>org.powermock</groupId>
6969
<artifactId>powermock-module-testng</artifactId>
70-
<version>1.7.4</version>
70+
<version>2.0.9</version>
7171
<scope>test</scope>
7272
</dependency>
7373
<dependency>
7474
<groupId>org.powermock</groupId>
7575
<artifactId>powermock-core</artifactId>
76-
<version>1.7.4</version>
76+
<version>2.0.9</version>
7777
<scope>test</scope>
7878
</dependency>
7979
<dependency>
8080
<groupId>org.powermock</groupId>
81-
<artifactId>powermock-api-mockito</artifactId>
82-
<version>1.7.4</version>
81+
<artifactId>powermock-api-mockito2</artifactId>
82+
<version>2.0.9</version>
8383
<scope>test</scope>
8484
</dependency>
8585

openam-authentication/openam-auth-oauth2/src/test/java/org/forgerock/openam/authentication/modules/oauth2/ESIATest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
* Header, with the fields enclosed by brackets [] replaced by your own identifying
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
14-
* Copyright 2018-2025 3A Systems LLC.
14+
* Copyright 2018-2026 3A Systems LLC.
1515
*/
1616

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

1919
import org.openidentityplatform.bouncycastle.openssl.jcajce.JcaPEMWriter;
2020
import org.forgerock.openam.authentication.modules.oauth2.service.ESIAServiceUrlProvider;
2121
import org.forgerock.openam.authentication.modules.oauth2.service.esia.Signer;
22-
import org.mockito.Matchers;
22+
import org.mockito.ArgumentMatchers;
2323
import org.powermock.api.mockito.PowerMockito;
2424
import org.powermock.core.classloader.annotations.PowerMockIgnore;
2525
import org.powermock.core.classloader.annotations.PrepareForTest;
@@ -53,7 +53,7 @@ public class ESIATest extends PowerMockTestCase {
5353
public void syncOffsetTest() throws Exception {
5454
HttpRequestContent httpRequestContent = mock(HttpRequestContent.class);
5555
Map<String, List<String>> headers = Collections.singletonMap("Date", Collections.singletonList("Mon, 11 Mar 2019 07:07:25 GMT"));
56-
when(httpRequestContent.getHeadersUsingHEAD(Matchers.anyString())).thenReturn(headers);
56+
when(httpRequestContent.getHeadersUsingHEAD(ArgumentMatchers.anyString())).thenReturn(headers);
5757
PowerMockito.mockStatic(HttpRequestContent.class);
5858
PowerMockito.when(HttpRequestContent.getInstance()).thenReturn(httpRequestContent);
5959
ESIAServiceUrlProvider.getSyncOffset();

0 commit comments

Comments
 (0)