I am trying to make a unit test on a method from a DAO class. Dao class is using JDBC. I am trying to unit test it but without using test data base. I must test it using some data structure for storing all the information.
public class UserProfilesDao extends JdbcDaoSupport {
@Autowired
private MessageSourceAccessor msa;
public long getUserServiceId(long userId, int serviceId) {
String sql = msa.getMessage("sql.select.service_user_id");
Object[] params = new Object[] { userId, serviceId };
int[] types = new int[] { Types.INTEGER, Types.INTEGER };
return getJdbcTemplate().queryForLong(sql, params, types);
}
}