From 06e7d69f990ba8ed51d32d2a51ea8117c7013a82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 21:35:53 +0000 Subject: [PATCH 1/2] Chore(deps-dev): Bump com.tngtech.archunit:archunit from 0.23.1 to 1.1.0 Bumps [com.tngtech.archunit:archunit](https://github.com/TNG/ArchUnit) from 0.23.1 to 1.1.0. - [Release notes](https://github.com/TNG/ArchUnit/releases) - [Commits](https://github.com/TNG/ArchUnit/compare/v0.23.1...v1.1.0) --- updated-dependencies: - dependency-name: com.tngtech.archunit:archunit dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3a588522a3..da69a65c61 100644 --- a/pom.xml +++ b/pom.xml @@ -431,7 +431,7 @@ com.tngtech.archunit archunit - 0.23.1 + 1.1.0 test From d3e23bc13e826c33ad0f3d9d6cdaa648e7303ce8 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Tue, 15 Aug 2023 15:22:00 -0700 Subject: [PATCH 2/2] Update for ArchUnit breaking changes --- src/test/java/org/kohsuke/github/ArchTests.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/kohsuke/github/ArchTests.java b/src/test/java/org/kohsuke/github/ArchTests.java index 72a6b9c267..a460dc7db8 100644 --- a/src/test/java/org/kohsuke/github/ArchTests.java +++ b/src/test/java/org/kohsuke/github/ArchTests.java @@ -25,12 +25,12 @@ import java.lang.reflect.Field; import java.nio.charset.Charset; import java.util.Arrays; +import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; import static com.tngtech.archunit.core.domain.JavaCall.Predicates.target; import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPackage; import static com.tngtech.archunit.core.domain.JavaClass.Predicates.type; -import static com.tngtech.archunit.core.domain.JavaClass.namesOf; import static com.tngtech.archunit.core.domain.properties.HasName.Predicates.name; import static com.tngtech.archunit.core.domain.properties.HasName.Predicates.nameContaining; import static com.tngtech.archunit.core.domain.properties.HasOwner.Predicates.With.owner; @@ -61,7 +61,7 @@ public class ArchTests { "preview has no required media types defined") { @Override - public boolean apply(JavaAnnotation javaAnnotation) { + public boolean test(JavaAnnotation javaAnnotation) { boolean isPreview = javaAnnotation.getRawType().isEquivalentTo(Preview.class); Object[] values = (Object[]) javaAnnotation.getProperties().get("value"); return isPreview && values != null && values.length < 1; @@ -194,7 +194,11 @@ public static DescribedPredicate> targetMethodIs(Class owner, .and(JavaCall.Predicates.target(name(methodName))) .and(JavaCall.Predicates.target(rawParameterTypes(parameterTypes))) .as("method is %s", - Formatters.formatMethodSimple(owner.getSimpleName(), methodName, namesOf(parameterTypes))); + Formatters.formatMethodSimple(owner.getSimpleName(), + methodName, + Arrays.stream(parameterTypes) + .map(item -> item.getName()) + .collect(Collectors.toList()))); } /** @@ -224,8 +228,8 @@ private static class UnlessPredicate extends DescribedPredicate { } @Override - public boolean apply(T input) { - return current.apply(input) && !other.apply(input); + public boolean test(T input) { + return current.test(input) && !other.test(input); } } }