@Test public void getClusterWithInvalidId() { String clusterId = "invalid-id"; expectedEx.expect(EntityNotFoundException.class); expectedEx.expectMessage("Cluster with the specified ID not found: ID = " + clusterId); clusterService.getCluster(clusterId); }
public Cluster getCluster(String clusterId) { Cluster cluster = clusters.get(clusterId); if (cluster == null) { throw new EntityNotFoundException( "Cluster with the specified ID not found: ID = " + clusterId); } return cluster; }
ClusterService { public Cluster getCluster(String clusterId) { Cluster cluster = clusters.get(clusterId); if (cluster == null) { throw new EntityNotFoundException( "Cluster with the specified ID not found: ID = " + clusterId); } return cluster; } }
ClusterService { public Cluster getCluster(String clusterId) { Cluster cluster = clusters.get(clusterId); if (cluster == null) { throw new EntityNotFoundException( "Cluster with the specified ID not found: ID = " + clusterId); } return cluster; } @Inject  ClusterService(StormEngine stormEngine, StreamflowConfig streamflowConfig); }
ClusterService { public Cluster getCluster(String clusterId) { Cluster cluster = clusters.get(clusterId); if (cluster == null) { throw new EntityNotFoundException( "Cluster with the specified ID not found: ID = " + clusterId); } return cluster; } @Inject  ClusterService(StormEngine stormEngine, StreamflowConfig streamflowConfig); Collection<Cluster> listClusters(); Cluster addCluster(Cluster cluster); Cluster getCluster(String clusterId); void deleteCluster(String clusterId); void updateCluster(String clusterId, Cluster cluster); ClusterSummary getClusterSummary(String clusterId); }
ClusterService { public Cluster getCluster(String clusterId) { Cluster cluster = clusters.get(clusterId); if (cluster == null) { throw new EntityNotFoundException( "Cluster with the specified ID not found: ID = " + clusterId); } return cluster; } @Inject  ClusterService(StormEngine stormEngine, StreamflowConfig streamflowConfig); Collection<Cluster> listClusters(); Cluster addCluster(Cluster cluster); Cluster getCluster(String clusterId); void deleteCluster(String clusterId); void updateCluster(String clusterId, Cluster cluster); ClusterSummary getClusterSummary(String clusterId);  }