From 0b09f58b1884cde21a48b0627791cf55558bd31e Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 16 Jan 2013 15:16:43 +0000 Subject: [PATCH] add unit test for hasRole git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1433978 13f79535-47bb-0310-9956-ffa450edef68 --- .../common/ldap/role/TestLdapRoleMapper.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 8dbe61811..74feca9aa 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 @@ -362,4 +362,19 @@ public class TestLdapRoleMapper } + @Test + public void hasRoleFound() + throws Exception + { + assertTrue( ldapRoleMapper.hasRole( getDirContext(), "Internal Repo Observer" ) ); + } + + @Test + public void hasRoleNotFound() + throws Exception + { + assertFalse( ldapRoleMapper.hasRole( getDirContext(), "Australian wine is good but not as French! " ) ); + } + + } -- 2.39.5