spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.02k stars 40.65k forks source link

Configure RSocket standalone servers with a local transport for tests #18387

Open bclozel opened 5 years ago

bclozel commented 5 years ago

In the web world, we configure a mock environment instead of starting a real web server for integration tests, with the following:

@SpringBootTest(webEnvironment = WebEnvironment.MOCK)

It would be nice to explore whether we can configure a local transport (rsocket-transport-local) to test interactions between an RSocket server and an RSocket client. This might require changes in Spring Framework with the RSocketRequester, or test infrastructure to make things easier.

spencergibb commented 5 years ago

This would be extremely useful for the Gateway RSocket Broker. Can't wait to see what you come up with. Let me know if I can help.

eddumelendez commented 5 years ago

Hi, I was thinking about the testing support for RSocket las week and at high level this is the list

  1. RScocketRequesterTestClient in spring-framework, similar to WebTestClient but using RSocketRequester.
  2. RSocketServiceServer in spring-framework, similar to MockRestServiceServer
  3. @RSocketClientTest for slice testing in spring-boot, which allows to autowire RScocketRequesterTestClient to perform requests and assertions against RSocketServiceServer.
  4. @RSocketTest to enable de infrastructure for RSocket, similar to @WebFluxTest or @WebMvcTest