Upgraded versions and fixed test

This commit upgrades the versions to the latest and greatest as well as
removes the custom implementation of a TaskLauncher.
This commit is contained in:
Michael Minella
2017-04-13 13:12:42 -05:00
parent a1cffe8bd4
commit f135e84128
8 changed files with 37 additions and 60 deletions

View File

@@ -16,13 +16,12 @@
package io.spring.configuration;
import org.springframework.cloud.deployer.spi.core.AppDeploymentRequest;
import org.springframework.cloud.deployer.spi.task.LaunchState;
import org.springframework.cloud.deployer.spi.task.TaskLauncher;
import org.springframework.cloud.deployer.spi.task.TaskStatus;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.mockito.Mockito.mock;
/**
* @author Glenn Renfro
*/
@@ -31,38 +30,7 @@ public class TaskSinkConfiguration {
@Bean
public TaskLauncher taskLauncher() {
return new TestTaskLauncher();
}
public class TestTaskLauncher implements TaskLauncher {
public static final String LAUNCH_ID = "TEST_LAUNCH_ID";
private LaunchState state = LaunchState.unknown;
@Override
public String launch(AppDeploymentRequest request) {
state = LaunchState.complete;
return null;
}
@Override
public void cancel(String id) {
}
@Override
public TaskStatus status(String id) {
String taskLaunchId = LAUNCH_ID;
TaskStatus taskStatus = new TaskStatus(taskLaunchId, state, null);
return taskStatus;
}
@Override
public void cleanup(String id) {}
@Override
public void destroy(String appName) {}
return mock(TaskLauncher.class);
}
}