|
|
|
|
@ -58,17 +58,17 @@ class RestClientTestRestClientTwoComponentsIntegrationTests {
@@ -58,17 +58,17 @@ class RestClientTestRestClientTwoComponentsIntegrationTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void client1RestCallViaCustomizer() { |
|
|
|
|
this.customizer.getServer(this.client1.getRestClientBuilder()) |
|
|
|
|
.expect(requestTo(uri("/test"))) |
|
|
|
|
.andRespond(withSuccess("hello", MediaType.TEXT_HTML)); |
|
|
|
|
MockRestServiceServer server = this.customizer.getServer(this.client1.getRestClientBuilder()); |
|
|
|
|
assertThat(server).isNotNull(); |
|
|
|
|
server.expect(requestTo(uri("/test"))).andRespond(withSuccess("hello", MediaType.TEXT_HTML)); |
|
|
|
|
assertThat(this.client1.test()).isEqualTo("hello"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void client2RestCallViaCustomizer() { |
|
|
|
|
this.customizer.getServer(this.client2.getRestClientBuilder()) |
|
|
|
|
.expect(requestTo(uri("/test"))) |
|
|
|
|
.andRespond(withSuccess("there", MediaType.TEXT_HTML)); |
|
|
|
|
MockRestServiceServer server = this.customizer.getServer(this.client2.getRestClientBuilder()); |
|
|
|
|
assertThat(server).isNotNull(); |
|
|
|
|
server.expect(requestTo(uri("/test"))).andRespond(withSuccess("there", MediaType.TEXT_HTML)); |
|
|
|
|
assertThat(this.client2.test()).isEqualTo("there"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|