From 0b57e8b5a51ed56815309681dd87b97ebe5584f8 Mon Sep 17 00:00:00 2001 From: Neelesh Date: Thu, 23 May 2019 20:26:12 -0700 Subject: [PATCH] Upgrade to Spring 5.1.5 and fix test case failure due to https://github.com/spring-projects/spring-security/issues/5401 --- pom.xml | 8 ++++---- .../security/acls/mongodb/MongoDBAclServiceTest.java | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 3bbd025..3fb4cda 100644 --- a/pom.xml +++ b/pom.xml @@ -6,11 +6,11 @@ org.springframework.security spring-security-acl-mongodb - 4.2.3-SNAPSHOT + 5.1.5-SNAPSHOT - 4.2.3.RELEASE - 1.10.4.RELEASE + 5.1.5.RELEASE + 2.1.8.RELEASE @@ -46,7 +46,7 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo test - 2.0.3 + 2.2.0 diff --git a/src/test/java/org/springframework/security/acls/mongodb/MongoDBAclServiceTest.java b/src/test/java/org/springframework/security/acls/mongodb/MongoDBAclServiceTest.java index 5562dbe..925c6d5 100644 --- a/src/test/java/org/springframework/security/acls/mongodb/MongoDBAclServiceTest.java +++ b/src/test/java/org/springframework/security/acls/mongodb/MongoDBAclServiceTest.java @@ -55,6 +55,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import java.io.Serializable; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Arrays; @@ -65,6 +66,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; +import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; @@ -489,11 +491,11 @@ public void issue3_testReadAclsByIdTwice() throws Exception { } private void checkPermissions(Acl acl) { - Set permissions = new LinkedHashSet<>(); + Set permissions = new LinkedHashSet<>(); Acl _parent = acl.getParentAcl(); if (acl.isEntriesInheriting()) { while (null != _parent) { - permissions.addAll(_parent.getEntries()); + permissions.addAll(_parent.getEntries().stream().map(e->e.getId()).collect(Collectors.toList())); if (_parent.isEntriesInheriting()) { _parent = _parent.getParentAcl(); }