syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [4/5] syncope git commit: [SYNCOPE-1208] Now using JUnit 5 (with temporary junit-platform-surefire-provider 1.1.0-SNAPSHOT)
Date Mon, 02 Oct 2017 13:29:24 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
index a1fe83e..0bf2672 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ResourceTest.java
@@ -18,12 +18,13 @@
  */
 package org.apache.syncope.core.persistence.jpa.inner;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.List;
 import java.util.stream.Collectors;
@@ -44,7 +45,7 @@ import org.apache.syncope.core.spring.security.DelegatedAdministrationException;
 import org.apache.syncope.core.spring.security.SyncopeAuthenticationDetails;
 import org.apache.syncope.core.spring.security.SyncopeGrantedAuthority;
 import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.GrantedAuthority;
@@ -63,23 +64,22 @@ public class ResourceTest extends AbstractTest {
     @Test
     public void findById() {
         ExternalResource resource = resourceDAO.find("ws-target-resource-1");
-        assertNotNull("findById did not work", resource);
+        assertNotNull(resource);
 
         ConnInstance connector = resource.getConnector();
-        assertNotNull("connector not found", connector);
-        assertEquals("invalid connector name",
-                "net.tirasa.connid.bundles.soap.WebServiceConnector", connector.getConnectorName());
-        assertEquals("invalid bundle name", "net.tirasa.connid.bundles.soap", connector.getBundleName());
+        assertNotNull(connector);
+        assertEquals("net.tirasa.connid.bundles.soap.WebServiceConnector", connector.getConnectorName());
+        assertEquals("net.tirasa.connid.bundles.soap", connector.getBundleName());
 
         Mapping mapping = resource.getProvision(anyTypeDAO.findUser()).get().getMapping();
-        assertFalse("no mapping specified", mapping.getItems().isEmpty());
+        assertFalse(mapping.getItems().isEmpty());
 
         assertTrue(mapping.getItems().stream().
                 anyMatch(item -> "7f55b09c-b573-41dc-a9eb-ccd80bd3ea7a".equals(item.getKey())));
 
         try {
             resourceDAO.authFind("ws-target-resource-1");
-            fail();
+            fail("This should not happen");
         } catch (DelegatedAdministrationException e) {
             assertNotNull(e);
         }
@@ -156,94 +156,100 @@ public class ResourceTest extends AbstractTest {
         assertEquals(Integer.valueOf(2), actual.getPropagationPriority());
     }
 
-    @Test(expected = InvalidEntityException.class)
+    @Test
     public void saveInvalidMappingIntAttr() {
-        ExternalResource resource = entityFactory.newEntity(ExternalResource.class);
-        resource.setKey("ws-target-resource-basic-save-invalid");
+        assertThrows(InvalidEntityException.class, () -> {
+            ExternalResource resource = entityFactory.newEntity(ExternalResource.class);
+            resource.setKey("ws-target-resource-basic-save-invalid");
 
-        ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
-        resource.setConnector(connector);
+            ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
+            resource.setConnector(connector);
 
-        Provision provision = entityFactory.newEntity(Provision.class);
-        provision.setAnyType(anyTypeDAO.findUser());
-        provision.setObjectClass(ObjectClass.ACCOUNT);
-        provision.setResource(resource);
-        resource.add(provision);
+            Provision provision = entityFactory.newEntity(Provision.class);
+            provision.setAnyType(anyTypeDAO.findUser());
+            provision.setObjectClass(ObjectClass.ACCOUNT);
+            provision.setResource(resource);
+            resource.add(provision);
 
-        Mapping mapping = entityFactory.newEntity(Mapping.class);
-        mapping.setProvision(provision);
-        provision.setMapping(mapping);
+            Mapping mapping = entityFactory.newEntity(Mapping.class);
+            mapping.setProvision(provision);
+            provision.setMapping(mapping);
 
-        MappingItem connObjectKey = entityFactory.newEntity(MappingItem.class);
-        connObjectKey.setConnObjectKey(true);
-        mapping.add(connObjectKey);
+            MappingItem connObjectKey = entityFactory.newEntity(MappingItem.class);
+            connObjectKey.setConnObjectKey(true);
+            mapping.add(connObjectKey);
 
-        // save the resource
-        resourceDAO.save(resource);
+            // save the resource
+            resourceDAO.save(resource);
+        });
     }
 
-    @Test(expected = InvalidEntityException.class)
+    @Test
     public void saveInvalidMappingExtAttr() {
-        ExternalResource resource = entityFactory.newEntity(ExternalResource.class);
-        resource.setKey("ws-target-resource-basic-save-invalid");
+        assertThrows(InvalidEntityException.class, () -> {
+            ExternalResource resource = entityFactory.newEntity(ExternalResource.class);
+            resource.setKey("ws-target-resource-basic-save-invalid");
 
-        ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
-        resource.setConnector(connector);
+            ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
+            resource.setConnector(connector);
 
-        Provision provision = entityFactory.newEntity(Provision.class);
-        provision.setAnyType(anyTypeDAO.findUser());
-        provision.setObjectClass(ObjectClass.ACCOUNT);
-        provision.setResource(resource);
-        resource.add(provision);
+            Provision provision = entityFactory.newEntity(Provision.class);
+            provision.setAnyType(anyTypeDAO.findUser());
+            provision.setObjectClass(ObjectClass.ACCOUNT);
+            provision.setResource(resource);
+            resource.add(provision);
 
-        Mapping mapping = entityFactory.newEntity(Mapping.class);
-        mapping.setProvision(provision);
-        provision.setMapping(mapping);
+            Mapping mapping = entityFactory.newEntity(Mapping.class);
+            mapping.setProvision(provision);
+            provision.setMapping(mapping);
 
-        MappingItem item = entityFactory.newEntity(MappingItem.class);
-        item.setConnObjectKey(true);
-        item.setIntAttrName("fullname");
-        mapping.add(item);
+            MappingItem item = entityFactory.newEntity(MappingItem.class);
+            item.setConnObjectKey(true);
+            item.setIntAttrName("fullname");
+            mapping.add(item);
 
-        item = entityFactory.newEntity(MappingItem.class);
-        item.setIntAttrName("userId");
-        mapping.add(item);
+            item = entityFactory.newEntity(MappingItem.class);
+            item.setIntAttrName("userId");
+            mapping.add(item);
 
-        resourceDAO.save(resource);
+            resourceDAO.save(resource);
+        });
     }
 
-    @Test(expected = InvalidEntityException.class)
+    @Test
     public void saveInvalidProvision() {
-        ExternalResource resource = entityFactory.newEntity(ExternalResource.class);
-        resource.setKey("invalidProvision");
-
-        Provision provision = entityFactory.newEntity(Provision.class);
-        provision.setAnyType(anyTypeDAO.findUser());
-        provision.setObjectClass(ObjectClass.ACCOUNT);
-        provision.setResource(resource);
-        resource.add(provision);
-
-        Mapping mapping = entityFactory.newEntity(Mapping.class);
-        mapping.setProvision(provision);
-        provision.setMapping(mapping);
-
-        MappingItem connObjectKey = entityFactory.newEntity(MappingItem.class);
-        connObjectKey.setExtAttrName("username");
-        connObjectKey.setIntAttrName("fullname");
-        connObjectKey.setPurpose(MappingPurpose.BOTH);
-        mapping.setConnObjectKeyItem(connObjectKey);
-
-        provision = entityFactory.newEntity(Provision.class);
-        provision.setAnyType(anyTypeDAO.findGroup());
-        provision.setObjectClass(ObjectClass.ACCOUNT);
-        provision.setResource(resource);
-        resource.add(provision);
-
-        ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
-        resource.setConnector(connector);
-
-        // save the resource
-        resourceDAO.save(resource);
+        assertThrows(InvalidEntityException.class, () -> {
+            ExternalResource resource = entityFactory.newEntity(ExternalResource.class);
+            resource.setKey("invalidProvision");
+
+            Provision provision = entityFactory.newEntity(Provision.class);
+            provision.setAnyType(anyTypeDAO.findUser());
+            provision.setObjectClass(ObjectClass.ACCOUNT);
+            provision.setResource(resource);
+            resource.add(provision);
+
+            Mapping mapping = entityFactory.newEntity(Mapping.class);
+            mapping.setProvision(provision);
+            provision.setMapping(mapping);
+
+            MappingItem connObjectKey = entityFactory.newEntity(MappingItem.class);
+            connObjectKey.setExtAttrName("username");
+            connObjectKey.setIntAttrName("fullname");
+            connObjectKey.setPurpose(MappingPurpose.BOTH);
+            mapping.setConnObjectKeyItem(connObjectKey);
+
+            provision = entityFactory.newEntity(Provision.class);
+            provision.setAnyType(anyTypeDAO.findGroup());
+            provision.setObjectClass(ObjectClass.ACCOUNT);
+            provision.setResource(resource);
+            resource.add(provision);
+
+            ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
+            resource.setConnector(connector);
+
+            // save the resource
+            resourceDAO.save(resource);
+        });
     }
 
     @Test
@@ -342,7 +348,7 @@ public class ResourceTest extends AbstractTest {
 
         try {
             resourceDAO.save(resource);
-            fail();
+            fail("This should not happen");
         } catch (InvalidEntityException e) {
             assertTrue(e.hasViolation(EntityViolationType.InvalidKey));
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/RoleTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/RoleTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/RoleTest.java
index 55fbb19..3b1263d 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/RoleTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/RoleTest.java
@@ -18,10 +18,10 @@
  */
 package org.apache.syncope.core.persistence.jpa.inner;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.List;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
@@ -29,7 +29,7 @@ import org.apache.syncope.core.persistence.api.dao.RealmDAO;
 import org.apache.syncope.core.persistence.api.dao.RoleDAO;
 import org.apache.syncope.core.persistence.api.entity.Role;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/SecurityQuestionTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/SecurityQuestionTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/SecurityQuestionTest.java
index 7a84762..ce8776d 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/SecurityQuestionTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/SecurityQuestionTest.java
@@ -18,16 +18,16 @@
  */
 package org.apache.syncope.core.persistence.jpa.inner;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.List;
 import java.util.UUID;
 import org.apache.syncope.core.persistence.api.dao.SecurityQuestionDAO;
 import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
index df08139..2bb8e83 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
@@ -18,8 +18,8 @@
  */
 package org.apache.syncope.core.persistence.jpa.inner;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.Calendar;
 import java.util.Date;
@@ -30,7 +30,7 @@ import org.apache.syncope.core.persistence.api.dao.TaskExecDAO;
 import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
 import org.apache.syncope.core.persistence.api.entity.task.TaskExec;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
index e7f1165..803984e 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskTest.java
@@ -18,11 +18,11 @@
  */
 package org.apache.syncope.core.persistence.jpa.inner;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 import java.util.HashSet;
@@ -42,7 +42,7 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.identityconnectors.framework.common.objects.Attribute;
 import org.identityconnectors.framework.common.objects.AttributeBuilder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/UserTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/UserTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/UserTest.java
index 5400c31..26417c8 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/UserTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/UserTest.java
@@ -18,10 +18,11 @@
  */
 package org.apache.syncope.core.persistence.jpa.inner;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Date;
 import java.util.List;
@@ -35,7 +36,7 @@ import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.apache.syncope.core.provisioning.api.utils.policy.InvalidPasswordRuleConf;
 import org.apache.syncope.core.spring.security.PasswordGenerator;
 import org.apache.syncope.core.persistence.api.dao.RealmDAO;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -57,49 +58,53 @@ public class UserTest extends AbstractTest {
     @Test
     public void findAll() {
         List<User> list = userDAO.findAll(1, 100);
-        assertEquals("did not get expected number of users", 5, list.size());
+        assertEquals(5, list.size());
     }
 
     @Test
     public void count() {
-        Integer count = userDAO.count();
+        int count = userDAO.count();
         assertNotNull(count);
-        assertEquals(5, count, 0);
+        assertEquals(5, count);
     }
 
     @Test
     public void findAllByPageAndSize() {
         // get first page
         List<User> list = userDAO.findAll(1, 2);
-        assertEquals("did not get expected number of users", 2, list.size());
+        assertEquals(2, list.size());
 
         // get second page
         list = userDAO.findAll(2, 2);
-        assertEquals("did not get expected number of users", 2, list.size());
+        assertEquals(2, list.size());
 
         // get second page with uncomplete set
         list = userDAO.findAll(2, 3);
-        assertEquals("did not get expected number of users", 2, list.size());
+        assertEquals(2, list.size());
 
         // get unexistent page
         list = userDAO.findAll(3, 2);
-        assertEquals("did not get expected number of users", 1, list.size());
+        assertEquals(1, list.size());
     }
 
     @Test
     public void findByDerAttributeValue() {
         final List<User> list = userDAO.findByDerAttrValue("cn", "Vivaldi, Antonio");
-        assertEquals("did not get expected number of users", 1, list.size());
+        assertEquals(1, list.size());
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void findByInvalidDerAttrValue() {
-        userDAO.findByDerAttrValue("cn", "Antonio, Maria, Rossi");
+        assertThrows(IllegalArgumentException.class, () -> {
+            userDAO.findByDerAttrValue("cn", "Antonio, Maria, Rossi");
+        });
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void findByInvalidDerAttrExpression() {
-        userDAO.findByDerAttrValue("noschema", "Antonio, Maria");
+        assertThrows(IllegalArgumentException.class, () -> {
+            userDAO.findByDerAttrValue("noschema", "Antonio, Maria");
+        });
     }
 
     @Test
@@ -108,7 +113,7 @@ public class UserTest extends AbstractTest {
         fullnameValue.setStringValue("Gioacchino Rossini");
 
         final List<User> list = userDAO.findByPlainAttrValue("fullname", fullnameValue);
-        assertEquals("did not get expected number of users", 1, list.size());
+        assertEquals(1, list.size());
     }
 
     @Test
@@ -117,23 +122,23 @@ public class UserTest extends AbstractTest {
         coolValue.setBooleanValue(true);
 
         final List<User> list = userDAO.findByPlainAttrValue("cool", coolValue);
-        assertEquals("did not get expected number of users", 1, list.size());
+        assertEquals(1, list.size());
     }
 
     @Test
     public void findByKey() {
         User user = userDAO.find("1417acbe-cbf6-4277-9372-e75e04f97000");
-        assertNotNull("did not find expected user", user);
+        assertNotNull(user);
     }
 
     @Test
     public void findByUsername() {
         User user = userDAO.findByUsername("rossini");
-        assertNotNull("did not find expected user", user);
+        assertNotNull(user);
         user = userDAO.findByUsername("vivaldi");
-        assertNotNull("did not find expected user", user);
+        assertNotNull(user);
         user = userDAO.findByUsername("user6");
-        assertNull("found user but did not expect it", user);
+        assertNull(user);
     }
 
     @Test
@@ -148,7 +153,7 @@ public class UserTest extends AbstractTest {
 
         try {
             userDAO.save(user);
-            fail();
+            fail("This should not happen");
         } catch (InvalidEntityException e) {
             assertNotNull(e);
         }
@@ -159,7 +164,7 @@ public class UserTest extends AbstractTest {
 
         try {
             userDAO.save(user);
-            fail();
+            fail("This should not happen");
         } catch (InvalidEntityException e) {
             assertNotNull(e);
         }
@@ -167,7 +172,7 @@ public class UserTest extends AbstractTest {
         user.setUsername("username");
 
         User actual = userDAO.save(user);
-        assertNotNull("expected save to work", actual);
+        assertNotNull(actual);
         assertEquals(1, actual.getPasswordHistory().size());
         assertNotNull(userDAO.findLastChange(actual.getKey()));
         assertEquals(actual.getLastChangeDate(), userDAO.findLastChange(actual.getKey()));
@@ -180,7 +185,7 @@ public class UserTest extends AbstractTest {
         userDAO.delete(user.getKey());
 
         User actual = userDAO.find("b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee");
-        assertNull("delete did not work", actual);
+        assertNull(actual);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/VirSchemaTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/VirSchemaTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/VirSchemaTest.java
index e6b0410..5283b76 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/VirSchemaTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/VirSchemaTest.java
@@ -18,11 +18,11 @@
  */
 package org.apache.syncope.core.persistence.jpa.inner;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.List;
 import org.apache.syncope.common.lib.types.EntityViolationType;
@@ -34,7 +34,7 @@ import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.resource.Provision;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -56,7 +56,7 @@ public class VirSchemaTest extends AbstractTest {
     @Test
     public void findByName() {
         VirSchema attributeSchema = virSchemaDAO.find("virtualdata");
-        assertNotNull("did not find expected virtual attribute schema", attributeSchema);
+        assertNotNull(attributeSchema);
     }
 
     @Test
@@ -74,7 +74,7 @@ public class VirSchemaTest extends AbstractTest {
         virSchemaDAO.save(virSchema);
 
         VirSchema actual = virSchemaDAO.find("virtual");
-        assertNotNull("expected save to work", actual);
+        assertNotNull(actual);
         assertTrue(actual.isReadonly());
         assertEquals("EXT_ATTR", actual.getExtAttrName());
     }
@@ -86,7 +86,7 @@ public class VirSchemaTest extends AbstractTest {
         virSchemaDAO.delete(virtualdata.getKey());
 
         VirSchema actual = virSchemaDAO.find("virtualdata");
-        assertNull("delete did not work", actual);
+        assertNull(actual);
 
         // ------------- //
         VirSchema rvirtualdata = virSchemaDAO.find("rvirtualdata");
@@ -95,7 +95,7 @@ public class VirSchemaTest extends AbstractTest {
         virSchemaDAO.delete(rvirtualdata.getKey());
 
         actual = virSchemaDAO.find("rvirtualdata");
-        assertNull("delete did not work", actual);
+        assertNull(actual);
     }
 
     @Test
@@ -105,7 +105,7 @@ public class VirSchemaTest extends AbstractTest {
 
         try {
             virSchemaDAO.save(schema);
-            fail();
+            fail("This should not happen");
         } catch (InvalidEntityException e) {
             assertTrue(e.hasViolation(EntityViolationType.InvalidKey));
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AccessTokenTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AccessTokenTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AccessTokenTest.java
index 5f87771..276eef5 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AccessTokenTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AccessTokenTest.java
@@ -18,16 +18,16 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.Date;
 import java.util.UUID;
 import org.apache.syncope.core.persistence.api.dao.AccessTokenDAO;
 import org.apache.syncope.core.persistence.api.entity.AccessToken;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnySearchTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnySearchTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnySearchTest.java
index f3d3203..ce1a1a7 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnySearchTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnySearchTest.java
@@ -18,9 +18,9 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.List;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
@@ -37,7 +37,7 @@ import org.apache.syncope.core.persistence.api.entity.Role;
 import org.apache.syncope.core.persistence.api.entity.group.Group;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeClassTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeClassTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeClassTest.java
index c120757..3b9b69d 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeClassTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeClassTest.java
@@ -18,9 +18,9 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
@@ -28,7 +28,7 @@ import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
 import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
 import org.apache.syncope.core.persistence.api.entity.PlainSchema;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeTest.java
index d86b4b9..95a1ad6 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/AnyTypeTest.java
@@ -18,17 +18,17 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConfTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConfTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConfTest.java
index c5559df..695bb87 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConfTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConfTest.java
@@ -18,8 +18,8 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import org.apache.syncope.core.persistence.api.dao.ConfDAO;
 import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
@@ -27,7 +27,7 @@ import org.apache.syncope.core.persistence.api.entity.PlainAttrUniqueValue;
 import org.apache.syncope.core.persistence.api.entity.conf.CPlainAttr;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.apache.syncope.core.persistence.jpa.entity.conf.JPACPlainAttrValue;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceHistoryConfTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceHistoryConfTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceHistoryConfTest.java
index 43c0b65..fd20122 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceHistoryConfTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceHistoryConfTest.java
@@ -18,10 +18,10 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Date;
 import java.util.List;
@@ -31,7 +31,7 @@ import org.apache.syncope.core.persistence.api.dao.ConnInstanceHistoryConfDAO;
 import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.apache.syncope.core.persistence.api.entity.ConnInstanceHistoryConf;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceTest.java
index e0794f8..26ac5c3 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ConnInstanceTest.java
@@ -18,11 +18,11 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.List;
 import java.util.UUID;
@@ -32,7 +32,7 @@ import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
 import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/DynRealmTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/DynRealmTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/DynRealmTest.java
index db47035..f1bb119 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/DynRealmTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/DynRealmTest.java
@@ -18,10 +18,10 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.List;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
@@ -35,7 +35,7 @@ import org.apache.syncope.core.persistence.api.entity.DynRealm;
 import org.apache.syncope.core.persistence.api.entity.DynRealmMembership;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -70,7 +70,7 @@ public class DynRealmTest extends AbstractTest {
         // invalid key (starts with /)
         try {
             dynRealmDAO.save(dynRealm);
-            fail();
+            fail("This should not happen");
         } catch (Exception e) {
             assertNotNull(e);
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
index bf00361..9f1f28f 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
@@ -18,11 +18,12 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -57,7 +58,7 @@ import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.apache.syncope.core.persistence.jpa.dao.JPAGroupDAO;
 import org.apache.syncope.core.persistence.jpa.entity.anyobject.JPAADynGroupMembership;
 import org.apache.syncope.core.persistence.jpa.entity.user.JPAUDynGroupMembership;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -91,30 +92,32 @@ public class GroupTest extends AbstractTest {
     @Autowired
     private AnyTypeClassDAO anyTypeClassDAO;
 
-    @Test(expected = InvalidEntityException.class)
+    @Test
     public void saveWithTwoOwners() {
-        Group root = groupDAO.findByName("root");
-        assertNotNull("did not find expected group", root);
+        assertThrows(InvalidEntityException.class, () -> {
+            Group root = groupDAO.findByName("root");
+            assertNotNull(root);
 
-        User user = userDAO.findByUsername("rossini");
-        assertNotNull("did not find expected user", user);
+            User user = userDAO.findByUsername("rossini");
+            assertNotNull(user);
 
-        Group group = entityFactory.newEntity(Group.class);
-        group.setRealm(realmDAO.getRoot());
-        group.setName("error");
-        group.setUserOwner(user);
-        group.setGroupOwner(root);
+            Group group = entityFactory.newEntity(Group.class);
+            group.setRealm(realmDAO.getRoot());
+            group.setName("error");
+            group.setUserOwner(user);
+            group.setGroupOwner(root);
 
-        groupDAO.save(group);
+            groupDAO.save(group);
+        });
     }
 
     @Test
     public void findByOwner() {
         Group group = groupDAO.find("ebf97068-aa4b-4a85-9f01-680e8c4cf227");
-        assertNotNull("did not find expected group", group);
+        assertNotNull(group);
 
         User user = userDAO.find("823074dc-d280-436d-a7dd-07399fae48ec");
-        assertNotNull("did not find expected user", user);
+        assertNotNull(user);
 
         assertEquals(user, group.getUserOwner());
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainAttrTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainAttrTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainAttrTest.java
index 456076c..8eb98af 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainAttrTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainAttrTest.java
@@ -18,15 +18,15 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import org.apache.syncope.core.persistence.api.dao.PlainAttrDAO;
 import org.apache.syncope.core.persistence.api.dao.PlainAttrValueDAO;
 import org.apache.syncope.core.persistence.api.entity.user.UPlainAttr;
 import org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainSchemaTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainSchemaTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainSchemaTest.java
index 16a80df..efffb8d 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainSchemaTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/PlainSchemaTest.java
@@ -18,12 +18,12 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.HashSet;
 import java.util.List;
@@ -47,9 +47,9 @@ import org.apache.syncope.core.persistence.api.entity.user.UPlainAttr;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.apache.syncope.core.spring.security.SyncopeAuthenticationDetails;
 import org.apache.syncope.core.spring.security.SyncopeGrantedAuthority;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.GrantedAuthority;
@@ -77,7 +77,7 @@ public class PlainSchemaTest extends AbstractTest {
     @Autowired
     private ExternalResourceDAO resourceDAO;
 
-    @BeforeClass
+    @BeforeAll
     public static void setAuthContext() {
         List<GrantedAuthority> authorities = StandardEntitlement.values().stream().
                 map(entitlement -> new SyncopeGrantedAuthority(entitlement, SyncopeConstants.ROOT_REALM)).
@@ -90,7 +90,7 @@ public class PlainSchemaTest extends AbstractTest {
         SecurityContextHolder.getContext().setAuthentication(auth);
     }
 
-    @AfterClass
+    @AfterAll
     public static void unsetAuthContext() {
         SecurityContextHolder.getContext().setAuthentication(null);
     }
@@ -106,7 +106,7 @@ public class PlainSchemaTest extends AbstractTest {
 
         try {
             plainSchemaDAO.flush();
-            fail();
+            fail("This should not happen");
         } catch (Exception e) {
             assertTrue(e instanceof EntityExistsException);
         }
@@ -116,15 +116,15 @@ public class PlainSchemaTest extends AbstractTest {
     public void deleteFullname() {
         // fullname is mapped as ConnObjectKey for ws-target-resource-2, need to swap it otherwise validation errors 
         // will be raised
-        for (MappingItem item : resourceDAO.find("ws-target-resource-2").
-                getProvision(anyTypeDAO.findUser()).get().getMapping().getItems()) {
-
-            if ("fullname".equals(item.getIntAttrName())) {
-                item.setConnObjectKey(false);
-            } else if ("surname".equals(item.getIntAttrName())) {
-                item.setConnObjectKey(true);
-            }
-        }
+        resourceDAO.find("ws-target-resource-2").
+                getProvision(anyTypeDAO.findUser()).get().getMapping().getItems().
+                forEach(item -> {
+                    if ("fullname".equals(item.getIntAttrName())) {
+                        item.setConnObjectKey(false);
+                    } else if ("surname".equals(item.getIntAttrName())) {
+                        item.setConnObjectKey(true);
+                    }
+                });
 
         // search for user schema fullname
         PlainSchema schema = plainSchemaDAO.find("fullname");

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RealmTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RealmTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RealmTest.java
index 141a2f6..971f9a2 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RealmTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RealmTest.java
@@ -18,9 +18,9 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.apache.syncope.core.persistence.api.dao.GroupDAO;
 import org.apache.syncope.core.persistence.api.dao.RealmDAO;
@@ -29,7 +29,7 @@ import org.apache.syncope.core.persistence.api.entity.Realm;
 import org.apache.syncope.core.persistence.api.entity.Role;
 import org.apache.syncope.core.persistence.api.entity.group.Group;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ReportTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ReportTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ReportTest.java
index 9c3919f..9680379 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ReportTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ReportTest.java
@@ -18,10 +18,11 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Date;
 import javax.persistence.EntityExistsException;
@@ -32,7 +33,7 @@ import org.apache.syncope.core.persistence.api.dao.ReportTemplateDAO;
 import org.apache.syncope.core.persistence.api.entity.Report;
 import org.apache.syncope.core.persistence.api.entity.ReportExec;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -58,20 +59,22 @@ public class ReportTest extends AbstractTest {
         assertEquals(1, report.getExecs().size());
     }
 
-    @Test(expected = EntityExistsException.class)
+    @Test
     public void saveWithExistingName() {
-        Report report = reportDAO.find("0062ea9c-924d-4ecf-9961-4492a8cc6d1b");
-        assertNotNull(report);
+        assertThrows(EntityExistsException.class, () -> {
+            Report report = reportDAO.find("0062ea9c-924d-4ecf-9961-4492a8cc6d1b");
+            assertNotNull(report);
 
-        String name = report.getName();
+            String name = report.getName();
 
-        report = entityFactory.newEntity(Report.class);
-        report.setName(name);
-        report.setActive(true);
-        report.setTemplate(reportTemplateDAO.find("sample"));
+            report = entityFactory.newEntity(Report.class);
+            report.setName(name);
+            report.setActive(true);
+            report.setTemplate(reportTemplateDAO.find("sample"));
 
-        reportDAO.save(report);
-        reportDAO.flush();
+            reportDAO.save(report);
+            reportDAO.flush();
+        });
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceHistoryConfTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceHistoryConfTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceHistoryConfTest.java
index 2bc36a6..d5cad6d 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceHistoryConfTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceHistoryConfTest.java
@@ -18,10 +18,10 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Date;
 import java.util.List;
@@ -31,7 +31,7 @@ import org.apache.syncope.core.persistence.api.dao.ExternalResourceHistoryConfDA
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResourceHistoryConf;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
index de6d911..46116ba 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
@@ -18,11 +18,11 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 import java.util.List;
@@ -51,7 +51,7 @@ import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.apache.syncope.core.persistence.jpa.entity.resource.JPAMappingItem;
 import org.apache.syncope.core.persistence.jpa.entity.resource.JPAOrgUnit;
 import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -89,7 +89,7 @@ public class ResourceTest extends AbstractTest {
         resource.setPasswordPolicy(policy);
 
         ConnInstance connector = connInstanceDAO.find("88a7a819-dab5-46b4-9b90-0b9769eabdb8");
-        assertNotNull("connector not found", connector);
+        assertNotNull(connector);
         resource.setConnector(connector);
 
         ExternalResource actual = resourceDAO.save(resource);
@@ -112,7 +112,7 @@ public class ResourceTest extends AbstractTest {
 
         // specify the connector
         ConnInstance connector = connInstanceDAO.find("88a7a819-dab5-46b4-9b90-0b9769eabdb8");
-        assertNotNull("connector not found", connector);
+        assertNotNull(connector);
 
         resource.setConnector(connector);
 
@@ -163,7 +163,7 @@ public class ResourceTest extends AbstractTest {
 
         // assign the new resource to an user
         User user = userDAO.findByUsername("rossini");
-        assertNotNull("user not found", user);
+        assertNotNull(user);
 
         user.add(actual);
 
@@ -197,7 +197,7 @@ public class ResourceTest extends AbstractTest {
     @Test
     public void delete() {
         ExternalResource resource = resourceDAO.find("resource-testdb");
-        assertNotNull("find to delete did not work", resource);
+        assertNotNull(resource);
 
         // -------------------------------------
         // Get originally associated connector
@@ -228,7 +228,7 @@ public class ResourceTest extends AbstractTest {
 
         // resource must be removed
         ExternalResource actual = resourceDAO.find("resource-testdb");
-        assertNull("delete did not work", actual);
+        assertNull(actual);
 
         // resource must be not referenced any more from users
         userKeys.stream().

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
index 6ba7906..899dd44 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
@@ -18,10 +18,10 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -43,7 +43,7 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.apache.syncope.core.persistence.jpa.dao.JPARoleDAO;
 import org.apache.syncope.core.persistence.jpa.entity.user.JPADynRoleMembership;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/SecurityQuestionTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/SecurityQuestionTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/SecurityQuestionTest.java
index 84a8a31..3d49e96 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/SecurityQuestionTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/SecurityQuestionTest.java
@@ -18,13 +18,13 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import org.apache.syncope.core.persistence.api.dao.SecurityQuestionDAO;
 import org.apache.syncope.core.persistence.api.dao.UserDAO;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
index fc47959..5d14e9d 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
@@ -18,11 +18,11 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 import java.util.Date;
@@ -50,7 +50,7 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
 import org.identityconnectors.framework.common.objects.Attribute;
 import org.identityconnectors.framework.common.objects.AttributeBuilder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.apache.syncope.core.persistence.api.entity.task.PullTask;

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
index 074488f..eddafed 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
@@ -18,12 +18,12 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Date;
 import java.util.List;
@@ -45,7 +45,7 @@ import org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue;
 import org.apache.syncope.core.persistence.api.entity.user.URelationship;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -172,7 +172,7 @@ public class UserTest extends AbstractTest {
 
         try {
             userDAO.save(user);
-            fail();
+            fail("This should not happen");
         } catch (InvalidEntityException e) {
             assertNotNull(e);
         }
@@ -235,18 +235,18 @@ public class UserTest extends AbstractTest {
 
         // add derived attributes to user
         User owner = userDAO.findByUsername("vivaldi");
-        assertNotNull("did not get expected user", owner);
+        assertNotNull(owner);
 
         String firstname = owner.getPlainAttr("firstname").get().getValuesAsStrings().iterator().next();
         assertNotNull(firstname);
 
         // search by ksuffix derived attribute
         List<User> list = userDAO.findByDerAttrValue("ksuffix", firstname + "k");
-        assertEquals("did not get expected number of users ", 1, list.size());
+        assertEquals(1, list.size());
 
         // search by kprefix derived attribute
         list = userDAO.findByDerAttrValue("kprefix", "k" + firstname);
-        assertEquals("did not get expected number of users ", 1, list.size());
+        assertEquals(1, list.size());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/VirSchemaTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/VirSchemaTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/VirSchemaTest.java
index 21d9c5a..7522f45 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/VirSchemaTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/VirSchemaTest.java
@@ -18,10 +18,10 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
@@ -30,7 +30,7 @@ import org.apache.syncope.core.persistence.api.entity.VirSchema;
 import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
 import org.apache.syncope.core.persistence.api.entity.resource.Provision;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -62,7 +62,7 @@ public class VirSchemaTest extends AbstractTest {
         virSchemaDAO.flush();
 
         virSchema = virSchemaDAO.find("vSchema");
-        assertNotNull("expected save to work", virSchema);
+        assertNotNull(virSchema);
         assertTrue(virSchema.isReadonly());
         assertEquals("EXT_ATTR", virSchema.getExtAttrName());
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/XMLContentExporterTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/XMLContentExporterTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/XMLContentExporterTest.java
index 9f085d4..a0aa326 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/XMLContentExporterTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/XMLContentExporterTest.java
@@ -18,8 +18,8 @@
  */
 package org.apache.syncope.core.persistence.jpa.outer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.nio.charset.Charset;
 import java.util.List;
@@ -29,7 +29,7 @@ import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.core.persistence.api.content.ContentExporter;
 import org.apache.syncope.core.persistence.jpa.AbstractTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/pom.xml
----------------------------------------------------------------------
diff --git a/core/provisioning-java/pom.xml b/core/provisioning-java/pom.xml
index a9e881e..f4510c4 100644
--- a/core/provisioning-java/pom.xml
+++ b/core/provisioning-java/pom.xml
@@ -114,8 +114,8 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/AbstractTest.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/AbstractTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/AbstractTest.java
index e26f238..c8147ee 100644
--- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/AbstractTest.java
+++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/AbstractTest.java
@@ -18,12 +18,9 @@
  */
 package org.apache.syncope.core.provisioning.java;
 
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
 
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {
+@SpringJUnitConfig(locations = {
     "classpath:persistenceTest.xml",
     "classpath:provisioningContext.xml",
     "classpath:workflowContext.xml",

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ConnectorManagerTest.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ConnectorManagerTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ConnectorManagerTest.java
index ebf1807..4908820 100644
--- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ConnectorManagerTest.java
+++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ConnectorManagerTest.java
@@ -18,14 +18,14 @@
  */
 package org.apache.syncope.core.provisioning.java;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
 import org.apache.syncope.core.provisioning.api.ConnIdBundleManager;
 import org.apache.syncope.core.provisioning.api.Connector;
 import org.apache.syncope.core.spring.ApplicationContextProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.util.ReflectionTestUtils;
 import org.springframework.transaction.annotation.Transactional;
@@ -41,7 +41,7 @@ public class ConnectorManagerTest extends AbstractTest {
     @Autowired
     private ExternalResourceDAO resourceDAO;
 
-    @Before
+    @BeforeEach
     public void before() {
         connManager = new ConnectorManager();
         ReflectionTestUtils.setField(connManager, "connIdBundleManager", connIdBundleManager);

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/DerAttrTest.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/DerAttrTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/DerAttrTest.java
index c796795..472794a 100644
--- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/DerAttrTest.java
+++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/DerAttrTest.java
@@ -18,17 +18,17 @@
  */
 package org.apache.syncope.core.provisioning.java;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.UserDAO;
 import org.apache.syncope.core.persistence.api.entity.DerSchema;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.DerAttrHandler;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -50,7 +50,7 @@ public class DerAttrTest extends AbstractTest {
         assertEquals("username + ' - ' + creationDate + '[' + failedLogins + ']'", info.getExpression());
 
         User user = userDAO.findByUsername("vivaldi");
-        assertNotNull("did not get expected user", user);
+        assertNotNull(user);
 
         String value = derAttrHandler.getValue(user, info);
         assertNotNull(value);

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/IntAttrNameParserTest.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/IntAttrNameParserTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/IntAttrNameParserTest.java
index c603f8a..f84d816 100644
--- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/IntAttrNameParserTest.java
+++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/IntAttrNameParserTest.java
@@ -18,15 +18,15 @@
  */
 package org.apache.syncope.core.provisioning.java;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.SchemaType;
 import org.apache.syncope.core.provisioning.api.IntAttrName;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -153,7 +153,7 @@ public class IntAttrNameParserTest extends AbstractTest {
     public void invalid() {
         try {
             intAttrNameParser.parse("memberships.cn", AnyTypeKind.USER);
-            fail();
+            fail("This should not happen");
         } catch (IllegalArgumentException e) {
             assertNotNull(e);
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MailTemplateTest.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MailTemplateTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MailTemplateTest.java
index 8e3fa9b..ea1f551 100644
--- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MailTemplateTest.java
+++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MailTemplateTest.java
@@ -18,9 +18,9 @@
  */
 package org.apache.syncope.core.provisioning.java;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -37,7 +37,7 @@ import org.apache.syncope.common.lib.to.MembershipTO;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.core.provisioning.java.jexl.JexlUtils;
 import org.apache.syncope.core.persistence.api.dao.MailTemplateDAO;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MappingTest.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MappingTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MappingTest.java
index 8e6887a..ea47539 100644
--- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MappingTest.java
+++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/MappingTest.java
@@ -18,8 +18,8 @@
  */
 package org.apache.syncope.core.provisioning.java;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import org.apache.commons.jexl3.JexlContext;
 import org.apache.commons.jexl3.MapContext;
@@ -34,7 +34,7 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.java.jexl.JexlUtils;
 import org.apache.syncope.core.provisioning.java.utils.MappingUtils;
 import org.identityconnectors.framework.common.objects.Name;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java
index af4247c..3677094 100644
--- a/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java
+++ b/core/provisioning-java/src/test/java/org/apache/syncope/core/provisioning/java/ResourceDataBinderTest.java
@@ -18,8 +18,8 @@
  */
 package org.apache.syncope.core.provisioning.java;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.HashSet;
 import java.util.List;
@@ -43,9 +43,9 @@ import org.apache.syncope.core.provisioning.api.data.ResourceDataBinder;
 import org.apache.syncope.core.spring.security.SyncopeAuthenticationDetails;
 import org.apache.syncope.core.spring.security.SyncopeGrantedAuthority;
 import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.GrantedAuthority;
@@ -67,7 +67,7 @@ public class ResourceDataBinderTest extends AbstractTest {
     @Autowired
     private PlainSchemaDAO plainSchemaDAO;
 
-    @BeforeClass
+    @BeforeAll
     public static void setAuthContext() {
         List<GrantedAuthority> authorities = StandardEntitlement.values().stream().
                 map(entitlement -> new SyncopeGrantedAuthority(entitlement, SyncopeConstants.ROOT_REALM)).
@@ -80,7 +80,7 @@ public class ResourceDataBinderTest extends AbstractTest {
         SecurityContextHolder.getContext().setAuthentication(auth);
     }
 
-    @AfterClass
+    @AfterAll
     public static void unsetAuthContext() {
         SecurityContextHolder.getContext().setAuthentication(null);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/spring/pom.xml
----------------------------------------------------------------------
diff --git a/core/spring/pom.xml b/core/spring/pom.xml
index 2b25538..addb5d3 100644
--- a/core/spring/pom.xml
+++ b/core/spring/pom.xml
@@ -91,8 +91,8 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>
@@ -109,14 +109,14 @@ under the License.
         <directory>src/main/resources</directory>
         <filtering>true</filtering>
         <includes>
-            <include>**/security.properties</include>
+          <include>**/security.properties</include>
         </includes>
       </resource>
       <resource>
         <directory>src/main/resources</directory>
         <filtering>false</filtering>
         <excludes>
-            <exclude>**/security.properties</exclude>
+          <exclude>**/security.properties</exclude>
         </excludes>
       </resource>
     </resources>

http://git-wip-us.apache.org/repos/asf/syncope/blob/45ad6f55/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
----------------------------------------------------------------------
diff --git a/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java b/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
index cc0c2d6..0d1b801 100644
--- a/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
+++ b/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
@@ -20,13 +20,13 @@ package org.apache.syncope.core.spring.security;
 
 import org.apache.syncope.core.spring.security.Encryptor;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.apache.syncope.common.lib.types.CipherAlgorithm;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test class to test all encryption algorithms.


Mime
View raw message