Here is what I have so far:
def "If there are results then return true otherwise return false"() {
given:
ResultSet resultSet = Mock()
expect:
resultSet.next()
}
I am trying to test a boolean method checkIfRowExists(int id, int foreignKey)
in class CheckActuateProjectSetServiceImpl
. It returns true if row exists and false otherwise.
How would I go about solving this?
public boolean checkIfRowExists(int id, int foreignKey){
Resultset resultSet = checkIfRowExistsResultSet(id, foreignKey)
return false;
}
The above method doesn't have the correct implementation as of yet because I'm trying to write the test first before I implement the solution.
Thanks