Resolve placeholders in HttpExchange#url

Closes gh-28492
This commit is contained in:
rstoyanchev
2022-05-19 20:39:12 +01:00
parent ce568468ae
commit 2a2fba6a37
3 changed files with 46 additions and 12 deletions

View File

@@ -168,7 +168,11 @@ public class HttpServiceMethodTests {
@Test
void typeAndMethodAnnotatedService() {
MethodLevelAnnotatedService service = this.proxyFactory.createClient(TypeAndMethodLevelAnnotatedService.class);
HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(this.clientAdapter)
.setEmbeddedValueResolver(value -> (value.equals("${baseUrl}") ? "/base" : value))
.build();
MethodLevelAnnotatedService service = proxyFactory.createClient(TypeAndMethodLevelAnnotatedService.class);
service.performGet();
@@ -281,7 +285,7 @@ public class HttpServiceMethodTests {
@SuppressWarnings("unused")
@HttpExchange(url = "/base", contentType = APPLICATION_CBOR_VALUE, accept = APPLICATION_CBOR_VALUE)
@HttpExchange(url = "${baseUrl}", contentType = APPLICATION_CBOR_VALUE, accept = APPLICATION_CBOR_VALUE)
private interface TypeAndMethodLevelAnnotatedService extends MethodLevelAnnotatedService {
}