/*
 * Copyright © 2017 the original authors (http://cereebro.io)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.cereebro.sample.netflix.snitch;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import io.cereebro.core.annotation.ConsumerHint;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackageClasses = CereebroSampleNetflixSnitchApplication2.class)
public class CereebroSampleNetflixSnitchApplication2 {

    public static void main(String[] args) {
        SpringApplication.run(CereebroSampleNetflixSnitchApplication2.class, args);
    }

    /** Detected as a dependency to sample app1. */
    @FeignClient(name = "cereebro-sample-netflix-app1")
    public static interface SampleApp1Client {

        @RequestMapping("/health")
        Health getHealth();
    }

    /** Other dependency. */
    @FeignClient(name = "jsonplaceholder-typicode-com", url = "https://jsonplaceholder.typicode.com")
    public static interface JsonPlaceHolderApiClient {

        @RequestMapping("/posts/{postId}")
        String getPost(String postId);

    }

    @ConsumerHint(name = "you", type = "human")
    @Component
    public static class You {

    }

}

@@ -2057,19 +2057,25 @@
 name = %22
-you
+fancy-app
 %22, type 
@@ -2081,13 +2081,34 @@
  = %22
-human
+application/mobile/android
 %22)%0A 

Change sample consumer