@Test public void stopTasksOnEnvironmentWithDifferentVersion() { Task taskWithDifferentVersion = defaultTask().taskDefinitionArn("different-taskdef").build(); StopTask stopTask = environment.stopTaskFor(taskWithDifferentVersion); assertSoftly( s -> { s.assertThat(stopTask.getClusterName()).isEqualTo(env.getClusterName()); s.assertThat(stopTask.getTask()) .isEqualTo(taskWithDifferentVersion.getTaskDefinitionArn()); s.assertThat(stopTask.getReason()) .isEqualTo( String.format( "Stopped by deployment to %s@%s", env.getEnvironmentName(), env.getTaskDefinitionArn())); }); }
public StopTask stopTaskFor(final Task task) { return StopTask.builder() .clusterName(environment.getClusterName()) .task(task.getTaskDefinitionArn()) .reason( String.format( "Stopped by deployment to %s@%s", environment.getEnvironmentName(), environment.getTaskDefinitionArn())) .build(); }
DaemonEnvironment { public StopTask stopTaskFor(final Task task) { return StopTask.builder() .clusterName(environment.getClusterName()) .task(task.getTaskDefinitionArn()) .reason( String.format( "Stopped by deployment to %s@%s", environment.getEnvironmentName(), environment.getTaskDefinitionArn())) .build(); } }
DaemonEnvironment { public StopTask stopTaskFor(final Task task) { return StopTask.builder() .clusterName(environment.getClusterName()) .task(task.getTaskDefinitionArn()) .reason( String.format( "Stopped by deployment to %s@%s", environment.getEnvironmentName(), environment.getTaskDefinitionArn())) .build(); }  }
DaemonEnvironment { public StopTask stopTaskFor(final Task task) { return StopTask.builder() .clusterName(environment.getClusterName()) .task(task.getTaskDefinitionArn()) .reason( String.format( "Stopped by deployment to %s@%s", environment.getEnvironmentName(), environment.getTaskDefinitionArn())) .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 StopTask stopTaskFor(final Task task) { return StopTask.builder() .clusterName(environment.getClusterName()) .task(task.getTaskDefinitionArn()) .reason( String.format( "Stopped by deployment to %s@%s", environment.getEnvironmentName(), environment.getTaskDefinitionArn())) .build(); }  boolean isMissingHealthyTask(List<Task> tasks); StartTask startTaskFor(ContainerInstance i); StopTask stopTaskFor(final Task task); boolean isTaskStoppable(Task t); boolean isMatchingTask(Task t);  }