diff --git a/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/ImplicitFunctionBindingTests.java b/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/ImplicitFunctionBindingTests.java index cf254c6c9..256f8ce29 100644 --- a/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/ImplicitFunctionBindingTests.java +++ b/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/ImplicitFunctionBindingTests.java @@ -95,6 +95,21 @@ public void after() { System.clearProperty("spring.cloud.function.definition"); } + @Test + void foo() { + try (ConfigurableApplicationContext context = new SpringApplicationBuilder( + TestChannelBinderConfiguration.getCompleteConfiguration(DoNotFailOnUnknownPropertiesConfiguration.class)) + .web(WebApplicationType.NONE) + .run("--spring.jmx.enabled=false", "--spring.cloud.function.definition=echo")) { + + InputDestination input = context.getBean(InputDestination.class); + input.send(new GenericMessage("{\"name\":\"Bubles\",\"id\":\"2\"}".getBytes()), "echo-in-0"); + + OutputDestination output = context.getBean(OutputDestination.class); + Message result = output.receive(1000, "echo-out-0"); + assertThat(result.getPayload()).isEqualTo("Bubles".getBytes()); + } + } @Test void failedApplicationListenerConfiguration() { @@ -1717,4 +1732,25 @@ public void setId(int id) { } } + public static class Employee { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + @EnableAutoConfiguration + public static class DoNotFailOnUnknownPropertiesConfiguration { + + @Bean + public Function echo() { + return x -> x.getName(); + } + } + }