Refactor and add javadocs.
This commit is contained in:
@@ -48,6 +48,7 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
* @author Spencer Gibb
|
||||
* @author Olga Maciaszek-Sharma
|
||||
* @author Zhiguo Chen
|
||||
* @author Sabyasachi Bhattacharya
|
||||
*/
|
||||
public final class ServiceInstanceListSupplierBuilder {
|
||||
|
||||
@@ -311,7 +312,7 @@ public final class ServiceInstanceListSupplierBuilder {
|
||||
}));
|
||||
}
|
||||
|
||||
private String getUri(ServiceInstance serviceInstance, String healthCheckPath) {
|
||||
static String getUri(ServiceInstance serviceInstance, String healthCheckPath) {
|
||||
if (StringUtils.hasText(healthCheckPath)) {
|
||||
String path = healthCheckPath.startsWith("/") ? healthCheckPath : "/" + healthCheckPath;
|
||||
return serviceInstance.getUri().toString() + path;
|
||||
|
||||
@@ -62,6 +62,7 @@ import static org.springframework.cloud.loadbalancer.core.ServiceInstanceListSup
|
||||
* @author Olga Maciaszek-Sharma
|
||||
* @author Roman Matiushchenko
|
||||
* @author Roman Chigvintsev
|
||||
* @author Sabyasachi Bhattacharya
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@SpringBootTest(classes = HealthCheckServiceInstanceListSupplierTests.TestApplication.class,
|
||||
|
||||
@@ -23,15 +23,17 @@ import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
import static org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplierBuilder.getUri;
|
||||
|
||||
/**
|
||||
* A utility class for {@link ServiceInstanceListSupplier} tests.
|
||||
*
|
||||
* @author Olga Maciaszek-Sharma
|
||||
* @author Sabyasachi Bhattacharya
|
||||
* @since 3.0.0
|
||||
*/
|
||||
final class ServiceInstanceListSuppliersTestUtils {
|
||||
@@ -59,12 +61,4 @@ final class ServiceInstanceListSuppliersTestUtils {
|
||||
});
|
||||
}
|
||||
|
||||
private static String getUri(ServiceInstance serviceInstance, String healthCheckPath) {
|
||||
if (StringUtils.hasText(healthCheckPath)) {
|
||||
String path = healthCheckPath.startsWith("/") ? healthCheckPath : "/" + healthCheckPath;
|
||||
return serviceInstance.getUri().toString() + path;
|
||||
}
|
||||
return serviceInstance.getUri().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user