ServiceComponentHost serviceCheckNodeHost = serviceCheckNode.addServiceComponentHost(h2);
serviceCheckNodeHost.persist();
serviceCheckNodeHost.setState(State.UNKNOWN);
HostComponentStateEntityPK hkspk = new HostComponentStateEntityPK();
HostComponentDesiredStateEntityPK hkdspk = new HostComponentDesiredStateEntityPK();
hkspk.setClusterId(nameNodeHost.getClusterId());
hkspk.setHostName(nameNodeHost.getHostName());
hkspk.setServiceName(nameNodeHost.getServiceName());
hkspk.setComponentName(nameNodeHost.getServiceComponentName());
hkdspk.setClusterId(nameNodeHost.getClusterId());
hkdspk.setHostName(nameNodeHost.getHostName());
hkdspk.setServiceName(nameNodeHost.getServiceName());
hkdspk.setComponentName(nameNodeHost.getServiceComponentName());
Assert.assertNotNull(injector.getInstance(HostComponentStateDAO.class).findByPK(hkspk));
Assert.assertNotNull(injector.getInstance(HostComponentDesiredStateDAO.class).findByPK(hkdspk));
Assert.assertEquals(2, injector.getProvider(EntityManager.class).get().createQuery("SELECT config FROM ClusterConfigEntity config").getResultList().size());
Assert.assertEquals(1, injector.getProvider(EntityManager.class).get().createQuery("SELECT state FROM ClusterStateEntity state").getResultList().size());