Pull request changes done

This commit is contained in:
Jose Carvajal 2017-10-11 12:11:38 +02:00
parent 57a993de64
commit e8979a4033
5 changed files with 70 additions and 75 deletions

View File

@ -17,7 +17,6 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>

View File

@ -26,13 +26,13 @@ public class MultipleOutputsServiceApplicationTests {
private MessageCollector messageCollector;
@Test
public void shouldReceiveMessageInAnOutput() {
public void whenSendMessage_thenResponseIsInAOutput() {
whenSendMessage(1);
thenPayloadInChannelIs(pipe.anOutput(), 1);
}
@Test
public void shouldReceiveMessageInAnAnotherOutput() {
public void whenSendMessage_thenResponseIsInAnotherOutput() {
whenSendMessage(11);
thenPayloadInChannelIs(pipe.anotherOutput(), 11);
}

View File

@ -26,13 +26,13 @@ public class MultipleOutputsWithConditionsServiceApplicationTests {
private MessageCollector messageCollector;
@Test
public void shouldReceiveMessageInAnOutput() {
public void whenSendMessage_thenResponseIsInAOutput() {
whenSendMessage(1);
thenPayloadInChannelIs(pipe.anotherOutput(), 1);
}
@Test
public void shouldReceiveMessageInAnAnotherOutput() {
public void whenSendMessage_thenResponseIsInAnotherOutput() {
whenSendMessage(11);
thenPayloadInChannelIs(pipe.anotherOutput(), 11);
}

View File

@ -12,7 +12,6 @@ import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.baeldung.spring.cloud.stream.rabbit.MyLoggerServiceApplication;
import com.baeldung.spring.cloud.stream.rabbit.model.LogMessage;
@RunWith(SpringJUnit4ClassRunner.class)
@ -27,18 +26,15 @@ public class MyLoggerApplicationTests {
private MessageCollector messageCollector;
@Test
public void shouldEnrichMessage() {
// Send message
public void whenSendMessage_thenResponseShouldUpdateText() {
pipe.input()
.send(MessageBuilder.withPayload(new LogMessage("This is my message"))
.build());
// Get response from the service
Object payload = messageCollector.forChannel(pipe.output())
.poll()
.getPayload();
// Assert
assertEquals("[1]: This is my message", payload.toString());
}
}