Skip to content

Commit 01983a5

Browse files
authored
Update opendj.version to 5.0.4 (#964)
1 parent 014007c commit 01983a5

12 files changed

Lines changed: 109 additions & 29 deletions

File tree

openam-core-rest/src/test/java/org/forgerock/openam/core/rest/sms/tree/SmsRouteTreeTest.java

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

1718
package org.forgerock.openam.core.rest.sms.tree;
@@ -151,7 +152,7 @@ public void shouldUseProvidedAuthModuleForMatchingPath() throws Exception {
151152
Promise<ResourceResponse, ResourceException> result = routeTree.handleRead(context, request);
152153

153154
//Then
154-
assertThat(result).failedWithException();
155+
org.forgerock.util.test.assertj.AssertJPromiseAssert.assertThat(result).failedWithException();
155156
verify(authModule).authorizeRead(any(Context.class), any(ReadRequest.class));
156157
verifyNoMoreInteractions(requestHandler, defaultAuthModule);
157158
}
@@ -174,7 +175,7 @@ public void shouldUseOtherAuthModuleForMatchingPath() throws Exception {
174175
Promise<ResourceResponse, ResourceException> result = routeTree.handleRead(context, request);
175176

176177
//Then
177-
assertThat(result).succeeded();
178+
org.forgerock.util.test.assertj.AssertJPromiseAssert.assertThat(result).succeeded();
178179
verify(defaultAuthModule).authorizeRead(any(Context.class), any(ReadRequest.class));
179180
verifyNoMoreInteractions(authModule);
180181
}
@@ -196,7 +197,7 @@ public void shouldFindAllTypes() throws Exception {
196197
Promise<ActionResponse, ResourceException> result = routeTree.handleAction(context, request);
197198

198199
//Then
199-
assertThat(result).succeeded();
200+
org.forgerock.util.test.assertj.AssertJPromiseAssert.assertThat(result).succeeded();
200201
assertThat(result.getOrThrow().getJsonContent()).hasArray("result").hasSize(3).containsOnly(
201202
object(field("_id", "service1"), field("name", "one"), field("collection", false)),
202203
object(field("_id", "service2"), field("name", "two"), field("collection", false)),
@@ -230,7 +231,7 @@ public void shouldFindCreatableTypes() throws Exception {
230231
Promise<ActionResponse, ResourceException> result = routeTree.handleAction(context, request);
231232

232233
//Then
233-
assertThat(result).succeeded();
234+
org.forgerock.util.test.assertj.AssertJPromiseAssert.assertThat(result).succeeded();
234235
verifyGetTypeAction(handler1);
235236
verifyGetTypeAction(handler2);
236237
verifyGetTypeAction(handler3);
@@ -258,7 +259,7 @@ public void shouldNotSupportGeneralActionsOnUnsupportedLeaves() throws Exception
258259
Promise<ActionResponse, ResourceException> result = routeTree.handleAction(context, request);
259260

260261
//Then
261-
assertThat(result).failedWithException().isInstanceOf(NotSupportedException.class);
262+
org.forgerock.util.test.assertj.AssertJPromiseAssert.assertThat(result).failedWithException().isInstanceOf(NotSupportedException.class);
262263
verifyNoMoreInteractions(handler1);
263264
}
264265

openam-datastore/src/test/java/org/forgerock/openam/idrepo/ldap/DSEERepoTest.java

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

1718
package org.forgerock.openam.idrepo.ldap;
@@ -25,9 +26,10 @@
2526
import static org.assertj.core.api.Assertions.*;
2627
import static org.forgerock.openam.ldap.LDAPConstants.*;
2728
import static org.forgerock.openam.utils.CollectionUtils.*;
28-
import static org.testng.Assert.fail;
29+
import static org.testng.Assert.*;
2930

3031
import org.forgerock.openam.utils.MapHelper;
32+
import org.testng.Assert;
3133
import org.testng.annotations.BeforeClass;
3234
import org.testng.annotations.Test;
3335

@@ -63,7 +65,8 @@ public void addingRoleToUserSuccessful() throws Exception {
6365
assertThat(roleMemberships).hasSize(1).containsOnly(ACCOUNTANT_DN);
6466
//retrieving filtered roles should also return managed roles
6567
roleMemberships = idrepo.getMemberships(null, IdType.USER, DEMO, IdType.FILTEREDROLE);
66-
assertThat(roleMemberships).hasSize(1).containsOnly(ACCOUNTANT_DN);
68+
assertEquals(roleMemberships.size(), 1);
69+
assertTrue(roleMemberships.contains(ACCOUNTANT_DN));
6770
}
6871

6972
@Test(dependsOnMethods = "addingRoleToUserSuccessful")
@@ -85,7 +88,8 @@ public void retrievingNonExistentFilteredRoleMembershipsDoesNotFail() throws Exc
8588
@Test
8689
public void retrievingFilteredRoleIsSuccessful() throws Exception {
8790
Set<String> filteredRoles = idrepo.getMemberships(null, IdType.USER, USER0, IdType.FILTEREDROLE);
88-
assertThat(filteredRoles).hasSize(1).containsOnly(MANAGER_DN);
91+
assertEquals(filteredRoles.size(), 1);
92+
assertTrue(filteredRoles.contains(MANAGER_DN));
8993
}
9094

9195
@Test
@@ -99,7 +103,7 @@ public void removingFilteredRoleFails() throws Exception {
99103
try {
100104
idrepo.modifyMemberShip(null, IdType.FILTEREDROLE, MANAGER, asSet(USER0), IdType.USER,
101105
IdRepo.REMOVEMEMBER);
102-
fail();
106+
Assert.fail();
103107
} catch (IdRepoException ire) {
104108
assertThat(ire).hasMessage(getIdRepoExceptionMessage(IdRepoErrorCode.MEMBERSHIP_CANNOT_BE_MODIFIED,
105109
DJLDAPv3Repo.class.getName(), IdType.FILTEREDROLE.getName()));

openam-shared/src/test/java/com/sun/identity/common/CaseInsensitiveHashSetTest.java

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

1718
package com.sun.identity.common;
1819

20+
import java.util.Arrays;
1921
import java.util.Set;
2022

2123
import org.forgerock.openam.utils.CollectionUtils;
@@ -32,12 +34,12 @@ public void shouldRemoveTwoEntriesUsingHashSet() {
3234
Set<String> setToInitialise = CollectionUtils.asSet("inetUser", "sunfederationmanagerdatastore",
3335
"forgerock-am-dashboard-service", "iplanetpreferences");
3436

35-
Set<Object> ciHashSet = new CaseInsensitiveHashSet();
37+
Set<String> ciHashSet = new CaseInsensitiveHashSet<>();
3638

3739
ciHashSet.addAll(setToInitialise);
3840
ciHashSet.removeAll(setToRemove);
3941

40-
assertThat(ciHashSet).hasSize(2).contains("sunfederationmanagerdatastore", "forgerock-am-dashboard-service");
42+
assertThat(ciHashSet).hasSize(2).containsSequence("sunfederationmanagerdatastore", "forgerock-am-dashboard-service");
4143
}
4244

4345
@Test
@@ -48,12 +50,12 @@ public void shouldRemoveTwoEntriesUsingciHashSet() {
4850
"four", "five");
4951
Set<String> setToInitialise = CollectionUtils.asSet("inetUser", "sunfederationmanagerdatastore",
5052
"forgerock-am-dashboard-service", "iplanetpreferences");
51-
Set<Object> ciHashSet = new CaseInsensitiveHashSet();
53+
Set<String> ciHashSet = new CaseInsensitiveHashSet<>();
5254

5355
ciHashSet.addAll(setToInitialise);
5456
ciHashSet.removeAll(ciSetToRemove);
5557

56-
assertThat(ciHashSet).hasSize(2).contains("sunfederationmanagerdatastore", "forgerock-am-dashboard-service");
58+
assertThat(ciHashSet).hasSize(2).containsSequence("sunfederationmanagerdatastore", "forgerock-am-dashboard-service");
5759

5860
}
5961

openam-test-utils/src/main/java/org/forgerock/openam/test/apidescriptor/ApiActionAssert.java

Lines changed: 15 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 2016 ForgeRock AS.
15+
* Portions copyright 2026 3A Systems, LLC
1516
*/
1617
package org.forgerock.openam.test.apidescriptor;
1718

@@ -22,6 +23,7 @@
2223
import java.util.List;
2324

2425
import org.assertj.core.api.AbstractListAssert;
26+
import org.assertj.core.api.ObjectAssert;
2527
import org.forgerock.api.annotations.Action;
2628
import org.forgerock.api.annotations.Operation;
2729
import org.forgerock.api.annotations.Schema;
@@ -34,7 +36,7 @@
3436
*
3537
* @since 14.0.0
3638
*/
37-
public final class ApiActionAssert extends AbstractListAssert<ApiActionAssert, List<Annotation>, Annotation> {
39+
public final class ApiActionAssert extends AbstractListAssert<ApiActionAssert, List<Annotation>, Annotation, ObjectAssert<Annotation>> {
3840

3941
private final Class<?> annotatedClass;
4042

@@ -77,4 +79,16 @@ public ApiSchemaAssert schemas() {
7779
}
7880
return new ApiSchemaAssert(annotatedClass, schemas);
7981
}
82+
83+
@Override
84+
protected ObjectAssert<Annotation> toAssert(Annotation value, String description) {
85+
return new ObjectAssert<>(value).as(description);
86+
}
87+
88+
@Override
89+
protected ApiActionAssert newAbstractIterableAssert(Iterable<? extends Annotation> iterable) {
90+
List<Annotation> list = new ArrayList<>();
91+
iterable.forEach(list::add);
92+
return new ApiActionAssert(annotatedClass, list);
93+
}
8094
}

openam-test-utils/src/main/java/org/forgerock/openam/test/apidescriptor/ApiErrorAssert.java

Lines changed: 15 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 2016 ForgeRock AS.
15+
* Portions copyright 2026 3A Systems, LLC
1516
*/
1617
package org.forgerock.openam.test.apidescriptor;
1718

@@ -21,6 +22,7 @@
2122
import java.util.List;
2223

2324
import org.assertj.core.api.AbstractListAssert;
25+
import org.assertj.core.api.ObjectAssert;
2426
import org.forgerock.api.annotations.ApiError;
2527
import org.forgerock.api.annotations.Schema;
2628

@@ -29,7 +31,7 @@
2931
*
3032
* @since 14.0.0
3133
*/
32-
public final class ApiErrorAssert extends AbstractListAssert<ApiErrorAssert, List<ApiError>, ApiError> {
34+
public final class ApiErrorAssert extends AbstractListAssert<ApiErrorAssert, List<ApiError>, ApiError, ObjectAssert<ApiError>> {
3335

3436
private final Class<?> annotatedClass;
3537

@@ -62,4 +64,16 @@ public ApiSchemaAssert schemas() {
6264
}
6365
return new ApiSchemaAssert(annotatedClass, schemas);
6466
}
67+
68+
@Override
69+
protected ObjectAssert<ApiError> toAssert(ApiError value, String description) {
70+
return new ObjectAssert<>(value).as(description);
71+
}
72+
73+
@Override
74+
protected ApiErrorAssert newAbstractIterableAssert(Iterable<? extends ApiError> iterable) {
75+
List<ApiError> list = new ArrayList<>();
76+
iterable.forEach(list::add);
77+
return new ApiErrorAssert(annotatedClass, list);
78+
}
6579
}

openam-test-utils/src/main/java/org/forgerock/openam/test/apidescriptor/ApiOperationsAssert.java

Lines changed: 15 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 2016 ForgeRock AS.
15+
* Portions copyright 2026 3A Systems, LLC
1516
*/
1617
package org.forgerock.openam.test.apidescriptor;
1718

@@ -22,6 +23,7 @@
2223
import java.util.List;
2324

2425
import org.assertj.core.api.AbstractListAssert;
26+
import org.assertj.core.api.ObjectAssert;
2527
import org.forgerock.api.annotations.ApiError;
2628
import org.forgerock.api.annotations.Operation;
2729

@@ -30,7 +32,7 @@
3032
*
3133
* @since 14.0.0
3234
*/
33-
public final class ApiOperationsAssert extends AbstractListAssert<ApiOperationsAssert, List<Operation>, Operation> {
35+
public final class ApiOperationsAssert extends AbstractListAssert<ApiOperationsAssert, List<Operation>, Operation, ObjectAssert<Operation>> {
3436

3537
private final Class<?> annotatedClass;
3638

@@ -64,4 +66,16 @@ public ApiOperationsAssert hasI18nDescriptions() {
6466
}
6567
return this;
6668
}
69+
70+
@Override
71+
protected ObjectAssert<Operation> toAssert(Operation value, String description) {
72+
return new ObjectAssert<>(value).as(description);
73+
}
74+
75+
@Override
76+
protected ApiOperationsAssert newAbstractIterableAssert(Iterable<? extends Operation> iterable) {
77+
List<Operation> list = new ArrayList<>();
78+
iterable.forEach(list::add);
79+
return new ApiOperationsAssert(annotatedClass, list);
80+
}
6781
}

openam-test-utils/src/main/java/org/forgerock/openam/test/apidescriptor/ApiParameterAssert.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,25 @@
1212
* information: "Portions copyright [year] [name of copyright owner]".
1313
*
1414
* Copyright 2016 ForgeRock AS.
15+
* Portions copyright 2026 3A Systems, LLC
1516
*/
1617
package org.forgerock.openam.test.apidescriptor;
1718

1819
import static org.forgerock.openam.test.apidescriptor.ApiAssertions.assertI18nDescription;
1920

21+
import java.util.ArrayList;
2022
import java.util.List;
2123

2224
import org.assertj.core.api.AbstractListAssert;
25+
import org.assertj.core.api.ObjectAssert;
2326
import org.forgerock.api.annotations.Parameter;
2427

2528
/**
2629
* This class represents the {@link Parameter} annotation.
2730
*
2831
* @since 14.0.0
2932
*/
30-
public final class ApiParameterAssert extends AbstractListAssert<ApiParameterAssert, List<Parameter>, Parameter> {
33+
public final class ApiParameterAssert extends AbstractListAssert<ApiParameterAssert, List<Parameter>, Parameter, ObjectAssert<Parameter>> {
3134

3235
private final Class<?> annotatedClass;
3336

@@ -47,4 +50,15 @@ public ApiParameterAssert hasI18nDescriptions() {
4750
}
4851
return this;
4952
}
53+
54+
protected ObjectAssert<Parameter> toAssert(Parameter value, String description) {
55+
return new ObjectAssert<>(value).as(description);
56+
}
57+
58+
@Override
59+
protected ApiParameterAssert newAbstractIterableAssert(Iterable<? extends Parameter> iterable) {
60+
List<Parameter> list = new ArrayList<>();
61+
iterable.forEach(list::add);
62+
return new ApiParameterAssert(annotatedClass, list);
63+
}
5064
}

openam-test-utils/src/main/java/org/forgerock/openam/test/apidescriptor/ApiSchemaAssert.java

Lines changed: 15 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 2016 ForgeRock AS.
15+
* Portions copyright 2026 3A Systems, LLC
1516
*/
1617
package org.forgerock.openam.test.apidescriptor;
1718

@@ -32,6 +33,7 @@
3233
import java.util.Stack;
3334

3435
import org.assertj.core.api.AbstractListAssert;
36+
import org.assertj.core.api.ObjectAssert;
3537
import org.forgerock.api.annotations.Description;
3638
import org.forgerock.api.annotations.Schema;
3739
import org.forgerock.api.annotations.Title;
@@ -45,7 +47,7 @@
4547
*
4648
* @since 14.0.0
4749
*/
48-
public final class ApiSchemaAssert extends AbstractListAssert<ApiSchemaAssert, List<Schema>, Schema> {
50+
public final class ApiSchemaAssert extends AbstractListAssert<ApiSchemaAssert, List<Schema>, Schema, ObjectAssert<Schema>> {
4951

5052
private final TitleAssertor titleAssertor = new TitleAssertor();
5153
private final DescriptionAssertor descriptionAssertor = new DescriptionAssertor();
@@ -71,6 +73,18 @@ public final class ApiSchemaAssert extends AbstractListAssert<ApiSchemaAssert, L
7173
}
7274
}
7375

76+
@Override
77+
protected ObjectAssert<Schema> toAssert(Schema value, String description) {
78+
return new ObjectAssert<>(value).as(description);
79+
}
80+
81+
@Override
82+
protected ApiSchemaAssert newAbstractIterableAssert(Iterable<? extends Schema> iterable) {
83+
List<Schema> list = new ArrayList<>();
84+
iterable.forEach(list::add);
85+
return new ApiSchemaAssert(annotatedClass, list);
86+
}
87+
7488
/**
7589
* Assert that all titles use i18n and that the keys have valid entries in the specifies resource bundle.
7690
*

0 commit comments

Comments
 (0)