Maven Dependency

 1         <dependency>
 2             <groupId>org.jmockit</groupId>
 3             <artifactId>jmockit</artifactId>
 4             <version>1.20</version>
 5             <scope>test</scope>
 6         </dependency>
 7         <dependency>
 8             <groupId>org.jmockit</groupId>
 9             <artifactId>jmockit-coverage</artifactId>
10             <version>1.20</version>
11             <scope>test</scope>
12         </dependency>
13 
14             <dependency>
15             <groupId>junit</groupId>
16             <artifactId>junit</artifactId>
17             <scope>test</scope>
18         </dependency>
19         <dependency>
20             <groupId>org.springframework</groupId>
21             <artifactId>spring-test</artifactId>
22             <scope>test</scope>
23         </dependency>            

 

JunitTest

 1     @Before
 2     public void before() {
 3         new MockUp<MockupClass>(){
 4             @Mock
 5             public String mockupMethod1(String params) throws Exception {
 6                 return "mockupValue";
 7             }
 8             @Mock
 9             public String mockupMethod2(String params) throws Exception {
10                 return"mockupValue";
11             }
12         };
View Code

 

posted on 2018-06-14 13:33  狂奔的蜗牛儿  阅读(242)  评论(0)    收藏  举报