Repository: hub4j/github-api
Pull request #1695 (2023-08-15 21:35:53)

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.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/TNG/ArchUnit/releases">com.tngtech.archunit:archunit's releases</a>.</em></p>
<blockquote>
<h2>ArchUnit 1.1.0</h2>
<h1>Bug Fixes</h1>
<ul>
<li>Try-Catch-Blocks declared within lambdas will now be detected correctly (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/1069">#1069</a>)</li>
<li>Fix ArchUnit not being able to find classes loaded by Spring Boot <code>ClassLoader</code> (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/1131">#1131</a>; thanks a lot to <a href="https://github.com/odrotbohm"><code>@​odrotbohm</code></a>)</li>
</ul>
<h1>Enhancements</h1>
<h2>Core</h2>
<ul>
<li>New <code>ImportOption</code> <code>DoNotIncludeGradleTestFixtures</code> (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/949">#949</a>)</li>
<li>Reduce all log levels except <code>WARN</code> to <code>TRACE</code> (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/1050">#1050</a>)</li>
</ul>
<h2>Library</h2>
<ul>
<li>Two new <code>GeneralCodingRules</code> (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/970">#970</a>; thanks a lot to <a href="https://github.com/hankem"><code>@​hankem</code></a>)
<ul>
<li><code>ASSERTIONS_SHOULD_HAVE_DETAIL_MESSAGE</code></li>
<li><code>DEPRECATED_API_SHOULD_NOT_BE_USED</code></li>
</ul>
</li>
<li><code>TextFileBasedViolationStore</code> is now part of the public API and can thus be used for customization; as a special case of this file names can now be adjusted (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/1046">#1046</a>; thanks a lot to <a href="https://github.com/danhaywood"><code>@​danhaywood</code></a>)</li>
<li><code>TextFileBasedViolationStore</code> now adds a final new line character to the violation file to better conform to the spec (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/1057">#1057</a>; thanks a lot to <a href="https://github.com/pkubowicz"><code>@​pkubowicz</code></a>)</li>
</ul>
<h2>ArchUnit 1.0.1</h2>
<h1>Bug Fixes</h1>
<ul>
<li>Fix bug where referenced class objects and instanceof checks were not detected if declared within a lambda (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/992">#992</a>)</li>
<li>Fix empty records not being detected as records (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/998">#998</a>; thanks a lot to <a href="https://github.com/hankem"><code>@​hankem</code></a>)</li>
<li>Fix Javadoc on <code>layeredArchitecture()</code> missing the new <code>consideringDependencies</code> part (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/977">#977</a>; thanks a lot to <a href="https://github.com/Thunderforge"><code>@​Thunderforge</code></a>)</li>
<li>Fix user guide still showing <code>DescribedPredicate.apply</code> instead of <code>.test</code> (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/978">#978</a>; thanks a lot to <a href="https://github.com/thmuch"><code>@​thmuch</code></a>)</li>
</ul>
<h2>ArchUnit 1.0.0</h2>
<p>:warning: If you upgrade from the latest <code>0.x</code> version, please also refer to the release notes of <a href="https://github.com/TNG/ArchUnit/releases/tag/v1.0.0-rc1">release candidate <code>1.0.0-rc1</code></a> as these release notes refer to upgrading from the release candidate :warning:</p>
<h1>Breaking Changes</h1>
<ul>
<li>Naming around <code>JavaPackage</code> subpackages and dependencies has been improved to remove ambiguities. In general, whenever all classes from a package and subpackages recursively are involved, this is now called &quot;package tree&quot;. Otherwise, it only targets the classes directly within this package (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/919">#919</a>/<a href="https://redirect.github.com/TNG/ArchUnit/issues/968">#968</a>; thanks a lot to <a href="https://github.com/grimsa"><code>@​grimsa</code></a>)
The following mapping shows how to translate the old methods to the current methods:
<ul>
<li><code>getAllClasses()</code> -&gt; <code>getClassesInPackageTree()</code></li>
<li><code>getAllSubpackages()</code> -&gt; <code>getSubpackagesInTree()</code></li>
<li><code>getClassDependenciesFromSelf()</code> -&gt; <code>getClassDependenciesFromThisPackageTree()</code></li>
<li><code>getClassDependenciesToSelf()</code> -&gt; <code>getClassDependenciesToThisPackageTree()</code></li>
<li><code>getPackageDependenciesFromSelf()</code> -&gt; <code>getPackageDependenciesFromThisPackageTree()</code></li>
<li><code>getPackageDependenciesToSelf()</code> -&gt; <code>getPackageDependenciesToThisPackageTree()</code></li>
<li><code>accept(..)</code> -&gt; <code>traversePackageTree(..)</code></li>
</ul>
</li>
<li>Importing the default package via <code>ClassFileImporter.importPackages(&quot;&quot;)</code> will now yields the same result as using <code>importClasspath()</code> without any <code>ImportOption</code> (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/954">#954</a>)</li>
<li><code>ClassFileImporter.importClasspath()</code> now behaves consistently to other import APIs. I.e. no default <code>ImportOptions</code> like <code>DoNotIncludeArchives</code> are added anymore, instead all <code>ImportOptions</code> need to be added the same way as for all other import methods (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/958">#958</a>)</li>
<li>The custom collection <code>ImportOptions</code> has been removed from the public API and been replaced by a standard <code>Collection&lt;ImportOption&gt;</code> where appropriate (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/958">#958</a>)</li>
<li>The package <code>com.tngtech.archunit.library.plantuml</code> has been moved to <code>com.tngtech.archunit.library.plantuml.rules</code> to make room for adding other PlantUML related features (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/959">#959</a>)</li>
<li>SLF4J-API has been upgraded from <code>1.7.30</code> to <code>2.0.3</code>, so any log adapter dependency to be used with ArchUnit (e.g. to hook in Log4J) has to be compatible with SLF4J-API <code>2.x</code> from now on (see <a href="https://redirect.github.com/TNG/ArchUnit/issues/966">#966</a>)</li>
</ul>
<h1>Bug Fixes</h1>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/TNG/ArchUnit/commit/7038a72f7a3731f05cd495cd460fd0f654c4b73b"><code>7038a72</code></a> prepare release 1.1.0</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/e87cd321991e9781bccab98a916a4999db481834"><code>e87cd32</code></a> fix expected release artifact versions</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/1781127676545f729abb76abe189ef74ef858f89"><code>1781127</code></a> Let <code>JarFileLocation</code> work with custom <code>ClassLoader</code> URIs (<a href="https://redirect.github.com/TNG/ArchUnit/issues/1131">#1131</a>)</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/69e3afc73dc40227bfcedd4a729b62204e3cc844"><code>69e3afc</code></a> Let JarFileLocation work with custom ClassLoader URIs.</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/3334633e46d4397c92fb29bece03ca72b7cf4e82"><code>3334633</code></a> unify URL parsing into base and path</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/49215f817dd34bac8cd1566970cf36c83523e294"><code>49215f8</code></a> resolve class file locations from <code>URLClassLoader</code> for JDK &gt; 8</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/fdbdbe2ac68d7ab24280f434aab68bad67ea778e"><code>fdbdbe2</code></a> derive <code>JarFile</code> from <code>URI</code> in a safer way</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/f364fa953a42ac9712aea9aab98a866e20dd1231"><code>f364fa9</code></a> improve tests for scanning packages with custom ClassLoader</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/3fc943b92f5d26c7bd499a705eff9c461ebc4af1"><code>3fc943b</code></a> fix <code>TestJarFile</code> creating JAR files violating the spec</li>
<li><a href="https://github.com/TNG/ArchUnit/commit/b368a2550b23cc5edb2bc43942f24fa7fad396a0"><code>b368a25</code></a> Bump com.github.spotbugs from 5.1.0 to 5.1.1 (<a href="https://redirect.github.com/TNG/ArchUnit/issues/1150">#1150</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/TNG/ArchUnit/compare/v0.23.1...v1.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.tngtech.archunit:archunit&package-manager=maven&previous-version=0.23.1&new-version=1.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/pom.xml b/pom.xml
index 3a588522a..da69a65c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -431,7 +431,7 @@
     <dependency>
       <groupId>com.tngtech.archunit</groupId>
       <artifactId>archunit</artifactId>
-      <version>0.23.1</version>
+      <version>1.1.0</version>
       <scope>test</scope>
     </dependency>
     <dependency>


Test patch:
diff --git a/src/test/java/org/kohsuke/github/ArchTests.java b/src/test/java/org/kohsuke/github/ArchTests.java
index 72a6b9c26..a460dc7db 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.io.Reader;
 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 class ArchTests {
                 .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 @@ public class ArchTests {
         }
 
         @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);
         }
     }
 }