Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
heowc committed May 5, 2024
1 parent 783d4c1 commit 142f1af
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public RestClientDiscoveryClientOptionalArgs restClientDiscoveryClientOptionalAr

@Bean
@ConditionalOnMissingBean(value = TransportClientFactories.class, search = SearchStrategy.CURRENT)
public RestClientTransportClientFactories webClientTransportClientFactories(
public RestClientTransportClientFactories restClientTransportClientFactories(
ObjectProvider<RestClient.Builder> builder) {
return new RestClientTransportClientFactories(builder::getIfAvailable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected static class RestClientConfiguration {

@Bean
@ConditionalOnMissingBean(EurekaHttpClient.class)
public RestClientEurekaHttpClient configDiscoveryWebClientEurekaHttpClient(EurekaClientConfigBean config,
public RestClientEurekaHttpClient configDiscoveryRestClientEurekaHttpClient(EurekaClientConfigBean config,
ObjectProvider<RestClient.Builder> builder, Environment env) {
return (RestClientEurekaHttpClient) new RestClientTransportClientFactory(builder::getIfAvailable)
.newClient(HostnameBasedUrlRandomizer.randomEndpoint(config, env));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ private RestTemplate restTemplate(String serviceUrl) {

final EurekaHttpClientUtils.UserInfo userInfo = extractUserInfo(serviceUrl);
if (userInfo != null) {
restTemplate.getInterceptors()
.add(new BasicAuthenticationInterceptor(userInfo.username(), userInfo.password()));
restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor(
userInfo.username(), userInfo.password()));
}

restTemplate.getMessageConverters().add(0, mappingJacksonHttpMessageConverter());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@
/**
* @author Wonchul Heo
*/
@SpringBootTest(
properties = { "spring.cloud.config.discovery.enabled=true", "eureka.client.enabled=true",
"spring.config.use-legacy-processing=true", "eureka.client.restclient.enabled=true" },
webEnvironment = RANDOM_PORT)
@SpringBootTest(properties = { "spring.cloud.config.discovery.enabled=true",
"eureka.client.enabled=true", "spring.config.use-legacy-processing=true",
"eureka.client.restclient.enabled=true" }, webEnvironment = RANDOM_PORT)
class EurekaConfigServerBootstrapConfigurationRestClientIntegrationTests {

@LocalServerPort
Expand All @@ -53,7 +52,7 @@ class EurekaConfigServerBootstrapConfigurationRestClientIntegrationTests {
private RestClientEurekaHttpClient eurekaHttpClient;

@Test
void webClientRespectsCodecProperties() {
void restClientRespectsCodecProperties() {
final RestClient restClient = eurekaHttpClient.getRestClient();
final ResponseEntity<String> response = restClient.get().uri("http://localhost:" + port).retrieve()
.toEntity(String.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void properBeansCreatedWhenEnabled() {
}

@Test
void properBeansCreatedWhenEnabledWebClientDisabled() {
void properBeansCreatedWhenEnabledRestClientDisabled() {
new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(EurekaConfigServerBootstrapConfiguration.class))
.withPropertyValues("spring.cloud.config.discovery.enabled=true", "eureka.client.enabled=true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
public class EurekaHttpClientsOptionalArgsConfigurationTest {

@Test
public void contextLoadsWithRestTemplateWhenWebClientIsDisabled() {
public void contextLoadsWithRestTemplateWhenWebClientDisabled() {
new WebApplicationContextRunner().withUserConfiguration(EurekaSampleApplication.class)
.withPropertyValues("eureka.client.webclient.enabled=false").run(context -> {
assertThat(context).hasSingleBean(RestTemplateDiscoveryClientOptionalArgs.class);
Expand All @@ -51,7 +51,7 @@ public void contextLoadsWithRestTemplateWhenWebClientIsDisabled() {
}

@Test
public void contextLoadsWithRestTemplateWhenRestClientIsDisabled() {
public void contextLoadsWithRestTemplateWhenRestClientDisabled() {
new WebApplicationContextRunner().withUserConfiguration(EurekaSampleApplication.class)
.withPropertyValues("eureka.client.restclient.enabled=false").run(context -> {
assertThat(context).hasSingleBean(RestTemplateDiscoveryClientOptionalArgs.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
/**
* @author Wonchul Heo
*/
@SpringBootTest(classes = EurekaServerMockApplication.class,
properties = { "debug=true", "security.basic.enabled=true", "eureka.client.fetch-registry=false",
"eureka.client.register-with-eureka=false", "logging.level.org.springframework=INFO" },
webEnvironment = WebEnvironment.RANDOM_PORT)
@SpringBootTest(classes = EurekaServerMockApplication.class, properties = { "debug=true",
"security.basic.enabled=true", "eureka.client.fetch-registry=false",
"eureka.client.register-with-eureka=false",
"logging.level.org.springframework=INFO" }, webEnvironment = WebEnvironment.RANDOM_PORT)
@DirtiesContext
class RestClientEurekaHttpClientTests extends AbstractEurekaHttpClientTests {

Expand Down

0 comments on commit 142f1af

Please sign in to comment.