Browse Source

Polishing

pull/28821/head
Sam Brannen 4 years ago
parent
commit
a81558ee5a
  1. 6
      spring-web/src/main/java/org/springframework/web/service/annotation/HttpExchange.java
  2. 7
      spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceMethodTests.java

6
spring-web/src/main/java/org/springframework/web/service/annotation/HttpExchange.java

@ -28,13 +28,13 @@ import org.springframework.web.bind.annotation.Mapping; @@ -28,13 +28,13 @@ import org.springframework.web.bind.annotation.Mapping;
/**
* Annotation to declare a method on an HTTP service interface as an HTTP
* endpoint. The endpoint details are defined statically through attributes of
* the annotation, as well as through the input method argument values.
* the annotation, as well as through the input method argument types.
*
* <p>Supported at the type level to express common attributes, to be inherited
* by all methods, such as a base URL path.
*
* <p>At the method level, it's more common to use one of the below HTTP method
* specific, shortcut annotation, each of which is itself <em>meta-annotated</em>
* <p>At the method level, it's more common to use one of the following HTTP method
* specific, shortcut annotations, each of which is itself <em>meta-annotated</em>
* with {@code HttpExchange}:
*
* <ul>

7
spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceMethodTests.java

@ -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);
}

Loading…
Cancel
Save