I have the following configuration:
@SpringBootApplication
@EnableFeignClients
public class Application {
@FeignClient(name = "theclient")
public interface TheClient {
...
theclient:
ribbon:
listOfServers: http://server:8080
And have the following test:
@RunWith(SpringRunner.class)
@RestClientTest(TheClient.class)
@ImportAutoConfiguration(
classes = {
RibbonAutoConfiguration.class,
FeignRibbonClientAutoConfiguration.class,
FeignAutoConfiguration.class
}
)
public class TheClientTest {
...
The error I get is Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: theclient
as if the application.yaml
was not read. If I add, however, a config.properties
file with the theclient.ribbon.listOfServers=http://server:8080
, the tests works and passes.
With @TestPropertySource("classpath:application.yaml")
I see in the logs propertySourceLocations = '{classpath:application.yaml}'
but I will get the same error.
I also tried to disable ribbon, by adding:
spring:
cloud:
loadbalancer:
ribbon:
enable: false
but it won't work.
I appreciate your input and help.