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:
Glenn Renfro
2017-10-25 13:01:10 -04:00
parent 15acc0c756
commit e279846e7e
14 changed files with 43 additions and 40 deletions

View File

@@ -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>

View File

@@ -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));
}
}