Using eclipse find and replace all to swap arguments

后端 未结 5 562
夕颜
夕颜 2021-02-07 20:46

I have about 100 lines that look like the below:

assertEquals(results.get(0).getID(),1);

They all start with assertEquals and contain two arguments. Im looking f

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-07 20:54

    You can also use Eclipse's built-in method signature refactoring to re-order the arguments.

    In the case of converting from JUnit to TestNG (which is what it looks like you're doing), you can copy org.testng.Assert into your project and refactor the assertXYZ methods to transpose the expected/actual arguments.

    When you're done, delete your copy of org.testng.Assert

提交回复
热议问题