@Test
public void testCheckForHostsWithoutState() throws Exception {

  EasyMockSupport easyMockSupport = new EasyMockSupport();
  final DBAccessor mockDBDbAccessor = easyMockSupport.createNiceMock(DBAccessor.class);
  final Connection mockConnection = easyMockSupport.createNiceMock(Connection.class);
  final ResultSet mockResultSet = easyMockSupport.createNiceMock(ResultSet.class);
  final Statement mockStatement = easyMockSupport.createNiceMock(Statement.class);
  final StackManagerFactory mockStackManagerFactory = easyMockSupport.createNiceMock(StackManagerFactory.class);
  final EntityManager mockEntityManager = easyMockSupport.createNiceMock(EntityManager.class);
  final Clusters mockClusters = easyMockSupport.createNiceMock(Clusters.class);
  final OsFamily mockOSFamily = easyMockSupport.createNiceMock(OsFamily.class);
  final Injector mockInjector = Guice.createInjector(new AbstractModule() {
    @Override
    protected void configure() {
      bind(StackManagerFactory.class).toInstance(mockStackManagerFactory);
      bind(EntityManager.class).toInstance(mockEntityManager);
      bind(DBAccessor.class).toInstance(mockDBDbAccessor);
      bind(Clusters.class).toInstance(mockClusters);
      bind(OsFamily.class).toInstance(mockOSFamily);
    }
  });
  expect(mockConnection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE)).andReturn(mockStatement);
  expect(mockStatement.executeQuery("select host_name from hosts where host_id not in (select host_id from hoststate)")).andReturn(mockResultSet);
  DatabaseConsistencyCheckHelper.setInjector(mockInjector);
  DatabaseConsistencyCheckHelper.setConnection(mockConnection);
  easyMockSupport.replayAll();
  DatabaseConsistencyCheckHelper.checkForHostsWithoutState();
  easyMockSupport.verifyAll();
}