From 7c8d917ecac559995a745b4209aa4e7385b79fd1 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 4 Dec 2013 12:37:19 +0000 Subject: [PATCH] use last fest-assert version git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1547789 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 4 +-- redback-common/redback-common-ldap/pom.xml | 2 +- .../common/ldap/role/TestLdapRoleMapper.java | 2 +- .../redback-rest-services/pom.xml | 2 +- .../services/LdapGroupMappingServiceTest.java | 26 +++++++------------ .../rest/services/UserServiceTest.java | 8 +++--- redback-rbac/redback-rbac-tests/pom.xml | 2 +- .../tests/AbstractRbacManagerTestCase.java | 2 +- 8 files changed, 21 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index 84eb0056..07b1e272 100644 --- a/pom.xml +++ b/pom.xml @@ -663,8 +663,8 @@ org.easytesting - fest-assert - 1.4 + fest-assert-core + 2.0M9 diff --git a/redback-common/redback-common-ldap/pom.xml b/redback-common/redback-common-ldap/pom.xml index 5c31d50f..248e38ee 100644 --- a/redback-common/redback-common-ldap/pom.xml +++ b/redback-common/redback-common-ldap/pom.xml @@ -64,7 +64,7 @@ org.easytesting - fest-assert + fest-assert-core test diff --git a/redback-common/redback-common-ldap/src/test/java/org/apache/archiva/redback/common/ldap/role/TestLdapRoleMapper.java b/redback-common/redback-common-ldap/src/test/java/org/apache/archiva/redback/common/ldap/role/TestLdapRoleMapper.java index 7838373d..226406ab 100644 --- a/redback-common/redback-common-ldap/src/test/java/org/apache/archiva/redback/common/ldap/role/TestLdapRoleMapper.java +++ b/redback-common/redback-common-ldap/src/test/java/org/apache/archiva/redback/common/ldap/role/TestLdapRoleMapper.java @@ -25,7 +25,7 @@ import org.apache.archiva.redback.common.ldap.connection.LdapConnectionFactory; import org.apache.archiva.redback.components.apacheds.ApacheDs; import org.apache.archiva.redback.policy.PasswordEncoder; import org.apache.archiva.redback.policy.encoders.SHA1PasswordEncoder; -import org.fest.assertions.Assertions; +import org.fest.assertions.api.Assertions; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/redback-integrations/redback-rest/redback-rest-services/pom.xml b/redback-integrations/redback-rest/redback-rest-services/pom.xml index d38c4d45..378ae62f 100644 --- a/redback-integrations/redback-rest/redback-rest-services/pom.xml +++ b/redback-integrations/redback-rest/redback-rest-services/pom.xml @@ -188,7 +188,7 @@ org.easytesting - fest-assert + fest-assert-core test diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/LdapGroupMappingServiceTest.java b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/LdapGroupMappingServiceTest.java index 4a85b41d..8590cd1d 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/LdapGroupMappingServiceTest.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/LdapGroupMappingServiceTest.java @@ -23,8 +23,8 @@ import org.apache.archiva.redback.rest.api.model.LdapGroupMapping; import org.apache.archiva.redback.rest.api.services.LdapGroupMappingService; import org.apache.archiva.redback.rest.api.services.RedbackServiceException; import org.apache.commons.lang.StringUtils; -import org.fest.assertions.Assertions; -import org.fest.assertions.Condition; +import org.fest.assertions.api.Assertions; +import org.fest.assertions.core.Condition; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.annotation.DirtiesContext; @@ -167,7 +167,7 @@ public class LdapGroupMappingServiceTest List allGroups = service.getLdapGroups().getStrings(); - Assertions.assertThat( allGroups ).isNotNull().isNotEmpty().hasSize( 3 ).contains( groups.toArray() ); + Assertions.assertThat( allGroups ).isNotNull().isNotEmpty().hasSize( 3 ).containsAll( groups ); } catch ( Exception e ) { @@ -213,16 +213,11 @@ public class LdapGroupMappingServiceTest mappings = service.getLdapGroupMappings(); - Assertions.assertThat( mappings ).isNotNull().isNotEmpty().hasSize( 4 ).satisfies( new Condition>() - { - @Override - public boolean matches( List objects ) + Assertions.assertThat( mappings ).isNotNull().isNotEmpty().hasSize( 4 ).are( + new Condition() { - boolean res = false; - - List mappingList = (List) objects; - - for ( LdapGroupMapping mapping : mappingList ) + @Override + public boolean matches( LdapGroupMapping mapping ) { if ( StringUtils.equals( "ldap group", mapping.getGroup() ) ) { @@ -230,11 +225,10 @@ public class LdapGroupMappingServiceTest "redback role" ); return true; } - } - return res; - } - } ); + return true; + } + } ); service.removeLdapGroupMapping( "ldap group" ); diff --git a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/UserServiceTest.java b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/UserServiceTest.java index 6dc93799..f080710f 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/UserServiceTest.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/test/java/org/apache/archiva/redback/rest/services/UserServiceTest.java @@ -31,6 +31,7 @@ import org.apache.archiva.redback.rest.services.mock.ServicesAssert; import org.apache.cxf.jaxrs.client.JAXRSClientFactory; import org.apache.cxf.jaxrs.client.ServerWebApplicationException; import org.apache.cxf.jaxrs.client.WebClient; +import org.fest.assertions.api.Assertions; import org.junit.Test; import javax.ws.rs.core.MediaType; @@ -38,7 +39,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import static org.fest.assertions.Assertions.assertThat; /** * @author Olivier Lamy @@ -152,7 +152,7 @@ public class UserServiceTest log.info( "messageContent: {}", messageContent ); - assertThat( messageContent ).contains( "Use the following URL to validate your account." ).contains( + Assertions.assertThat( messageContent ).contains( "Use the following URL to validate your account." ).contains( "http://wine.fr/bordeaux" ).containsIgnoringCase( "toto" ); assertTrue( service.validateUserFromKey( key ) ); @@ -211,7 +211,7 @@ public class UserServiceTest log.info( "messageContent: {}", messageContent ); - assertThat( messageContent ).contains( "Use the following URL to validate your account." ).contains( + Assertions.assertThat( messageContent ).contains( "Use the following URL to validate your account." ).contains( "http://localhost:" + port ).containsIgnoringCase( "toto" ); assertTrue( service.validateUserFromKey( key ) ); @@ -292,7 +292,7 @@ public class UserServiceTest String messageContent = emailMessages.get( 1 ).getText(); - assertThat( messageContent ).contains( "Password Reset" ).contains( "Username: toto" ).contains( + Assertions.assertThat( messageContent ).contains( "Password Reset" ).contains( "Username: toto" ).contains( "http://foo.fr/bar" ); diff --git a/redback-rbac/redback-rbac-tests/pom.xml b/redback-rbac/redback-rbac-tests/pom.xml index ba53007e..668a368b 100644 --- a/redback-rbac/redback-rbac-tests/pom.xml +++ b/redback-rbac/redback-rbac-tests/pom.xml @@ -49,7 +49,7 @@ org.easytesting - fest-assert + fest-assert-core diff --git a/redback-rbac/redback-rbac-tests/src/main/java/org/apache/archiva/redback/tests/AbstractRbacManagerTestCase.java b/redback-rbac/redback-rbac-tests/src/main/java/org/apache/archiva/redback/tests/AbstractRbacManagerTestCase.java index 9d5162db..3e265fe5 100644 --- a/redback-rbac/redback-rbac-tests/src/main/java/org/apache/archiva/redback/tests/AbstractRbacManagerTestCase.java +++ b/redback-rbac/redback-rbac-tests/src/main/java/org/apache/archiva/redback/tests/AbstractRbacManagerTestCase.java @@ -16,7 +16,6 @@ package org.apache.archiva.redback.tests; * limitations under the License. */ -import org.fest.assertions.Assertions; import junit.framework.TestCase; import org.apache.archiva.redback.rbac.Operation; import org.apache.archiva.redback.rbac.RBACManager; @@ -27,6 +26,7 @@ import org.apache.archiva.redback.rbac.UserAssignment; import org.apache.archiva.redback.rbac.Permission; import org.apache.archiva.redback.rbac.RbacPermanentException; import org.apache.archiva.redback.tests.utils.RBACDefaults; +import org.fest.assertions.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger;