From 034803ee2f4a18ef54b4cb0e048398260b0d4248 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 5 Jul 2023 20:58:58 +0100 Subject: [PATCH] Polish --- .../io/restclient/webclient/ssl/Details.java | 21 +++++++++++++++++++ .../restclient/webclient/ssl/MyService.java | 1 - .../docs/io/restclient/webclient/MyService.kt | 3 ++- .../io/restclient/webclient/ssl/Details.kt | 19 +++++++++++++++++ .../io/restclient/webclient/ssl/MyService.kt | 7 ++++--- 5 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.java create mode 100644 spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.kt diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.java new file mode 100644 index 0000000000..88c9821c53 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.java @@ -0,0 +1,21 @@ +/* + * Copyright 2012-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.docs.io.restclient.webclient.ssl; + +public class Details { + +} diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.java index 7ed0790f8f..d564c602f8 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.java @@ -19,7 +19,6 @@ package org.springframework.boot.docs.io.restclient.webclient.ssl; import reactor.core.publisher.Mono; import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientSsl; -import org.springframework.boot.docs.io.restclient.webclient.Details; import org.springframework.stereotype.Service; import org.springframework.web.reactive.function.client.WebClient; diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/MyService.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/MyService.kt index 4c31830681..dc9848d6f2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/MyService.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/MyService.kt @@ -30,7 +30,8 @@ class MyService(webClientBuilder: WebClient.Builder) { } fun someRestCall(name: String?): Mono
{ - return webClient.get().uri("/{name}/details", name).retrieve().bodyToMono(Details::class.java) + return webClient.get().uri("/{name}/details", name) + .retrieve().bodyToMono(Details::class.java) } } diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.kt new file mode 100644 index 0000000000..589e3db806 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/Details.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2012-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.docs.io.restclient.webclient.ssl + +class Details diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.kt index 3ddac190f9..011d84f73f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.kt @@ -17,7 +17,6 @@ package org.springframework.boot.docs.io.restclient.webclient.ssl import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientSsl -import org.springframework.boot.docs.io.restclient.webclient.Details import org.springframework.stereotype.Service import org.springframework.web.reactive.function.client.WebClient import reactor.core.publisher.Mono @@ -28,11 +27,13 @@ class MyService(webClientBuilder: WebClient.Builder, ssl: WebClientSsl) { private val webClient: WebClient init { - webClient = webClientBuilder.baseUrl("https://example.org").apply(ssl.fromBundle("mybundle")).build() + webClient = webClientBuilder.baseUrl("https://example.org") + .apply(ssl.fromBundle("mybundle")).build() } fun someRestCall(name: String?): Mono
{ - return webClient.get().uri("/{name}/details", name).retrieve().bodyToMono(Details::class.java) + return webClient.get().uri("/{name}/details", name) + .retrieve().bodyToMono(Details::class.java) } }