Updated Spring Cloud Task to latest releases
Updated to remove all commons-logging-api dependencies to resolve logging issue. Updated to handle 2.0.0.M3 Spring Cloud Stream resovles #347 Changes based on code review
This commit is contained in:
15
pom.xml
15
pom.xml
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
<version>2.0.0.M2</version>
|
||||
<version>2.0.0.M4</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -117,11 +117,6 @@
|
||||
<artifactId>spring-cloud-stream-test-support</artifactId>
|
||||
<version>${spring-cloud-stream.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging-api</artifactId>
|
||||
<version>${commons-logging.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
@@ -137,15 +132,15 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-stream.version>2.0.0.M1</spring-cloud-stream.version>
|
||||
<spring-cloud-stream.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version>
|
||||
<spring-cloud-deployer-spi.version>2.0.0.M1</spring-cloud-deployer-spi.version>
|
||||
<spring-cloud-deployer-local.version>2.0.0.M1</spring-cloud-deployer-local.version>
|
||||
<spring-cloud-stream-binder-rabbit.version>2.0.0.M1</spring-cloud-stream-binder-rabbit.version>
|
||||
<spring-cloud-stream-binder-rabbit.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-stream-binder-rabbit.version>
|
||||
<spring-cloud-deployer-resource-support.version>2.0.0.M1</spring-cloud-deployer-resource-support.version>
|
||||
<spring-cloud-deployer-resource-maven.version>2.0.0.M1</spring-cloud-deployer-resource-maven.version>
|
||||
<spring-batch.version>4.0.0.M3</spring-batch.version>
|
||||
<spring-batch.version>4.0.0.M5</spring-batch.version>
|
||||
<commons-logging.version>1.1</commons-logging.version>
|
||||
<java-ee-api.version>7.0</java-ee-api.version>
|
||||
<java-ee-api.version>8.0</java-ee-api.version>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco-ut.exec</sonar.jacoco.reportPath>
|
||||
|
||||
@@ -45,10 +45,6 @@
|
||||
<artifactId>spring-batch-integration</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
|
||||
@@ -71,11 +71,12 @@
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -51,19 +51,19 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-binder-rabbit-test-support</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-test-support-internal</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.batch</groupId>
|
||||
<artifactId>spring-batch-integration</artifactId>
|
||||
<version>4.0.0.M3</version>
|
||||
<version>4.0.0.M5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -56,7 +56,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-test-support</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
|
||||
package io.spring;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -27,6 +29,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.messaging.Processor;
|
||||
import org.springframework.cloud.stream.test.binder.MessageCollector;
|
||||
import org.springframework.cloud.task.launcher.TaskLaunchRequest;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -49,8 +52,10 @@ public class TaskProcessorApplicationTests {
|
||||
@Autowired
|
||||
protected MessageCollector collector;
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void test() throws InterruptedException{
|
||||
public void test() throws InterruptedException, IOException {
|
||||
channels.input().send(new GenericMessage<Object>(DEFAULT_PAYLOAD));
|
||||
Map<String, String> properties = new HashMap();
|
||||
properties.put("payload", DEFAULT_PAYLOAD);
|
||||
@@ -58,7 +63,9 @@ public class TaskProcessorApplicationTests {
|
||||
"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)));
|
||||
Message<String> result = (Message<String>)collector.forChannel(channels.output()).take();
|
||||
TaskLaunchRequest tlq = mapper.readValue(result.getPayload(),TaskLaunchRequest.class);
|
||||
assertThat(tlq, is(expectedRequest));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -46,13 +46,13 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-test-support</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M3</version>
|
||||
<version>2.0.0.M5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
<artifactId>spring-cloud-deployer-local</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-deployer-spi</artifactId>
|
||||
|
||||
@@ -44,7 +44,7 @@ public class TaskLaunchRequest implements Serializable{
|
||||
private String applicationName;
|
||||
|
||||
/**
|
||||
* Constructor for the TaskLaunchRequest;
|
||||
* Constructor for the TaskLaunchRequest.
|
||||
* @param uri the URI to the task artifact to be launched.
|
||||
* @param commandlineArguments list of commandlineArguments to be used by the task
|
||||
* @param environmentProperties are the environment variables for this task.
|
||||
@@ -66,6 +66,14 @@ public class TaskLaunchRequest implements Serializable{
|
||||
setApplicationName(applicationName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for the TaskLaunchRequest.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public TaskLaunchRequest() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current uri to the artifact for this launch request.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user