// Path: configuration/src/main/java/me/chanjar/configuration/service/Bar.java
// public class Bar {
// 
//   private final String name;
// 
//   public Bar(String name) {
//     this.name = name;
//   }
// 
//   public String getName() {
//     return name;
//   }
// }


import me.chanjar.configuration.service.Bar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
package me.chanjar.configuration.ex4;


@Configuration
@EnableConfigurationProperties(BarConfiguration.BarProperties.class)
public class BarConfiguration {

  @Autowired
  private BarProperties barProperties;

  @Bean
// Path: configuration/src/main/java/me/chanjar/configuration/service/Bar.java
// public class Bar {
// 
//   private final String name;
// 
//   public Bar(String name) {
//     this.name = name;
//   }
// 
//   public String getName() {
//     return name;
//   }
// }


// Path: configuration/src/test/java/me/chanjar/configuration/ex4/BarConfiguration.java
import me.chanjar.configuration.service.Bar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

package me.chanjar.configuration.ex4;


@Configuration
@EnableConfigurationProperties(BarConfiguration.BarProperties.class)
public class BarConfiguration {

  @Autowired
  private BarProperties barProperties;

  @Bean
  public Bar bar() {