I'm trying out Spring Cloud Stream, and when i tried to run one of the simpliest test (original test available here: https://github.com/spring-cloud/spring-cloud-stream/blob/master/spring-cloud-stream-test-support/src/test/java/org/springframework/cloud/stream/test/disable/AutoconfigurationDisabledTest.java)
Using: Java 1.8 SpringBoot 2.1.5.RELEASE spring-cloud.version: Greenwich.RELEASE
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
@DirtiesContext
public class ExampleTest {
@Autowired
public MessageCollector messageCollector;
@Autowired
public Processor processor;
@SuppressWarnings("unchecked")
@Test
public void testAutoconfigurationDisabled() {
this.processor.input().send(MessageBuilder.withPayload("empty").build());
Message<String> response = (Message<String>) this.messageCollector.forChannel(this.processor.output()).poll();
Assertions.assertThat(response).isNotNull();
Assertions.assertThat(response.getPayload()).isEqualTo("Hello World");
}
}
Test passed, but it should not. Message is sent with "empty", and that is what i would expect to receive, but received payload always is "Hello World"
org.junit.ComparisonFailure: expected:<"[Hello] world"> but was:<"[empty] world">- Oleg Zhurakousky