ClusterJdbcDao extends JdbcDaoSupport { public Date getClusterLastAdminstration(long clusterId) { return getJdbcTemplate().queryForObject(sqlGetClusterLastAdministration, Date.class, clusterId); }  ClusterAdministrationStatus getClusterAdministrationStatus(long clusterId); void setClusterAdministrationStatus(ClusterAdministrationStatus clusterConsolidationStatus, long clusterId); Date getClusterLastAdminstration(long clusterId); void setClusterLastAdministration(Date date, long clusterId);  }
@Test public void getClusterLastAdminstrationTest() { Date expectedDate = new Date(); Mockito.doReturn(expectedDate).when(jdbcTemplate).queryForObject(Mockito.eq(sqlGetClusterLastAdministration), Mockito.eq(Date.class), Mockito.eq(0l)); Date result = spy.getClusterLastAdminstration(0l); Mockito.verify(jdbcTemplate).queryForObject(Mockito.eq(sqlGetClusterLastAdministration), Mockito.eq(Date.class), Mockito.eq(0l)); Assert.assertEquals(expectedDate, result); }