when mocking a jdbc query, the statement below was encountering an exception

 doReturn("result").when(jdbc).queryForObject(anyString(), String.class); 

turns out this was due to mockito, not allowing mix of matcher and raw argument

change above to

 doReturn("result").when(jdbc).queryForObject(anyString(), eq(String.class)); 

worked.