-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add JUnit5-support for @ArchTest-annotated instance methods in abstra…
…ct base class This corresponds to 625c3d6, which added the same feature for JUnit4 (Issue: #104). Signed-off-by: Manfred Hanke <[email protected]>
- Loading branch information
1 parent
7949155
commit f3ea378
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ch/archunit/junit/internal/testexamples/abstractbase/AbstractBaseClassWithMethodRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.tngtech.archunit.junit.internal.testexamples.abstractbase; | ||
|
||
import com.tngtech.archunit.core.domain.JavaClasses; | ||
import com.tngtech.archunit.junit.ArchTest; | ||
import com.tngtech.archunit.junit.internal.testexamples.RuleThatFails; | ||
import com.tngtech.archunit.junit.internal.testexamples.UnwantedClass; | ||
|
||
public abstract class AbstractBaseClassWithMethodRule { | ||
public static final String INSTANCE_METHOD_NAME = "abstractBaseClassInstanceMethod"; | ||
|
||
@ArchTest | ||
void abstractBaseClassInstanceMethod(JavaClasses classes) { | ||
RuleThatFails.on(UnwantedClass.CLASS_VIOLATING_RULES).check(classes); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...junit/internal/testexamples/abstractbase/ArchTestWithAbstractBaseClassWithMethodRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.tngtech.archunit.junit.internal.testexamples.abstractbase; | ||
|
||
import com.tngtech.archunit.junit.AnalyzeClasses; | ||
|
||
@AnalyzeClasses(packages = "some.dummy.package") | ||
public class ArchTestWithAbstractBaseClassWithMethodRule extends AbstractBaseClassWithMethodRule { | ||
} |