Skip to content

Commit a2e0dda

Browse files
committed
Show Rsocket requestChannel in RSocketDslTests
1 parent 375f3c1 commit a2e0dda

File tree

1 file changed

+9
-7
lines changed
  • spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/dsl

1 file changed

+9
-7
lines changed

spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/dsl/RSocketDslTests.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.integration.rsocket.dsl;
1818

19-
import static org.assertj.core.api.Assertions.assertThat;
20-
2119
import java.util.function.Function;
2220

2321
import org.junit.jupiter.api.Test;
@@ -36,7 +34,7 @@
3634
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
3735

3836
import reactor.core.publisher.Flux;
39-
import reactor.core.publisher.Mono;
37+
import reactor.test.StepVerifier;
4038

4139
/**
4240
* @author Artem Bilan
@@ -49,11 +47,15 @@ public class RSocketDslTests {
4947

5048
@Autowired
5149
@Qualifier("rsocketUpperCaseRequestFlow.gateway")
52-
private Function<String, String> rsocketUpperCaseFlowFunction;
50+
private Function<Flux<String>, Flux<String>> rsocketUpperCaseFlowFunction;
5351

5452
@Test
5553
void testRsocketUpperCaseFlows() {
56-
assertThat(this.rsocketUpperCaseFlowFunction.apply("hello world")).isEqualTo("HELLO WORLD");
54+
Flux<String> result = this.rsocketUpperCaseFlowFunction.apply(Flux.just("a\n", "b\n", "c\n"));
55+
56+
StepVerifier.create(result)
57+
.expectNext("A", "B", "C")
58+
.verifyComplete();
5759
}
5860

5961
@Configuration
@@ -78,7 +80,7 @@ public IntegrationFlow rsocketUpperCaseRequestFlow(ClientRSocketConnector client
7880
return IntegrationFlows
7981
.from(Function.class)
8082
.handle(RSockets.outboundGateway("/uppercase")
81-
.command((message) -> RSocketOutboundGateway.Command.requestResponse)
83+
.command((message) -> RSocketOutboundGateway.Command.requestStreamOrChannel)
8284
.expectedResponseType("T(java.lang.String)")
8385
.clientRSocketConnector(clientRSocketConnector))
8486
.get();
@@ -88,7 +90,7 @@ public IntegrationFlow rsocketUpperCaseRequestFlow(ClientRSocketConnector client
8890
public IntegrationFlow rsocketUpperCaseFlow() {
8991
return IntegrationFlows
9092
.from(RSockets.inboundGateway("/uppercase"))
91-
.<Flux<String>, Mono<String>>transform((flux) -> flux.next().map(String::toUpperCase))
93+
.<Flux<String>, Flux<String>>transform((flux) -> flux.map(String::toUpperCase))
9294
.get();
9395
}
9496

0 commit comments

Comments
 (0)