Skip to content

Commit 429b59b

Browse files
authored
blacklist some methods (#2)
* blacklist some methods * fix ordering
1 parent bccff94 commit 429b59b

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

lombok.config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
config.stopBubbling = true
2+
3+
# Required for NullAway to work
4+
lombok.addLombokGeneratedAnnotation = true
5+
6+
# Copy JSpecify annotations to generated code (constructors, getters, setters)
7+
lombok.copyableAnnotations += org.jspecify.annotations.Nullable
8+
lombok.copyableAnnotations += org.jspecify.annotations.NonNull
9+
lombok.addNullAnnotations = jspecify

src/main/java/it/aboutbits/archunit/toolbox/ArchitectureTestBase.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public abstract class ArchitectureTestBase {
2828
Set.of(
2929
// We should use `assertThatExceptionOfType(...).isThrownBy(...)` instead of `assertThatThrownBy(...)`
3030
"org.assertj.core.api.Assertions.assertThatThrownBy",
31+
"org.junit.jupiter.api.Assertions.assertThrows",
32+
"org.junit.jupiter.api.Assertions.assertDoesNotThrow",
3133
// assertThat (allowed is only org.assertj.core.api.Assertions.assertThat)
3234
"org.assertj.core.api.AssertionsForClassTypes.assertThat",
3335
"org.assertj.core.api.AssertionsForClassTypes.assertThatCode",
@@ -49,6 +51,16 @@ public abstract class ArchitectureTestBase {
4951
"org.junit.Assert.assertThrows",
5052
"org.junit.Assert.assertTrue",
5153
"org.junit.Assert.fail",
54+
// use assertThat (org.assertj.core.api.Assertions.assertThat)
55+
"org.junit.jupiter.api.Assertions.assertArrayEquals",
56+
"org.junit.jupiter.api.Assertions.assertEquals",
57+
"org.junit.jupiter.api.Assertions.assertFalse",
58+
"org.junit.jupiter.api.Assertions.assertInstanceOf",
59+
"org.junit.jupiter.api.Assertions.assertIterableEquals",
60+
"org.junit.jupiter.api.Assertions.assertNotEquals",
61+
"org.junit.jupiter.api.Assertions.assertNotNull",
62+
"org.junit.jupiter.api.Assertions.assertNull",
63+
"org.junit.jupiter.api.Assertions.assertTrue",
5264
"org.testcontainers.shaded.org.hamcrest.MatcherAssert.assertThat"
5365
)
5466
);
@@ -508,11 +520,11 @@ public void check(JavaClass testClass, ConditionEvents events) {
508520

509521
/* ****************************************************************** */
510522

511-
private static String getTestClassSuffixRegex() {
523+
protected static String getTestClassSuffixRegex() {
512524
return "(" + String.join("|", TEST_CLASS_SUFFIXES) + ")$";
513525
}
514526

515-
private static String getTestClassRegex() {
527+
protected static String getTestClassRegex() {
516528
return ".+%s".formatted(getTestClassSuffixRegex());
517529
}
518530
}

0 commit comments

Comments
 (0)