I'm testing two prepared statement as you will see below and I want it to show that they are the same using the assertEquals but its throwing me an error that the result and expectedResult are not equal.
public PreparedStatement setSQL(String sql) throws SQLException {
try {
pst = connection.prepareStatement(sql);
} catch (SQLException e) {
e.printStackTrace();
}
return pst;
}
public void testSetSQL() throws SQLException {
String sql = "SELECT * FROM student INNER JOIN member ON student.ssn=member.ssn WHERE ssn = ?";
result = dbconn.setSQL(sql);
// expsql = ;
expectresult = connection.prepareStatement("SELECT * FROM student INNER JOIN member ON student.ssn=member.ssn WHERE ssn = ?");
assertSame(expectresult, result);