HostJdbcDao extends JdbcDaoSupport { public ResourceState getResourceState(long hostId) { return ResourceState.valueOf(getJdbcTemplate().queryForObject(sqlGetResourceState, String.class, hostId)); }  HostAdministrationStatus getAdministrationStatus(long hostId); void setAdministrationStatus(HostAdministrationStatus hostAdministrationStatus, long hostId); StartType getStartType(long hostId); Status getStatus(long hostId); ResourceState getResourceState(long hostId); List<HypervisorType> getAllHypervisorsTypeInCloud(); boolean isThereAnyHostOnCloudDeactivatedByOurManager(); boolean isThereAnyHostOnPodDeactivatedByOurManager(long id);  }
@Test public void getResourceStateTest() { Mockito.doReturn("Enabled").when(jdbcTemplate).queryForObject(Mockito.eq(sqlGetResourceState), Mockito.eq(String.class), Mockito.eq(0l)); ResourceState result = spy.getResourceState(0l); Mockito.verify(jdbcTemplate).queryForObject(Mockito.eq(sqlGetResourceState), Mockito.eq(String.class), Mockito.eq(0l)); Assert.assertEquals(ResourceState.Enabled, result); }