Menu

#1197 JUnit4TestShouldUseTestAnnotation for private method

PMD-5.3.0
closed
None
PMD
3-Major
Bug
PMD 5.1.1
2015-04-01
2014-05-07
No

JUnit4TestShouldUseTestAnnotation is given for a private method that starts with "test". AFAIK only public methods (that return void?) can be called by JUnit, so perhaps the check could verify at least that the method is public?

I'm Using PMD 5.1.1 via Eclipse plugin 4.0.3 4.0.3.v20140427-0831

 public class Faa
 {
    @Test
    public void test()
    {
        testHelper();
        fail( "Not yet implemented" );
    }

    private boolean testHelper()  // <- JUnit4TestShouldUseTestAnnotation
    {
        return false;
    }
 }

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-03-27
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-Next
     
  • Andreas Dangel

    Andreas Dangel - 2015-03-27

    Will be fixed with the next version.

     

Log in to post a comment.