GuestOsJdbcDao extends JdbcDaoSupport { public Long getGuestOsUuid(String guestOsName) { return getJdbcTemplate().queryForObject(sqlGetGuestOsId, Long.class, guestOsName); }  Long getGuestOsUuid(String guestOsName);  }
@Test public void getGuestOsUuidTest() { JdbcTemplate jdbcTemplate = Mockito.mock(JdbcTemplate.class); spy.setJdbcTemplate(jdbcTemplate); Mockito.doReturn(321l).when(jdbcTemplate).queryForObject(Mockito.eq(sqlGetGuestOsId), Mockito.eq(Long.class), Mockito.eq("guesOsName")); long result = spy.getGuestOsUuid("guesOsName"); Mockito.verify(jdbcTemplate).queryForObject(Mockito.eq(sqlGetGuestOsId), Mockito.eq(Long.class), Mockito.eq("guesOsName")); Assert.assertEquals(321l, result); }