SEC-417: Fix. Remove hard-coded messages from JdbcDaoImpl to allow internationalized versions for "user not found" etc.

This commit is contained in:
Luke Taylor
2007-09-16 22:20:08 +00:00
parent 8a35f7da75
commit c7354c125a
4 changed files with 13 additions and 12 deletions

View File

@@ -40,7 +40,6 @@ public class JdbcDaoTests extends TestCase {
//~ Constructors ===================================================================================================
public JdbcDaoTests() {
super();
}
public JdbcDaoTests(String arg0) {
@@ -49,10 +48,6 @@ public class JdbcDaoTests extends TestCase {
//~ Methods ========================================================================================================
public static void main(String[] args) {
junit.textui.TestRunner.run(JdbcDaoTests.class);
}
private JdbcDaoImpl makePopulatedJdbcDao() throws Exception {
JdbcDaoImpl dao = new JdbcDaoImpl();
dao.setDataSource(PopulatedDatabase.getDataSource());
@@ -71,10 +66,6 @@ public class JdbcDaoTests extends TestCase {
return dao;
}
public final void setUp() throws Exception {
super.setUp();
}
public void testCheckDaoAccessUserSuccess() throws Exception {
JdbcDaoImpl dao = makePopulatedJdbcDao();
UserDetails user = dao.loadUserByUsername("marissa");
@@ -121,7 +112,7 @@ public class JdbcDaoTests extends TestCase {
dao.loadUserByUsername("cooper");
fail("Should have thrown UsernameNotFoundException");
} catch (UsernameNotFoundException expected) {
assertEquals("User has no GrantedAuthority", expected.getMessage());
assertEquals("User cooper has no GrantedAuthority", expected.getMessage());
}
}