public void testRunScriptByRole() throws Exception {
ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
ClusterController controller = mock(ClusterController.class);
when(factory.create((String)any())).thenReturn(controller);
ClusterStateStore memStore = new MemoryClusterStateStore();
memStore.save(createTestCluster(
new String[]{"reg/A", "reg/B"}, new String[]{"A", "B"}));
ClusterStateStoreFactory stateStoreFactory = mock(ClusterStateStoreFactory.class);
when(stateStoreFactory.create((ClusterSpec) any())).thenReturn(memStore);