diff --git a/pom.xml b/pom.xml index 9f36830fb6492d6ec14948d2b30bdc57c28c8baf..a4dd1dec24f6ba18ec4d613109bc7076bc00b58b 100644 --- a/pom.xml +++ b/pom.xml @@ -2222,7 +2222,7 @@ <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> - <version>${jackson.version}</version> + <version>${jackson.version}.1</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> diff --git a/src/test/java/org/olat/basesecurity/GetIdentitiesByPowerSearchTest.java b/src/test/java/org/olat/basesecurity/GetIdentitiesByPowerSearchTest.java index 4cda8b7182a980a1fb2afe215ce114f02e0e332e..6081edf2f0a978734d8651841dd6b723267aa591 100644 --- a/src/test/java/org/olat/basesecurity/GetIdentitiesByPowerSearchTest.java +++ b/src/test/java/org/olat/basesecurity/GetIdentitiesByPowerSearchTest.java @@ -82,17 +82,21 @@ public class GetIdentitiesByPowerSearchTest extends OlatTestCase { // basic query to find all system users without restrictions List<Identity> results = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, null, null); - assertTrue(results.size()>0); + Assert.assertFalse(results.isEmpty()); int numberOfAllUsers = results.size(); results = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, null,Identity.STATUS_ACTIV); - assertTrue(results.size()>0); + Assert.assertFalse(results.isEmpty()); int numberOfActiveUsers = results.size(); results = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, null, Identity.STATUS_DELETED); - assertTrue(results.size() >0); + Assert.assertFalse(results.isEmpty()); int numberOfDeletedUsers = results.size(); - assertEquals("Number of all users != activeUsers + deletedUsers" , numberOfAllUsers, numberOfActiveUsers + numberOfDeletedUsers); + + results = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, null,Identity.STATUS_LOGIN_DENIED); + Assert.assertNotNull(results); + int numberOfDeniedUsers = results.size(); + assertEquals("Number of all users != activeUsers + deletedUsers + loginDeniedUsers" , numberOfAllUsers, numberOfActiveUsers + numberOfDeletedUsers + numberOfDeniedUsers); // user attributes search test dbInstance.commitAndCloseSession(); @@ -603,6 +607,12 @@ public class GetIdentitiesByPowerSearchTest extends OlatTestCase { Assert.assertEquals(Identity.STATUS_DELETED, deletedIdentity.getStatus()); } int numberOfDeletedUsers = deletedIdentities.size(); + + List<Identity> deniedIdentities = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, null, Identity.STATUS_LOGIN_DENIED); + for(Identity deniedIdentity:deniedIdentities) { + Assert.assertEquals(Identity.STATUS_LOGIN_DENIED, deniedIdentity.getStatus()); + } + int numberOfDeniedUsers = deniedIdentities.size(); Date createdAfter = before; Date createdBefore = after; @@ -610,17 +620,17 @@ public class GetIdentitiesByPowerSearchTest extends OlatTestCase { assertEquals("Search with date (createdAfter,createdBefore) delivers not the same number of users", numberOfAllUsers, results.size()); results = baseSecurityManager.getVisibleIdentitiesByPowerSearch(null, null, true, null, null, before, after); - assertEquals("Search (visible identities) with date (createdAfter,createdBefore) delivers not the same number of users", (numberOfAllUsers - numberOfDeletedUsers) , results.size()); // One identity is deleted + assertEquals("Search (visible identities) with date (createdAfter,createdBefore) delivers not the same number of users", (numberOfAllUsers - numberOfDeletedUsers - numberOfDeniedUsers) , results.size()); // One identity is deleted results = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, null, after, null, null, null); assertEquals("Search with date (only after) delivers not the same number of users", numberOfAllUsers, results.size()); results = baseSecurityManager.getVisibleIdentitiesByPowerSearch(null, null, true, null, null, null, after); - assertEquals("Search (visible identities) with date (createdAfter,createdBefore) delivers not the same number of users", (numberOfAllUsers - numberOfDeletedUsers) , results.size()); // One identity is deleted + assertEquals("Search (visible identities) with date (createdAfter,createdBefore) delivers not the same number of users", (numberOfAllUsers - numberOfDeletedUsers - numberOfDeniedUsers) , results.size()); // One identity is deleted results = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, before, null, null, null, null); assertEquals("Search with date (only before) delivers not the same number of users", numberOfAllUsers, results.size()); results = baseSecurityManager.getVisibleIdentitiesByPowerSearch(null, null, true, null, null, before, null); - assertEquals("Search (visible identities) with date (createdAfter,createdBefore) delivers not the same number of users", (numberOfAllUsers - numberOfDeletedUsers) , results.size()); // One identity is deleted + assertEquals("Search (visible identities) with date (createdAfter,createdBefore) delivers not the same number of users", (numberOfAllUsers - numberOfDeletedUsers - numberOfDeniedUsers) , results.size()); // One identity is deleted results = baseSecurityManager.getIdentitiesByPowerSearch(null, null, true, null, null, after, before, null, null, null); assertTrue(results.size() == 0);