The simple test case below is failing with an exception.
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Invalid use of argument matchers! 3 m
Mockito requires you to either use only raw values or only matchers when stubbing a method call. The full exception (not posted by you here) surely explains everything.
Simple change the line:
when(jdbcTemplate.queryForObject(anyString(), any(SqlParameterSource.class), String.class
)).thenReturn("Test");
to
when(jdbcTemplate.queryForObject(anyString(), any(SqlParameterSource.class), eq(String.class)
)).thenReturn("Test");
and it should work.