|
|
|
|
@ -132,7 +132,6 @@ public class HttpServiceMethodTests {
@@ -132,7 +132,6 @@ public class HttpServiceMethodTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void blockingService() { |
|
|
|
|
|
|
|
|
|
BlockingService service = this.proxyFactory.createClient(BlockingService.class); |
|
|
|
|
|
|
|
|
|
service.execute(); |
|
|
|
|
@ -144,7 +143,7 @@ public class HttpServiceMethodTests {
@@ -144,7 +143,7 @@ public class HttpServiceMethodTests {
|
|
|
|
|
assertThat(body).isEqualTo("requestToBody"); |
|
|
|
|
|
|
|
|
|
Optional<String> optional = service.getBodyOptional(); |
|
|
|
|
assertThat(optional).isEqualTo(Optional.of("requestToBody")); |
|
|
|
|
assertThat(optional).contains("requestToBody"); |
|
|
|
|
|
|
|
|
|
ResponseEntity<String> entity = service.getEntity(); |
|
|
|
|
assertThat(entity.getBody()).isEqualTo("requestToEntity"); |
|
|
|
|
@ -155,7 +154,6 @@ public class HttpServiceMethodTests {
@@ -155,7 +154,6 @@ public class HttpServiceMethodTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void methodAnnotatedService() { |
|
|
|
|
|
|
|
|
|
MethodLevelAnnotatedService service = this.proxyFactory.createClient(MethodLevelAnnotatedService.class); |
|
|
|
|
|
|
|
|
|
service.performGet(); |
|
|
|
|
@ -177,7 +175,6 @@ public class HttpServiceMethodTests {
@@ -177,7 +175,6 @@ public class HttpServiceMethodTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void typeAndMethodAnnotatedService() throws Exception { |
|
|
|
|
|
|
|
|
|
HttpServiceProxyFactory proxyFactory = new HttpServiceProxyFactory(this.client); |
|
|
|
|
proxyFactory.setEmbeddedValueResolver(value -> (value.equals("${baseUrl}") ? "/base" : value)); |
|
|
|
|
proxyFactory.afterPropertiesSet(); |
|
|
|
|
@ -202,7 +199,7 @@ public class HttpServiceMethodTests {
@@ -202,7 +199,7 @@ public class HttpServiceMethodTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void verifyClientInvocation(String methodName, @Nullable ParameterizedTypeReference<?> expectedBodyType) { |
|
|
|
|
assertThat((this.client.getInvokedMethodName())).isEqualTo(methodName); |
|
|
|
|
assertThat(this.client.getInvokedMethodName()).isEqualTo(methodName); |
|
|
|
|
assertThat(this.client.getBodyType()).isEqualTo(expectedBodyType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|