// Path: mock/src/main/java/me/chanjar/common/Bar.java
// public interface Bar {
// 
//   Set<String> getAllCodes();
// 
// }
// 
// Path: mock/src/main/java/me/chanjar/common/Foo.java
// public interface Foo {
// 
//   boolean checkCodeDuplicate(String code);
// 
// }
// 
// Path: mock/src/main/java/me/chanjar/common/FooImpl.java
// @Component
// public class FooImpl implements Foo {
// 
//   private Bar bar;
// 
//   @Override
//   public boolean checkCodeDuplicate(String code) {
//     return bar.getAllCodes().contains(code);
//   }
// 
//   @Autowired
//   public void setBar(Bar bar) {
//     this.bar = bar;
//   }
// 
// }


import me.chanjar.common.Bar;
import me.chanjar.common.Foo;
import me.chanjar.common.FooImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;
import java.util.Collections;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
package me.chanjar.spring1;




@ContextConfiguration(classes = FooImpl.class)
@TestExecutionListeners(listeners = MockitoTestExecutionListener.class)
public class Spring_1_Test extends AbstractTestNGSpringContextTests {

  @MockBean
  private Bar bar;

  @Autowired
// Path: mock/src/main/java/me/chanjar/common/Bar.java
// public interface Bar {
// 
//   Set<String> getAllCodes();
// 
// }
// 
// Path: mock/src/main/java/me/chanjar/common/Foo.java
// public interface Foo {
// 
//   boolean checkCodeDuplicate(String code);
// 
// }
// 
// Path: mock/src/main/java/me/chanjar/common/FooImpl.java
// @Component
// public class FooImpl implements Foo {
// 
//   private Bar bar;
// 
//   @Override
//   public boolean checkCodeDuplicate(String code) {
//     return bar.getAllCodes().contains(code);
//   }
// 
//   @Autowired
//   public void setBar(Bar bar) {
//     this.bar = bar;
//   }
// 
// }


// Path: mock/src/test/java/me/chanjar/spring1/Spring_1_Test.java
import me.chanjar.common.Bar;
import me.chanjar.common.Foo;
import me.chanjar.common.FooImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;
import java.util.Collections;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;

package me.chanjar.spring1;




@ContextConfiguration(classes = FooImpl.class)
@TestExecutionListeners(listeners = MockitoTestExecutionListener.class)
public class Spring_1_Test extends AbstractTestNGSpringContextTests {

  @MockBean
  private Bar bar;

  @Autowired
  private Foo foo;