// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java
// @Component
// @Aspect
// public class FooAspect {
// 
//   @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())")
//   public void pointcut() {
//   }
// 
//   @Around("pointcut()")
//   public int changeIncrementAndGet(ProceedingJoinPoint pjp) {
//     return 0;
//   }
// 
// }
// 
// Path: aop/src/main/java/me/chanjar/aop/config/AopConfig.java
// @Configuration
// @EnableAspectJAutoProxy(proxyTargetClass = true)
// @ComponentScan("me.chanjar.aop")
// public class AopConfig {
// 
// }
// 
// Path: aop/src/main/java/me/chanjar/aop/service/FooService.java
// public interface FooService {
// 
//   int incrementAndGet();
// 
// }
// 
// Path: aop/src/main/java/me/chanjar/aop/service/FooServiceImpl.java
// @Component
// public class FooServiceImpl implements FooService {
// 
//   private int count;
// 
//   @Override
//   public int incrementAndGet() {
//     count++;
//     return count;
//   }
// 
// }


import me.chanjar.aop.aspect.FooAspect;
import me.chanjar.aop.config.AopConfig;
import me.chanjar.aop.service.FooService;
import me.chanjar.aop.service.FooServiceImpl;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.springframework.test.util.AopTestUtils;
import org.testng.annotations.Test;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertTrue;
package me.chanjar.aop.ex2;



@ContextConfiguration(classes = { SpringAop_2_Test.class, AopConfig.class })
@TestExecutionListeners(listeners = MockitoTestExecutionListener.class)
public class SpringAop_2_Test extends AbstractTestNGSpringContextTests {

  @SpyBean
  private FooAspect fooAspect;

  @Autowired
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java
// @Component
// @Aspect
// public class FooAspect {
// 
//   @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())")
//   public void pointcut() {
//   }
// 
//   @Around("pointcut()")
//   public int changeIncrementAndGet(ProceedingJoinPoint pjp) {
//     return 0;
//   }
// 
// }
// 
// Path: aop/src/main/java/me/chanjar/aop/config/AopConfig.java
// @Configuration
// @EnableAspectJAutoProxy(proxyTargetClass = true)
// @ComponentScan("me.chanjar.aop")
// public class AopConfig {
// 
// }
// 
// Path: aop/src/main/java/me/chanjar/aop/service/FooService.java
// public interface FooService {
// 
//   int incrementAndGet();
// 
// }
// 
// Path: aop/src/main/java/me/chanjar/aop/service/FooServiceImpl.java
// @Component
// public class FooServiceImpl implements FooService {
// 
//   private int count;
// 
//   @Override
//   public int incrementAndGet() {
//     count++;
//     return count;
//   }
// 
// }


// Path: aop/src/test/java/me/chanjar/aop/ex2/SpringAop_2_Test.java
import me.chanjar.aop.aspect.FooAspect;
import me.chanjar.aop.config.AopConfig;
import me.chanjar.aop.service.FooService;
import me.chanjar.aop.service.FooServiceImpl;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.springframework.test.util.AopTestUtils;
import org.testng.annotations.Test;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertTrue;

package me.chanjar.aop.ex2;



@ContextConfiguration(classes = { SpringAop_2_Test.class, AopConfig.class })
@TestExecutionListeners(listeners = MockitoTestExecutionListener.class)
public class SpringAop_2_Test extends AbstractTestNGSpringContextTests {

  @SpyBean
  private FooAspect fooAspect;

  @Autowired
  private FooService fooService;