@Test public void tasksForInstanceReturnsNoTasksForEmptyInstance() { given(instance("i-1")); ClusterSummary summary = new ClusterSummary(snapshot); assertThat(summary.tasksForInstance(instance("i-1"))).isEmpty(); }
public List<Task> tasksForInstance(ContainerInstance instance) { String arn = instance.getArn(); if (instancesByInstanceArn.containsKey(arn)) { return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList()); } else { throw new IndexOutOfBoundsException( String.format("ContainerInstance with ARN %s not found in snapshot", arn)); } }
ClusterSummary { public List<Task> tasksForInstance(ContainerInstance instance) { String arn = instance.getArn(); if (instancesByInstanceArn.containsKey(arn)) { return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList()); } else { throw new IndexOutOfBoundsException( String.format("ContainerInstance with ARN %s not found in snapshot", arn)); } } }
ClusterSummary { public List<Task> tasksForInstance(ContainerInstance instance) { String arn = instance.getArn(); if (instancesByInstanceArn.containsKey(arn)) { return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList()); } else { throw new IndexOutOfBoundsException( String.format("ContainerInstance with ARN %s not found in snapshot", arn)); } } ClusterSummary(ClusterSnapshot snapshot); }
ClusterSummary { public List<Task> tasksForInstance(ContainerInstance instance) { String arn = instance.getArn(); if (instancesByInstanceArn.containsKey(arn)) { return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList()); } else { throw new IndexOutOfBoundsException( String.format("ContainerInstance with ARN %s not found in snapshot", arn)); } } ClusterSummary(ClusterSnapshot snapshot); List<Task> tasksForInstance(ContainerInstance instance); List<ContainerInstance> getInstances(); }
ClusterSummary { public List<Task> tasksForInstance(ContainerInstance instance) { String arn = instance.getArn(); if (instancesByInstanceArn.containsKey(arn)) { return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList()); } else { throw new IndexOutOfBoundsException( String.format("ContainerInstance with ARN %s not found in snapshot", arn)); } } ClusterSummary(ClusterSnapshot snapshot); List<Task> tasksForInstance(ContainerInstance instance); List<ContainerInstance> getInstances();  }