单元测试新方法:用setUp方法 @Before注释

public class CentralizedPUDMatchServicePacTest {
PacMatchService pacMatchService;

@Before
public void setUp(){
pacMatchService = SpringTestHelper.get().getBean(PacMatchService.class);
}



@Test
public void testPacMatch(){

String pacAddress = "江苏省南京市玄武区珠江路435号";
DipanMatchBizAreaMatchMultiResponse response = pacMatchService.diPanMatch(pacAddress, "0000001");
// Assert.assertEquals(result.get(Constants.MATCHWAY),Constants.MATCHWAY_RANGE);
}

}

原文地址:https://www.cnblogs.com/hongming-blogs/p/8143341.html