|
25 | 25 | import java.lang.reflect.Field; |
26 | 26 | import java.nio.charset.Charset; |
27 | 27 | import java.util.Arrays; |
| 28 | +import java.util.stream.Collectors; |
28 | 29 |
|
29 | 30 | import static com.google.common.base.Preconditions.checkNotNull; |
30 | 31 | import static com.tngtech.archunit.core.domain.JavaCall.Predicates.target; |
31 | 32 | import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPackage; |
32 | 33 | import static com.tngtech.archunit.core.domain.JavaClass.Predicates.type; |
33 | | -import static com.tngtech.archunit.core.domain.JavaClass.namesOf; |
34 | 34 | import static com.tngtech.archunit.core.domain.properties.HasName.Predicates.name; |
35 | 35 | import static com.tngtech.archunit.core.domain.properties.HasName.Predicates.nameContaining; |
36 | 36 | import static com.tngtech.archunit.core.domain.properties.HasOwner.Predicates.With.owner; |
@@ -61,7 +61,7 @@ public class ArchTests { |
61 | 61 | "preview has no required media types defined") { |
62 | 62 |
|
63 | 63 | @Override |
64 | | - public boolean apply(JavaAnnotation<?> javaAnnotation) { |
| 64 | + public boolean test(JavaAnnotation<?> javaAnnotation) { |
65 | 65 | boolean isPreview = javaAnnotation.getRawType().isEquivalentTo(Preview.class); |
66 | 66 | Object[] values = (Object[]) javaAnnotation.getProperties().get("value"); |
67 | 67 | return isPreview && values != null && values.length < 1; |
@@ -194,7 +194,11 @@ public static DescribedPredicate<JavaCall<?>> targetMethodIs(Class<?> owner, |
194 | 194 | .and(JavaCall.Predicates.target(name(methodName))) |
195 | 195 | .and(JavaCall.Predicates.target(rawParameterTypes(parameterTypes))) |
196 | 196 | .as("method is %s", |
197 | | - Formatters.formatMethodSimple(owner.getSimpleName(), methodName, namesOf(parameterTypes))); |
| 197 | + Formatters.formatMethodSimple(owner.getSimpleName(), |
| 198 | + methodName, |
| 199 | + Arrays.stream(parameterTypes) |
| 200 | + .map(item -> item.getName()) |
| 201 | + .collect(Collectors.toList()))); |
198 | 202 | } |
199 | 203 |
|
200 | 204 | /** |
@@ -224,8 +228,8 @@ private static class UnlessPredicate<T> extends DescribedPredicate<T> { |
224 | 228 | } |
225 | 229 |
|
226 | 230 | @Override |
227 | | - public boolean apply(T input) { |
228 | | - return current.apply(input) && !other.apply(input); |
| 231 | + public boolean test(T input) { |
| 232 | + return current.test(input) && !other.test(input); |
229 | 233 | } |
230 | 234 | } |
231 | 235 | } |
0 commit comments