Skip to content

Commit

Permalink
fix InterceptorDefinitionTest.testInterceptorsImplementInterceptorInt…
Browse files Browse the repository at this point in the history
…erface

This test uses an internal `ParameterizedTypeImpl` class, which isn't guaranteed
to be present in the set of interface types implemented by an interceptor
metadata class. The JDK implementation of `ParameterizedType` may be present
as well.

This commit uses the public interface `ParameterizedType` to perform this test.
  • Loading branch information
Ladicek committed May 18, 2023
1 parent dc6a835 commit b36fcea
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
import org.jboss.cdi.tck.AbstractTest;
import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder;
import org.jboss.cdi.tck.util.HierarchyDiscovery;
import org.jboss.cdi.tck.util.ParameterizedTypeImpl;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.impl.BeansXml;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
Expand All @@ -45,6 +43,7 @@
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -90,7 +89,7 @@ public static WebArchive createTestArchive() {
public void testInterceptorsImplementInterceptorInterface() {
boolean interfaceFound = false;
for (Type type : getInterfacesImplemented(getTransactionalInterceptor().getClass())) {
if (type instanceof ParameterizedTypeImpl && ((ParameterizedTypeImpl) type).getRawType().equals(Interceptor.class)) {
if (type instanceof ParameterizedType && ((ParameterizedType) type).getRawType().equals(Interceptor.class)) {
interfaceFound = true;
break;
}
Expand Down

0 comments on commit b36fcea

Please sign in to comment.