}
@Test
public void testProcessDecommissionedDatanodes() throws Exception {
ClusterEntity clusterEntity = createCluster();
ClusterServiceEntity clusterServiceEntity = createService(clusterEntity);
HostEntity hostEntity = createHost(clusterEntity);
ServiceComponentDesiredStateEntity componentDesiredStateEntity =
new ServiceComponentDesiredStateEntity();
componentDesiredStateEntity.setClusterId(clusterEntity.getClusterId());
componentDesiredStateEntity.setServiceName(clusterServiceEntity.getServiceName());
componentDesiredStateEntity.setClusterServiceEntity(clusterServiceEntity);
componentDesiredStateEntity.setComponentName("DATANODE");
//componentDesiredStateDAO.create(componentDesiredStateEntity);
HostComponentDesiredStateDAO hostComponentDesiredStateDAO =
injector.getInstance(HostComponentDesiredStateDAO.class);
HostComponentDesiredStateEntity hostComponentDesiredStateEntity =
new HostComponentDesiredStateEntity();
hostComponentDesiredStateEntity.setClusterId(clusterEntity.getClusterId());
hostComponentDesiredStateEntity.setComponentName("DATANODE");
hostComponentDesiredStateEntity.setAdminState(HostComponentAdminState.INSERVICE);
hostComponentDesiredStateEntity.setServiceName(clusterServiceEntity.getServiceName());
hostComponentDesiredStateEntity.setServiceComponentDesiredStateEntity(componentDesiredStateEntity);
hostComponentDesiredStateEntity.setHostEntity(hostEntity);
hostComponentDesiredStateEntity.setHostName(hostEntity.getHostName());
hostComponentDesiredStateDAO.create(hostComponentDesiredStateEntity);