// Path: address-service/src/main/java/de/codecentric/resilient/address/entity/Address.java
// @Entity
// public class Address {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     private String country;
// 
//     private String city;
// 
//     private String postcode;
// 
//     private String street;
// 
//     private String streetNumber;
// 
//     public Address() {
//     }
// 
//     /***
//      *
//      * @param country
//      * @param city
//      * @param postcode
//      * @param street
//      * @param streetNumber
//      */
//     public Address(String country, String city, String postcode, String street, String streetNumber) {
//         this.country = country;
//         this.city = city;
//         this.postcode = postcode;
//         this.street = street;
//         this.streetNumber = streetNumber;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// }
// 
// Path: address-service/src/main/java/de/codecentric/resilient/address/repository/AddressRepository.java
// public interface AddressRepository extends CrudRepository<Address, Long>, QueryByExampleExecutor<Address> {
// 
// }
// 
// Path: service-library/src/main/java/de/codecentric/resilient/configuration/DefautConfiguration.java
// @Configuration
// public class DefautConfiguration {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(DefautConfiguration.class);
// 
//     @RefreshScope
//     @Bean
//     public AbstractConfiguration archaiusConfiguration() throws Exception {
// 
//         LOGGER.info("Enable Archaius Configuration");
//         ConcurrentMapConfiguration concurrentMapConfiguration = new ConcurrentMapConfiguration();
// 
//         return concurrentMapConfiguration;
//     }
// 
//     @LoadBalanced
//     @Bean
//     RestTemplate restTemplate() {
//         return new RestTemplate();
//     }
// 
// }


import de.mrbw.chaos.monkey.EnableChaosMonkey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.sleuth.Sampler;
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
import de.codecentric.resilient.address.entity.Address;
import de.codecentric.resilient.address.repository.AddressRepository;
import de.codecentric.resilient.configuration.DefautConfiguration;
package de.codecentric.resilient.address;


/**
 * @author Benjamin Wilms
 */
@EnableChaosMonkey
@EnableDiscoveryClient
@EnableAutoConfiguration
@RefreshScope
@SpringBootApplication
@Import(DefautConfiguration.class)
@EntityScan(basePackageClasses = {AddressServiceApplication.class, Jsr310JpaConverters.class})
public class AddressServiceApplication {

    @Bean
    public Sampler sampler() {
        return new AlwaysSampler();
    }

    private static final Logger log = LoggerFactory.getLogger(AddressServiceApplication.class);

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

    @Bean
    public CommandLineRunner demo(AddressRepository repository) {
        return (args) -> {
// Path: address-service/src/main/java/de/codecentric/resilient/address/entity/Address.java
// @Entity
// public class Address {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     private String country;
// 
//     private String city;
// 
//     private String postcode;
// 
//     private String street;
// 
//     private String streetNumber;
// 
//     public Address() {
//     }
// 
//     /***
//      *
//      * @param country
//      * @param city
//      * @param postcode
//      * @param street
//      * @param streetNumber
//      */
//     public Address(String country, String city, String postcode, String street, String streetNumber) {
//         this.country = country;
//         this.city = city;
//         this.postcode = postcode;
//         this.street = street;
//         this.streetNumber = streetNumber;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// }
// 
// Path: address-service/src/main/java/de/codecentric/resilient/address/repository/AddressRepository.java
// public interface AddressRepository extends CrudRepository<Address, Long>, QueryByExampleExecutor<Address> {
// 
// }
// 
// Path: service-library/src/main/java/de/codecentric/resilient/configuration/DefautConfiguration.java
// @Configuration
// public class DefautConfiguration {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(DefautConfiguration.class);
// 
//     @RefreshScope
//     @Bean
//     public AbstractConfiguration archaiusConfiguration() throws Exception {
// 
//         LOGGER.info("Enable Archaius Configuration");
//         ConcurrentMapConfiguration concurrentMapConfiguration = new ConcurrentMapConfiguration();
// 
//         return concurrentMapConfiguration;
//     }
// 
//     @LoadBalanced
//     @Bean
//     RestTemplate restTemplate() {
//         return new RestTemplate();
//     }
// 
// }


// Path: address-service/src/main/java/de/codecentric/resilient/address/AddressServiceApplication.java
import de.mrbw.chaos.monkey.EnableChaosMonkey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.sleuth.Sampler;
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
import de.codecentric.resilient.address.entity.Address;
import de.codecentric.resilient.address.repository.AddressRepository;
import de.codecentric.resilient.configuration.DefautConfiguration;

package de.codecentric.resilient.address;


/**
 * @author Benjamin Wilms
 */
@EnableChaosMonkey
@EnableDiscoveryClient
@EnableAutoConfiguration
@RefreshScope
@SpringBootApplication
@Import(DefautConfiguration.class)
@EntityScan(basePackageClasses = {AddressServiceApplication.class, Jsr310JpaConverters.class})
public class AddressServiceApplication {

    @Bean
    public Sampler sampler() {
        return new AlwaysSampler();
    }

    private static final Logger log = LoggerFactory.getLogger(AddressServiceApplication.class);

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

    @Bean
    public CommandLineRunner demo(AddressRepository repository) {
        return (args) -> {
            repository.save(new Address("DE", "Solingen", "42697", "Hochstrasse", "11"));