@RunWith(Parameterized.class)
public class MeetingHttpApiTest extends TestBase {
@Test
public void testMeetingHttpApi() {
TedaCaseVo tedaCaseVo = tedaCaseService.getTedaCase(tedaCaseId);
String url = tedaCaseVo.getParamJsonStr();
TedaTool.record(tedaCaseVo, SwordHttp.get(url), tedaCaseService);
}
@Parameters
public static Collection data() {
return Arrays.asList(new Object[][]{{22L}, {23L}, {24L},{25L}, {26L}, {27L}});
}
public MeetingHttpApiTest(Long tedaCaseId) {
this.tedaCaseId = tedaCaseId;
}
protected Long tedaCaseId = 1L;
}
其中,TestBase类:
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
public class TestBase {
@Autowired
protected TedaCaseService tedaCaseService;
private TestContextManager testContextManager;
@Before
public void setUpContext() throws Exception {
this.testContextManager = new TestContextManager(getClass());
this.testContextManager.prepareTestInstance(this);
}
}
idea의 scala 플러그인은 Java를 Scala로 자동 변환할 수 있습니다