Skip to content

Drop the need for rules, setup and test methods to be public #1144

Closed as not planned
@odrotbohm

Description

@odrotbohm

As JUnit is interacting with a test class by reflection anyway, there's absolutely no need to insist on @Rule fields to be declared as public. Neither that's the case for setup methods or test methods in general.

A framework interacting with the developer's types by reflection shouldn't impose visibility rules to standard type components like fields or methods unless absolutely necessary. Right now I find myself having to add public virtually everywhere with the only effect of losing control of visibilities in my code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions