package com; import com.aop.TargetInterface; import com.transaction_.service.AccountService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:context.xml") public class AopTest { @Autowired private TargetInterface targetInterface; @Autowired private com.anno.TargetInterface targetInterface1; @Autowired private AccountService accountService; @Test public void test() { targetInterface1.save2(); } @Test public void testInitAccount() { accountService.initAccount(); } @Test public void transform() { // 交易测试 accountService.transfer(5,4,1.0); } }