From 5ce63525e4126369bf66f81c555f01feea2d5794 Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Fri, 8 Mar 2024 15:19:01 +0100 Subject: [PATCH] Remove test that cannot run in context. --- .../description/type/TypeDescription.java | 2 +- ...orTypeVariableBindingWithRawTypesTest.java | 30 ------------------- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericVisitorSubstitutorForTypeVariableBindingWithRawTypesTest.java diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java index 701b9acf79..9685eb4807 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java @@ -1905,7 +1905,7 @@ public Generic onParameterizedType(Generic parameterizedType) { Generic ownerType = parameterizedType.getOwnerType(); List typeArguments; if (TypeDescription.AbstractBase.RAW_TYPES) { - typeArguments = Collections.emptyList(); + typeArguments = Collections.emptyList(); } else { typeArguments = new ArrayList(parameterizedType.getTypeArguments().size()); for (Generic typeArgument : parameterizedType.getTypeArguments()) { diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericVisitorSubstitutorForTypeVariableBindingWithRawTypesTest.java b/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericVisitorSubstitutorForTypeVariableBindingWithRawTypesTest.java deleted file mode 100644 index efae67faf0..0000000000 --- a/byte-buddy-dep/src/test/java/net/bytebuddy/description/type/TypeDescriptionGenericVisitorSubstitutorForTypeVariableBindingWithRawTypesTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.bytebuddy.description.type; - -import org.hamcrest.CoreMatchers; -import org.junit.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - -public class TypeDescriptionGenericVisitorSubstitutorForTypeVariableBindingWithRawTypesTest { - - @Mock - private TypeDescription.Generic visitedType, parameterizedType, rawType; - - @Test - @SuppressWarnings("unchecked") - public void testParameterizedTypeWithRawTypes() throws Exception { - System.setProperty(TypeDefinition.RAW_TYPES_PROPERTY, "true"); - MockitoAnnotations.initMocks(this); - - when(parameterizedType.asRawType()).thenReturn(rawType); - when(rawType.accept(any(TypeDescription.Generic.Visitor.class))).thenReturn(rawType); - when(parameterizedType.getTypeArguments()).thenReturn(new TypeList.Generic.Explicit(TypeDescription.Generic.OfNonGenericType.ForLoadedType.of(Object.class))); - TypeDescription.Generic result = new TypeDescription.Generic.Visitor.Substitutor.ForTypeVariableBinding(visitedType).onParameterizedType(parameterizedType); - - assertThat(result.getTypeArguments(), CoreMatchers.is(new TypeList.Generic.Explicit())); - } -}