Skip to content

Commit

Permalink
fix for import report with one value of multivalue attribute (MID-6737)
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Dec 22, 2020
1 parent e5301a2 commit 2f7e900
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Expand Up @@ -584,7 +584,11 @@ private ArrayList<String> getImportStringValues(Object realValue, boolean isSing
if (isSingleValue || realValue == null) {
stringValues.add((String) realValue);
} else {
stringValues.addAll((List<String>) realValue);
if (realValue instanceof String) {
stringValues.add((String) realValue);
} else {
stringValues.addAll((List<String>) realValue);
}
}
return stringValues;
}
Expand Down
Expand Up @@ -189,6 +189,14 @@ public void test200ImportReportForUser() throws Exception {
assertTrue(user.asObjectable().getSubtype().isEmpty());
assertEquals("Test import: test_NICK2", user.asObjectable().getNickName().getOrig());
assertTrue(user.asObjectable().getAssignment().isEmpty());

user = searchObjectByName(UserType.class, "testUser03");
assertNotNull("User testUser03 was not created", user);
assertEquals(ActivationStatusType.ENABLED, user.asObjectable().getActivation().getAdministrativeStatus());
assertEquals("2020-07-07T00:00:00.000+02:00", user.asObjectable().getActivation().getValidFrom().toString());
assertEquals("sub31", user.asObjectable().getSubtype().get(0));
assertEquals("Test import: test_NICK3", user.asObjectable().getNickName().getOrig());
assertTrue(user.asObjectable().getAssignment().isEmpty());
}

@Test(dependsOnMethods = {"test115CreateObjectCollectionReportWithCondition"})
Expand Down
@@ -1,3 +1,4 @@
"Name (Collection)";"Administrative status";"Valid from";"Nick";"AssignmentOid";"Subtype"
"testUser01";"enabled";"2020-07-07T00:00:00.000+02:00";"test_NICK";"00000000-0000-0000-0000-000000000008,00000000-0000-0000-0000-000000000004";"sub1,sub22"
"testUser02";"enabled";"2020-07-07T00:00:00.000+02:00";"test_NICK2";;
"testUser03";"enabled";"2020-07-07T00:00:00.000+02:00";"test_NICK3";;"sub31"

0 comments on commit 2f7e900

Please sign in to comment.