SEC-417: Fix. Remove hard-coded messages from JdbcDaoImpl to allow internationalized versions for "user not found" etc.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user