I want to write a test method for a service method. In this service method we are calling a query that fetch the data from database and that value is used in the function to do some processing. I want to stub only this db call. here is my function
public arraylist retrieveSomthing(JdbcTemplate){
//some processing is happening
List<Map<String,Object>> result = JdbcTemplate.queryForList("QueryName");
//some processing is happening for the result return from the query.
}
I want to write the test for the above function but I want to stub only the Jdbc.queryforList statement.
Please help me How to go stub the statement.
Thanks in Advance.