commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [commons-lang] verhas commented on issue #461: Lang 1491
Date Sun, 06 Oct 2019 00:29:31 GMT
verhas commented on issue #461: Lang 1491
URL: https://github.com/apache/commons-lang/pull/461#issuecomment-538700575
 
 
   >Do you have a link to any JUnit 5 documentation supporting what you just said, please?
   
   https://junit.org/junit5/docs/current/user-guide/ says: "Test classes, test methods, and
lifecycle methods are not required to be public, but they must not be private."
   
   Also, note that not a single `@Test` sample method in the documentation is `public`. All
are package private.
   
   >Changing the modifier to `public`, I got the exact same output on both, with no issues/warnings,
etc.
   
   What a surprise. It works as documented.
   
   The documentation does not say they have to be public. It only says, as the documentation
also says: they can be public. It is not the library or the language that enforces them not
to be public. It is just the programming style. Leaving the test method to be `public` after
migrating from JUnit 4 to JUnit 5 is laziness and technical debt.
   
   We could do many other things as well. For example, we could declare them all as `final`.
It would be just as senseless, superfluous, useless and misleading as declaring them to be
`public`. Maybe, the `final` declaration is even less misleading as it is really a fact that
nobody is overriding these methods while declaring them `public` suggests that somebody is
calling them from outside the package, which nobody does. So my suggestion is that if we want
to declare all these methods to be `public` we also have to declare them to be `final`, which
will still be mad, but even though it makes more sense.
   
   In my reading JUnit 5 does not support public tests. It just accepts them and works with
them. It lets the programmer declare them to be public, because from the framework point of
view why not. From the programming style point of view, however ...
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message