@Test public void startsTasksThatMatchesEnvironmentAndInstance() { ContainerInstance instance = ContainerInstance.builder().arn("instance-1").build(); StartTask task = environment.startTaskFor(instance); assertSoftly( s -> { s.assertThat(task.getClusterName()).isEqualTo(env.getClusterName()); s.assertThat(task.getContainerInstanceArn()).isEqualTo(instance.getArn()); s.assertThat(task.getGroup()).isEqualTo(env.getEnvironmentName()); s.assertThat(task.getTaskDefinitionArn()).isEqualTo(env.getTaskDefinitionArn()); }); }
public StartTask startTaskFor(ContainerInstance i) { return StartTask.builder() .clusterName(environment.getClusterName()) .containerInstanceArn(i.getArn()) .taskDefinitionArn(environment.getTaskDefinitionArn()) .group(environment.getEnvironmentName()) .build(); }
DaemonEnvironment { public StartTask startTaskFor(ContainerInstance i) { return StartTask.builder() .clusterName(environment.getClusterName()) .containerInstanceArn(i.getArn()) .taskDefinitionArn(environment.getTaskDefinitionArn()) .group(environment.getEnvironmentName()) .build(); } }
DaemonEnvironment { public StartTask startTaskFor(ContainerInstance i) { return StartTask.builder() .clusterName(environment.getClusterName()) .containerInstanceArn(i.getArn()) .taskDefinitionArn(environment.getTaskDefinitionArn()) .group(environment.getEnvironmentName()) .build(); }  }
DaemonEnvironment { public StartTask startTaskFor(ContainerInstance i) { return StartTask.builder() .clusterName(environment.getClusterName()) .containerInstanceArn(i.getArn()) .taskDefinitionArn(environment.getTaskDefinitionArn()) .group(environment.getEnvironmentName()) .build(); }  boolean isMissingHealthyTask(List<Task> tasks); StartTask startTaskFor(ContainerInstance i); StopTask stopTaskFor(final Task task); boolean isTaskStoppable(Task t); boolean isMatchingTask(Task t); }
DaemonEnvironment { public StartTask startTaskFor(ContainerInstance i) { return StartTask.builder() .clusterName(environment.getClusterName()) .containerInstanceArn(i.getArn()) .taskDefinitionArn(environment.getTaskDefinitionArn()) .group(environment.getEnvironmentName()) .build(); }  boolean isMissingHealthyTask(List<Task> tasks); StartTask startTaskFor(ContainerInstance i); StopTask stopTaskFor(final Task task); boolean isTaskStoppable(Task t); boolean isMatchingTask(Task t);  }