>  Q&A  >  본문

请问如何将如下的java代码用scala写?


@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);
    }

}
PHP中文网PHP中文网2741일 전291

모든 응답(1)나는 대답할 것이다

  • 迷茫

    迷茫2017-04-18 09:08:13

    idea의 scala 플러그인은 Java를 Scala로 자동 변환할 수 있습니다

    회신하다
    0
  • 취소회신하다