Generating JUnit stubs for new methods in existing class in Eclipse

前端 未结 3 1372
难免孤独
难免孤独 2021-02-05 05:55

This question is tangentially related to How can I create JUnit stub methods in eclipse? but it doesn\'t answer my specific question.

Assuming you have an existing JUnit

3条回答
  •  粉色の甜心
    2021-02-05 06:52

    My solution.

    I simply go through the standard 'create JUnit test case'

    Select file to test. -> New Junit test case

    Go through the normal process in creating the test case, but only select those that you want new stubs for.

    The file is created with the stubs, which I now copy into the existing test case file. Delete the newly created test file class.

    It's not the most efficient, but quicker than 'thick fingering' when you create them manually.

    David

提交回复
热议问题