In my database I have the username = user@javachap.com and password = javachap
If I run the code below, it passes the test although the username and password does not exist in my database.
@Test
public void testLogin()
{
String username="abc";
String password="123";
boolean valueFound=false;
// Check the db
try
{
pstmt=conn.prepareCall("select * from user where USR_EMAIL=? and USD_PASSWORD=?");
pstmt.setString(1,username);
pstmt.setString(2,password);
rs=pstmt.executeQuery();
valueFound = rs.next();
}
catch(Exception e)
{
// report some error
}