ParameterizedTest with a name in Eclipse Testrunner

前端 未结 5 567
小鲜肉
小鲜肉 2021-02-06 04:04

When you run a JUnit 4 ParameterizedTest with the Eclipse TestRunner, the graphical representation is rather dumb: for each test you have a node called [0], [

5条回答
  •  心在旅途
    2021-02-06 04:32

    A code-less though not that comfortable solution is to pass enough context information to identify the test in assert messages. You will still see just testXY[0] failed but the detailed message tells you which one was that.

    assertEquals("Not the expected decision for the senator " + this.currentSenatorName + " and the law " + this.votedLaw, 
    expectedVote, actualVote);
    

提交回复
热议问题