BAEL-6082 RSocket Interface in Spring 6 (#14873)

* Rsocket in spring framework6.

* reformat code.

* Reformate code with removing blank rows.

* some changes in maven dependency and codes

* moving spring boot dependency from parent to new projects.changing spring core version

---------

Co-authored-by: rezaganjis <Ganji@tosan.com>
This commit is contained in:
Reza Ganji
2023-09-30 03:53:21 +03:30
committed by GitHub
parent 9e5c656d84
commit cafabdfe55
9 changed files with 259 additions and 2 deletions
@@ -0,0 +1,35 @@
package com.bealdung.rsocket;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.messaging.rsocket.RSocketRequester;
import org.springframework.messaging.rsocket.service.RSocketServiceProxyFactory;
import com.bealdung.rsocket.requester.MessageClient;
import com.bealdung.rsocket.responder.RSocketApplication;
import reactor.core.publisher.Mono;
@SpringBootTest(classes = RSocketApplication.class)
public class RSocketRequestResponseIntegrationTest {
MessageClient client;
public RSocketRequestResponseIntegrationTest() {
RSocketRequester.Builder requesterBuilder = RSocketRequester.builder();
RSocketRequester requester = requesterBuilder.tcp("localhost", 7000);
RSocketServiceProxyFactory factory = RSocketServiceProxyFactory.builder(requester)
.build();
client = factory.createClient(MessageClient.class);
}
@Test
public void whenSendingStream_thenReceiveTheSameStream() {
String message = "test message";
assertEquals(message, client.sendMessage(Mono.just(message))
.block());
}
}