@Test public void testBeginLocalTransaction() throws Throwable { final ProceedingJoinPoint pjp = mock(ProceedingJoinPoint.class); final GlobalTransactionStepDefinition globalTransactionStepDefinition = mock(GlobalTransactionStepDefinition.class); when(pjp.proceed()).thenReturn(globalTransactionStepDefinition); businessGlobalTransactionAspectUnderTest.beginLocalTransaction(pjp); verify(mockBusinessTransactionManager, times(1)).begin(globalTransactionStepDefinition); }
@Around("globalTransactionPointcut()") public void beginLocalTransaction(ProceedingJoinPoint pjp) throws Throwable { GlobalTransactionStepDefinition pipeline = (GlobalTransactionStepDefinition) pjp.proceed(); this.businessTransactionManager.begin(pipeline); }
BusinessGlobalTransactionAspect { @Around("globalTransactionPointcut()") public void beginLocalTransaction(ProceedingJoinPoint pjp) throws Throwable { GlobalTransactionStepDefinition pipeline = (GlobalTransactionStepDefinition) pjp.proceed(); this.businessTransactionManager.begin(pipeline); } }
BusinessGlobalTransactionAspect { @Around("globalTransactionPointcut()") public void beginLocalTransaction(ProceedingJoinPoint pjp) throws Throwable { GlobalTransactionStepDefinition pipeline = (GlobalTransactionStepDefinition) pjp.proceed(); this.businessTransactionManager.begin(pipeline); } BusinessGlobalTransactionAspect(BusinessGlobalTransactionManager businessTransactionManager, ApplicationEventPublisher applicationEventPublisher); }
BusinessGlobalTransactionAspect { @Around("globalTransactionPointcut()") public void beginLocalTransaction(ProceedingJoinPoint pjp) throws Throwable { GlobalTransactionStepDefinition pipeline = (GlobalTransactionStepDefinition) pjp.proceed(); this.businessTransactionManager.begin(pipeline); } BusinessGlobalTransactionAspect(BusinessGlobalTransactionManager businessTransactionManager, ApplicationEventPublisher applicationEventPublisher); @Pointcut("@annotation(io.kermoss.trx.app.annotation.BusinessGlobalTransactional)") void globalTransactionPointcut(); @Pointcut("@annotation(io.kermoss.trx.app.annotation.CommitBusinessGlobalTransactional)") void commitLocalTransactionPointcut(); @Around("globalTransactionPointcut()") void beginLocalTransaction(ProceedingJoinPoint pjp); @Around("commitLocalTransactionPointcut()") void moveLocalTransaction(ProceedingJoinPoint pjp); }
BusinessGlobalTransactionAspect { @Around("globalTransactionPointcut()") public void beginLocalTransaction(ProceedingJoinPoint pjp) throws Throwable { GlobalTransactionStepDefinition pipeline = (GlobalTransactionStepDefinition) pjp.proceed(); this.businessTransactionManager.begin(pipeline); } BusinessGlobalTransactionAspect(BusinessGlobalTransactionManager businessTransactionManager, ApplicationEventPublisher applicationEventPublisher); @Pointcut("@annotation(io.kermoss.trx.app.annotation.BusinessGlobalTransactional)") void globalTransactionPointcut(); @Pointcut("@annotation(io.kermoss.trx.app.annotation.CommitBusinessGlobalTransactional)") void commitLocalTransactionPointcut(); @Around("globalTransactionPointcut()") void beginLocalTransaction(ProceedingJoinPoint pjp); @Around("commitLocalTransactionPointcut()") void moveLocalTransaction(ProceedingJoinPoint pjp);  }