This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch 4_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/4_0_X by this push:
new 3ecc6620fa [SYNCOPE-1908] Fixing IT case
3ecc6620fa is described below
commit 3ecc6620faa58f20c69ce480603461fbe5cb463f
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Thu Sep 11 14:21:46 2025 +0200
[SYNCOPE-1908] Fixing IT case
---
.../core/persistence/common/entity/DefaultAnyUtils.java | 4 ----
.../test/java/org/apache/syncope/fit/core/UserITCase.java | 14 +++++++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git
a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/entity/DefaultAnyUtils.java
b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/entity/DefaultAnyUtils.java
index f8f8fd53fa..eea5530534 100644
---
a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/entity/DefaultAnyUtils.java
+++
b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/entity/DefaultAnyUtils.java
@@ -18,10 +18,6 @@
*/
package org.apache.syncope.core.persistence.common.entity;
-import static org.apache.syncope.common.lib.types.AnyTypeKind.ANY_OBJECT;
-import static org.apache.syncope.common.lib.types.AnyTypeKind.GROUP;
-import static org.apache.syncope.common.lib.types.AnyTypeKind.USER;
-
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collection;
diff --git
a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
index b5755f32da..67a704bd92 100644
---
a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
+++
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
@@ -377,12 +377,12 @@ public class UserITCase extends AbstractITCase {
public void createWithRequiredValueMissing() {
UserCR userCR = getUniqueSample("[email protected]");
- Attr type = userCR.getPlainAttr("ctype").get();
- userCR.getPlainAttrs().remove(type);
+ Attr userId = userCR.getPlainAttr("userId").orElseThrow();
+ userCR.getPlainAttrs().remove(userId);
userCR.getMemberships().add(new
MembershipTO.Builder("f779c0d4-633b-4be5-8f57-32eb478a3ca5").build());
- // 1. create user without type (mandatory by UserSchema)
+ // 1. create user without userId (mandatory by UserSchema)
try {
createUser(userCR);
fail("This should not happen");
@@ -390,12 +390,16 @@ public class UserITCase extends AbstractITCase {
assertEquals(ClientExceptionType.RequiredValuesMissing,
e.getType());
}
+ userCR.getPlainAttrs().add(attr("userId", userCR.getUsername()));
+
+ Attr ctype = userCR.getPlainAttr("userId").orElseThrow();
+ userCR.getPlainAttrs().remove(ctype);
userCR.getPlainAttrs().add(attr("ctype", "F"));
- Attr surname = userCR.getPlainAttr("surname").get();
+ Attr surname = userCR.getPlainAttr("surname").orElseThrow();
userCR.getPlainAttrs().remove(surname);
- // 2. create user without surname (mandatory when type == 'F')
+ // 2. create user without surname (mandatory when ctype == 'F')
try {
createUser(userCR);
fail("This should not happen");