From a80799024624ae1ab503b77340e1d27d1fd3e4ad Mon Sep 17 00:00:00 2001 From: Vedran Pavic Date: Mon, 15 Jan 2024 20:48:03 +0100 Subject: [PATCH 1/2] Allow static import of AssertJ BDDAssertions --- .../checkstyle/check/SpringAvoidStaticImportCheck.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java b/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java index 255316b0..33d9e20c 100644 --- a/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java +++ b/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ public class SpringAvoidStaticImportCheck extends AvoidStaticImportCheck { excludes.add("io.restassured.RestAssured.*"); excludes.add("org.assertj.core.api.Assertions.*"); excludes.add("org.assertj.core.api.Assumptions.*"); + excludes.add("org.assertj.core.api.BDDAssertions.*"); excludes.add("org.assertj.core.api.HamcrestCondition.*"); excludes.add("org.awaitility.Awaitility.*"); excludes.add("org.hamcrest.CoreMatchers.*"); From 3237a35aad35a36758e894fc22ab9e34ae5c98f3 Mon Sep 17 00:00:00 2001 From: Vedran Pavic Date: Mon, 15 Jan 2024 20:59:45 +0100 Subject: [PATCH 2/2] Remove duplicate excludes in SpringAvoidStaticImportCheck --- .../checkstyle/check/SpringAvoidStaticImportCheck.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java b/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java index 33d9e20c..2285dd79 100644 --- a/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java +++ b/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringAvoidStaticImportCheck.java @@ -47,7 +47,6 @@ public class SpringAvoidStaticImportCheck extends AvoidStaticImportCheck { excludes.add("org.junit.internal.matchers.ThrowableMessageMatcher.*"); excludes.add("org.junit.jupiter.api.Assertions.*"); excludes.add("org.junit.jupiter.api.Assumptions.*"); - excludes.add("org.junit.jupiter.api.Assertions.*"); excludes.add("org.mockito.ArgumentMatchers.*"); excludes.add("org.mockito.BDDMockito.*"); excludes.add("org.mockito.Matchers.*");