hostStateEntity2.setCurrentState(HostState.HEALTHY);
hostStateEntity2.setHostEntity(host2);
host1.setHostStateEntity(hostStateEntity1);
host2.setHostStateEntity(hostStateEntity2);
ClusterServiceEntity clusterServiceEntity = new ClusterServiceEntity();
clusterServiceEntity.setServiceName("HDFS");
clusterServiceEntity.setClusterEntity(clusterEntity);
clusterServiceEntity.setServiceComponentDesiredStateEntities(
Collections.EMPTY_LIST);
clusterServiceEntity.setServiceConfigMappings(Collections.EMPTY_LIST);
ServiceDesiredStateEntity stateEntity = mock(ServiceDesiredStateEntity.class);
Gson gson = new Gson();
when(stateEntity.getDesiredStackVersion()).thenReturn(gson.toJson(new StackId("HDP-0.1"),
StackId.class));
clusterServiceEntity.setServiceDesiredStateEntity(stateEntity);
List<ClusterServiceEntity> clusterServiceEntities = new ArrayList<ClusterServiceEntity>();
clusterServiceEntities.add(clusterServiceEntity);
clusterEntity.setClusterServiceEntities(clusterServiceEntities);
return clusterEntity;
}