Skip to content

Commit

Permalink
Merge pull request #1695 from hub4j/dependabot/maven/com.tngtech.arch…
Browse files Browse the repository at this point in the history
…unit-archunit-1.1.0

Chore(deps-dev): Bump com.tngtech.archunit:archunit from 0.23.1 to 1.1.0
  • Loading branch information
bitwiseman authored Aug 15, 2023
2 parents fe653e3 + d3e23bc commit 9c00184
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
14 changes: 9 additions & 5 deletions src/test/java/org/kohsuke/github/ArchTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -194,7 +194,11 @@ public static DescribedPredicate<JavaCall<?>> 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())));
}

/**
Expand Down Expand Up @@ -224,8 +228,8 @@ private static class UnlessPredicate<T> extends DescribedPredicate<T> {
}

@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);
}
}
}

0 comments on commit 9c00184

Please sign in to comment.