Fix SI sample for compatibility with latest SI
* Fix test `FunctionSampleSpringIntegrationApplicationTests` to use AssertJ
This commit is contained in:
committed by
Oleg Zhurakousky
parent
b053761be7
commit
6c8554d980
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019 the original author or authors.
|
* Copyright 2019-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -35,7 +35,7 @@ public class FunctionSampleSpringIntegrationApplication {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public IntegrationFlow uppercaseFlow() {
|
public IntegrationFlow uppercaseFlow() {
|
||||||
return IntegrationFlows.from(MessageFunction.class, "uppercase")
|
return IntegrationFlows.from(MessageFunction.class, (gateway) -> gateway.beanName("uppercase"))
|
||||||
.<String, String>transform(String::toUpperCase)
|
.<String, String>transform(String::toUpperCase)
|
||||||
.logAndReply(LoggingHandler.Level.WARN);
|
.logAndReply(LoggingHandler.Level.WARN);
|
||||||
}
|
}
|
||||||
@@ -43,4 +43,5 @@ public class FunctionSampleSpringIntegrationApplication {
|
|||||||
public interface MessageFunction extends Function<Message<String>, Message<String>> {
|
public interface MessageFunction extends Function<Message<String>, Message<String>> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019 the original author or authors.
|
* Copyright 2019-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package example;
|
package example;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class FunctionSampleSpringIntegrationApplicationTests {
|
|||||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||||
HttpEntity<String> requestEntity = new HttpEntity<>("[\"foo\", \"bar\"]", httpHeaders);
|
HttpEntity<String> requestEntity = new HttpEntity<>("[\"foo\", \"bar\"]", httpHeaders);
|
||||||
HttpEntity<String> result = this.restTemplate.postForEntity("/uppercase", requestEntity, String.class);
|
HttpEntity<String> result = this.restTemplate.postForEntity("/uppercase", requestEntity, String.class);
|
||||||
assertEquals("[\"FOO\",\"BAR\"]", result.getBody());
|
assertThat(result.getBody()).isEqualTo("[\"FOO\",\"BAR\"]");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<module>function-sample-aws-custom</module>
|
<module>function-sample-aws-custom</module>
|
||||||
<module>function-sample-supplier-exporter</module>
|
<module>function-sample-supplier-exporter</module>
|
||||||
<module>function-sample-azure</module>
|
<module>function-sample-azure</module>
|
||||||
<!--><module>function-sample-spring-integration</module>-->
|
><module>function-sample-spring-integration</module>
|
||||||
<module>function-sample-gcp-http</module>
|
<module>function-sample-gcp-http</module>
|
||||||
<module>function-sample-gcp-background</module>
|
<module>function-sample-gcp-background</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|||||||
Reference in New Issue
Block a user