package org.springframework.cloud.netflix.feign;

import feign.Contract;
import feign.Logger;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.cloud.netflix.archaius.ArchaiusAutoConfiguration;

/**
 * @author Spencer Gibb
 */
@Configuration
@AutoConfigureAfter(ArchaiusAutoConfiguration.class)
public class FeignAutoConfiguration {
    @Bean
    SpringDecoder feignDecoder() {
        return new SpringDecoder();
    }

    @Bean
    SpringEncoder feignEncoder() {
        return new SpringEncoder();
    }

    @Bean
    public Logger feignLogger() {
        //return new Slf4jLogger(); //TODO pass Client classname in
        return new Logger.JavaLogger();
    }

    @Bean
    public Contract feignContract() {
        return new SpringMvcContract();
    }
}

@@ -66,16 +66,36 @@
 ntract;%0A
+import feign.Feign;%0A
 import f
@@ -169,24 +169,100 @@
 igureAfter;%0A
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;%0A
 import org.s
@@ -487,16 +487,49 @@
 uration%0A
+@ConditionalOnClass(Feign.class)%0A
 @AutoCon

make FeignAutoConfiguration conditional on class Feign.class