This is an automated email from the ASF dual-hosted git repository. mdisabatino pushed a commit to branch 2_1_X in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/2_1_X by this push: new 1ceeccc [SYNCOPE-1467] Added test 1ceeccc is described below commit 1ceecccec496e8d7e92042cb6dcd2e609e25f1d8 Author: Marco Di Sabatino Di Diodoro <marco.disabat...@tirasa.net> AuthorDate: Tue May 7 11:41:32 2019 +0200 [SYNCOPE-1467] Added test --- .../org/apache/syncope/fit/core/GroupITCase.java | 39 ++++++++++++++++++++++ pom.xml | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java index de39e53..33cbe38 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java @@ -1116,4 +1116,43 @@ public class GroupITCase extends AbstractITCase { assertNotNull(groupTO); assertEquals("11.23", groupTO.getPlainAttr(doubleSchemaName).get().getValues().get(0)); } + + @Test + public void issueSYNCOPE1467() { + GroupTO groupTO = null; + try { + groupTO = new GroupTO(); + groupTO.setRealm(SyncopeConstants.ROOT_REALM); + groupTO.setName("issueSYNCOPE1467"); + groupTO.getResources().add(RESOURCE_NAME_LDAP); + + groupTO = createGroup(groupTO).getEntity(); + assertNotNull(groupTO); + assertTrue(groupTO.getResources().contains(RESOURCE_NAME_LDAP)); + + ConnObjectTO connObjectTO = + resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), groupTO.getKey()); + assertNotNull(connObjectTO); + assertEquals("issueSYNCOPE1467", connObjectTO.getAttr("cn").get().getValues().get(0)); + + GroupPatch groupPatch = new GroupPatch(); + groupPatch.setKey(groupTO.getKey()); + groupPatch.setName(new StringReplacePatchItem.Builder().value("fixedSYNCOPE1467").build()); + + assertNotNull(updateGroup(groupPatch).getEntity()); + + // Assert resources are present + ResourceTO ldap = resourceService.read(RESOURCE_NAME_LDAP); + assertNotNull(ldap); + + connObjectTO = resourceService. + readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), groupTO.getKey()); + assertNotNull(connObjectTO); + assertEquals("fixedSYNCOPE1467", connObjectTO.getAttr("cn").get().getValues().get(0)); + } finally { + if (groupTO.getKey() != null) { + groupService.delete(groupTO.getKey()); + } + } + } } diff --git a/pom.xml b/pom.xml index 672334a..9aa37a2 100644 --- a/pom.xml +++ b/pom.xml @@ -382,7 +382,7 @@ under the License. <connid.rest.version>1.0.4</connid.rest.version> <connid.database.version>2.2.6</connid.database.version> <connid.csvdir.version>0.8.8</connid.csvdir.version> - <connid.ldap.version>1.5.3</connid.ldap.version> + <connid.ldap.version>1.5.4-SNAPSHOT</connid.ldap.version> <connid.ad.version>1.3.6</connid.ad.version> <connid.googleapps.version>1.4.2</connid.googleapps.version> <connid.azure.version>1.0.1</connid.azure.version>