lombok-pg -

lombok
Annotation Type VisibleForTesting


@Target(value={METHOD,TYPE})
@Retention(value=SOURCE)
public @interface VisibleForTesting

An annotation that indicates that the visibility of a type or member has been relaxed to make the code testable.

All you have to do is change the visibility of the method or type as much as you need to access them in the tests.
This annotation guarantees that the method or type can only be accessed from within a test class. For a class to be recognized as a test class its name has to contain 'Test'.


lombok-pg -

Copyright © 2010-2011 Philipp Eichhorn, licensed under the MIT licence.