entityMgr.findByName(CLUSTER_NAME, NODE_GROUP_NAME, NODE_1_NAME))
.thenReturn(node);
service.setClusterEntityMgr(entityMgr);
// mock cluster config manager
ClusterConfigManager configMgr = Mockito.mock(ClusterConfigManager.class);
// mock getClusterConfig
NodeGroupCreate nodeGroup = new NodeGroupCreate();
nodeGroup.setName(NODE_GROUP_NAME);
nodeGroup.setStorage(new StorageRead());
NodeGroupCreate[] nodeGroups = new NodeGroupCreate[] { nodeGroup };
ClusterCreate spec = new ClusterCreate();
spec.setName(CLUSTER_NAME);
spec.setNodeGroups(nodeGroups);
Set<String> patterns = new HashSet<String>();
patterns.add(LOCAL_STORE_PATTERN);
spec.setLocalDatastorePattern(patterns);
Mockito.when(configMgr.getClusterConfig(CLUSTER_NAME)).thenReturn(spec);
service.setConfigMgr(configMgr);
}