Add Application Name to TaskLaunchRequest for launched task

resolves #238
This commit is contained in:
Glenn Renfro
2016-11-02 09:26:00 -04:00
committed by Michael Minella
parent cc1f971f3e
commit 4a1a2c3c88
11 changed files with 139 additions and 51 deletions

View File

@@ -58,7 +58,9 @@ public class TaskProcessor {
}
properties.put("payload", message);
TaskLaunchRequest request = new TaskLaunchRequest(processorProperties.getUri(), null, properties, null);
TaskLaunchRequest request = new TaskLaunchRequest(
processorProperties.getUri(), null, properties, null,
processorProperties.getApplicationName());
return new GenericMessage<TaskLaunchRequest>(request);
}

View File

@@ -38,6 +38,8 @@ public class TaskProcessorProperties {
private String dataSourcePassword;
private String applicationName;
public String getDataSourceUrl() {
@@ -79,4 +81,12 @@ public class TaskProcessorProperties {
public void setUri(String uri) {
this.uri = uri;
}
public String getApplicationName() {
return applicationName;
}
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
}

View File

@@ -58,8 +58,10 @@ public class TaskProcessorApplicationTests {
channels.input().send(new GenericMessage<Object>(DEFAULT_PAYLOAD));
Map<String, String> properties = new HashMap();
properties.put("payload", DEFAULT_PAYLOAD);
TaskLaunchRequest expectedRequest = new TaskLaunchRequest("maven://org.springframework.cloud.task.app:"
+ "timestamp-task:jar:1.0.1.RELEASE", null, properties, null);
TaskLaunchRequest expectedRequest = new TaskLaunchRequest(
"maven://org.springframework.cloud.task.app:"
+ "timestamp-task:jar:1.0.1.RELEASE", null, properties,
null, null);
assertThat(collector.forChannel(channels.output()), receivesPayloadThat(is(expectedRequest)));
}