These are chat archives for spring-cloud/spring-cloud

22nd
Sep 2017
rt-i
@rt-i
Sep 22 2017 12:26
are here some spring cloud feign developers?
Hullaert Christof
@cHullaert
Sep 22 2017 12:27
I used a little bit but I'm not a expert, that was with netflix stack
rt-i
@rt-i
Sep 22 2017 12:29
in the class FeignClientFactoryBean (1.3.4) line 83, why is it FeignContext application context passed and not the whole applicationContext of the current Test? I think because of that there can't be injected mocked beans (mentioned in spring-cloud/spring-cloud-netflix#2286)
Spencer Gibb
@spencergibb
Sep 22 2017 12:32
Otherwise, you wouldn't be able to customize beans per feign client. They would apply to every client.
rt-i
@rt-i
Sep 22 2017 12:33
I could understand it. But how can I inject my mocked beans in that case? i.e. mocked RequestInterceptor
Spencer Gibb
@spencergibb
Sep 22 2017 12:34
Customize the @FeignClient according to the docs with a mock as an @Bean.
rt-i
@rt-i
Sep 22 2017 12:35
mmm, nice idea. I'll try.
Spencer Gibb
@spencergibb
Sep 22 2017 12:35
that is what we do in spring-cloud-netflix
rt-i
@rt-i
Sep 22 2017 12:36
you mean generating nice ideas :) ?
Hullaert Christof
@cHullaert
Sep 22 2017 12:36
they do that also.
rt-i
@rt-i
Sep 22 2017 13:47

@spencergibb I played around on it a bit. Me is not clear what did you mean exactly with

Customize the @FeignClient according to the docs with a mock as an @Bean

If I want to use the customized @FeignClient in my SpringBootTest I'll need probably to define some @TestConfiguration where I define new @FeignClient @Bean with configuration parameter in the annotation, which contains mocked beans. But what if I want to have in my test almost the same @FeignClient annotation (with all params) like in readl feign client? There no inheritance of annotations.

rt-i
@rt-i
Sep 22 2017 14:13
This is the code for the case:
    @TestConfiguration
    @EnableFeignClients(clients = TestConfig.ClientMock.class)
    static class TestConfig {
        @FeignClient(name = "Client", url = "${service.url}", decode404 = true,
                configuration = ClientMockConfig.class, fallbackFactory = ClientFallbackFactory.class)
        interface ClientMock extends RealFeignClientInterfaceWithSimilarFeignClientAnnotation {

        }

        @Configuration
        static class ClientMockConfig extends RealClientConfigWithSomeBeans {
            public ClientMockConfig(SomeProperties someProperties) {
                super(someProperties);
            }

            @Bean
            @Override
            public RequestInterceptor oauth2FeignRequestInterceptor() {
                return mock(RequestInterceptor.class);
            }
        }
    }
if you meant this, it's kinda ugly
restwzeasy
@restwzeasy
Sep 22 2017 15:12
Is this the right forum to ask questions about Spring Cloud Vault?
prakash
@prakashdhulipal_twitter
Sep 22 2017 18:12
shall I get any help for my question "spring cloud is not working in Predix environment"
José Vieira Neto
@NetoDevel
Sep 22 2017 19:54

Hello everyone, I'm trying to build an architecture with eureka, zuul, and two microservices one microservice with another spring-boot with rails.

I'm trying to use feign-Client to consume the microservice rails from the spring-boot microservice.

post Eureka:
https://gist.github.com/NetoDevel/f2e2e7214a3ce08d511bcbfdeb0f792d

error:
Connection refused executing GET http: // MICROSERVICE-RAILS / endpoint

Screenshot from 2017-09-22 16:53:45.png
José Vieira Neto
@NetoDevel
Sep 22 2017 20:36

I got it.
Sorry was the wrong address on json ..

solution:
https://gist.github.com/NetoDevel/ae5d62e45c9b64a6eac453342875a42f