Polishing

This commit is contained in:
Sam Brannen
2022-07-13 16:58:56 +02:00
parent 0fb9de5d0e
commit a81558ee5a
2 changed files with 5 additions and 8 deletions

View File

@@ -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>

View File

@@ -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 {
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 {
@Test
void methodAnnotatedService() {
MethodLevelAnnotatedService service = this.proxyFactory.createClient(MethodLevelAnnotatedService.class);
service.performGet();
@@ -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 {
}
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);
}