How do I mock a TransactionManager in a JUnit test, (outside of the container)?

后端 未结 2 1505
臣服心动
臣服心动 2021-01-08 00:57

I\'m using Spring 3.1.0.RELEASE, JUnit 4.8.1, and ultimately deploying my application to a JBoss 4.2 server (I know, I know). As part of setting up my unit test, I have thi

2条回答
  •  有刺的猬
    2021-01-08 01:43

    You can also use Mockito:

    PlatformTransactionManager manager = mock(PlatformTransactionManager.class);
    

提交回复
热议问题