mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 09:12:14 +00:00
Expanded unit test coverage.
This commit is contained in:
parent
6a2870d8f0
commit
bc847f564f
@ -19,7 +19,7 @@ import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Tests {@link GrantedAuthorityImpl}
|
||||
* Tests {@link GrantedAuthorityImpl}.
|
||||
*
|
||||
* @author Ben Alex
|
||||
* @version $Id$
|
||||
@ -45,6 +45,15 @@ public class GrantedAuthorityImplTests extends TestCase {
|
||||
junit.textui.TestRunner.run(GrantedAuthorityImplTests.class);
|
||||
}
|
||||
|
||||
public void testNoArgsConstructor() {
|
||||
try {
|
||||
new GrantedAuthorityImpl();
|
||||
fail("Should have thrown IllegalArgumentException");
|
||||
} catch (IllegalArgumentException expected) {
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void testObjectEquals() throws Exception {
|
||||
GrantedAuthorityImpl auth1 = new GrantedAuthorityImpl("TEST");
|
||||
GrantedAuthorityImpl auth2 = new GrantedAuthorityImpl("TEST");
|
||||
@ -70,6 +79,11 @@ public class GrantedAuthorityImplTests extends TestCase {
|
||||
assertTrue(!auth1.equals(int1));
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
GrantedAuthorityImpl auth = new GrantedAuthorityImpl("TEST");
|
||||
assertEquals("TEST", auth.toString());
|
||||
}
|
||||
|
||||
//~ Inner Classes ==========================================================
|
||||
|
||||
private class MockGrantedAuthorityImpl implements GrantedAuthority {
|
||||
|
Loading…
x
Reference in New Issue
Block a user