File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
src/test/java/edu/hm/hafner/util Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 13
13
<exclude name =" UnusedImports" />
14
14
<exclude name =" GuardLogStatement" />
15
15
<exclude name =" AccessorMethodGeneration" />
16
+ <exclude name =" JUnit5TestShouldBePackagePrivate" />
16
17
<exclude name =" UnusedPrivateMethod" />
17
18
</rule >
18
19
<rule ref =" category/java/codestyle.xml" >
Original file line number Diff line number Diff line change @@ -40,13 +40,13 @@ private ArchitectureRules() {
40
40
.and ().doNotHaveModifier (JavaModifier .ABSTRACT )
41
41
.should ().bePublic ();
42
42
43
- /** Junit 5 test methods should not be public . */
44
- public static final ArchRule NO_PUBLIC_TEST_METHODS =
43
+ /** Junit 5 test methods should be package private . */
44
+ public static final ArchRule ONLY_PACKAGE_PRIVATE_TEST_METHODS =
45
45
methods ().that ().areAnnotatedWith (Test .class )
46
46
.or ().areAnnotatedWith (ParameterizedTest .class )
47
47
.and ().areDeclaredInClassesThat ()
48
48
.haveSimpleNameEndingWith ("Test" )
49
- .should ().notBePublic ();
49
+ .should ().bePackagePrivate ();
50
50
51
51
/** ArchUnit tests should not be public. */
52
52
public static final ArchRule NO_PUBLIC_ARCHITECTURE_TESTS =
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class ArchitectureTest {
16
16
static final ArchRule NO_PUBLIC_TEST_CLASSES = ArchitectureRules .NO_PUBLIC_TEST_CLASSES ;
17
17
18
18
@ ArchTest
19
- static final ArchRule NO_PUBLIC_TEST_METHODS = ArchitectureRules .NO_PUBLIC_TEST_METHODS ;
19
+ static final ArchRule ONLY_PACKAGE_PRIVATE_TEST_METHODS = ArchitectureRules .ONLY_PACKAGE_PRIVATE_TEST_METHODS ;
20
20
21
21
@ ArchTest
22
22
static final ArchRule NO_PUBLIC_ARCHITECTURE_TESTS = ArchitectureRules .NO_PUBLIC_ARCHITECTURE_TESTS ;
You can’t perform that action at this time.
0 commit comments