polish

parent 384c9b97
......@@ -237,10 +237,8 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
}
private String resolve(String value) {
if (StringUtils.hasText(value)
&& this.resourceLoader instanceof ConfigurableApplicationContext) {
return ((ConfigurableApplicationContext) this.resourceLoader).getEnvironment()
.resolvePlaceholders(value);
if (StringUtils.hasText(value)) {
return this.environment.resolvePlaceholders(value);
}
return value;
}
......
......@@ -20,6 +20,7 @@ package org.springframework.cloud.netflix.feign;
import java.util.Collections;
import org.junit.Test;
import org.springframework.mock.env.MockEnvironment;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
......@@ -70,6 +71,7 @@ public class FeignClientsRegistrarTests {
private String testGetName(String name) {
FeignClientsRegistrar registrar = new FeignClientsRegistrar();
registrar.setEnvironment(new MockEnvironment());
return registrar.getName(Collections.<String, Object>singletonMap("name", name));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment