ilgrosso commented on code in PR #1137:
URL: https://github.com/apache/syncope/pull/1137#discussion_r2212998661


##########
fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java:
##########
@@ -1876,4 +1878,50 @@ void issueSYNCOPE1853() {
                         .collect(Collectors.toList()).stream().anyMatch(pt -> 
ResourceOperation.DELETE == pt.
                         getOperation()));
     }
+
+    @Test
+    public void issue1894() {

Review Comment:
   See above



##########
fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java:
##########
@@ -1876,4 +1878,50 @@ void issueSYNCOPE1853() {
                         .collect(Collectors.toList()).stream().anyMatch(pt -> 
ResourceOperation.DELETE == pt.
                         getOperation()));
     }
+
+    @Test
+    public void issue1894() {
+        SchemaTO userWithDotSchema = new PlainSchemaTO();
+        userWithDotSchema.setKey("user.testWithDot");
+        userWithDotSchema.setAnyTypeClass("minimal user");
+        SCHEMA_SERVICE.create(SchemaType.PLAIN, userWithDotSchema);
+        
+        ResourceTO ldap = RESOURCE_SERVICE.read(RESOURCE_NAME_LDAP);
+        ldap.setKey("ldapWithDot");
+
+        Provision provision = 
ldap.getProvision(AnyTypeKind.USER.name()).orElse(null);

Review Comment:
   `orElseThrow()`



##########
core/provisioning-api/src/test/java/org/apache/syncope/core/provisioning/api/IntAttrNameParserTest.java:
##########
@@ -362,4 +363,13 @@ public void invalid() {
             assertNotNull(e);
         }
     }
+
+    @Test
+    public void issue1894() throws ParseException {

Review Comment:
   This method should be named `issueSYNCOPE1894()` to follow the current 
convention



##########
fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java:
##########
@@ -1876,4 +1878,50 @@ void issueSYNCOPE1853() {
                         .collect(Collectors.toList()).stream().anyMatch(pt -> 
ResourceOperation.DELETE == pt.
                         getOperation()));
     }
+
+    @Test
+    public void issue1894() {
+        SchemaTO userWithDotSchema = new PlainSchemaTO();
+        userWithDotSchema.setKey("user.testWithDot");
+        userWithDotSchema.setAnyTypeClass("minimal user");
+        SCHEMA_SERVICE.create(SchemaType.PLAIN, userWithDotSchema);
+        
+        ResourceTO ldap = RESOURCE_SERVICE.read(RESOURCE_NAME_LDAP);
+        ldap.setKey("ldapWithDot");
+
+        Provision provision = 
ldap.getProvision(AnyTypeKind.USER.name()).orElse(null);
+        provision.getMapping().getItems().removeIf(item -> 
"mail".equals(item.getIntAttrName()));
+        provision.getVirSchemas().clear();
+
+        ldap.getProvisions().clear();
+        ldap.getProvisions().add(provision);
+
+        Item item = new Item();
+        item.setIntAttrName(userWithDotSchema.getKey());
+        item.setExtAttrName("carLicense");
+        item.setPurpose(MappingPurpose.PROPAGATION);
+
+        provision.getMapping().add(item);
+
+        ldap = createResource(ldap);
+
+        try {
+            UserCR userCR = 
UserITCase.getUniqueSample("userwith...@syncope.apache.org");
+            userCR.getPlainAttrs().add(attr("user.testWithDot", 
"someCarLicenseValue"));
+            userCR.getResources().add(ldap.getKey());
+
+            ProvisioningResult<UserTO> result = createUser(userCR);
+            assertEquals(1, result.getPropagationStatuses().size());
+            
assertNotNull(result.getPropagationStatuses().get(0).getAfterObj());
+
+            Attr carLicense =
+                    
result.getPropagationStatuses().get(0).getAfterObj().getAttr("carLicense").orElse(null);

Review Comment:
   `orElseThrow()` and remove following `assertNotNull`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@syncope.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to