use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_imports_complex_generic_code_unit_parameter_type_with_multiple_nested_actual_type_arguments_with_concrete_array_bounds.
@Test
@UseDataProvider
public void test_imports_complex_generic_code_unit_parameter_type_with_multiple_nested_actual_type_arguments_with_concrete_array_bounds(JavaCodeUnit codeUnit) {
JavaType genericParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericParameterType).hasActualTypeArguments(parameterizedType(List.class).withTypeArguments(Serializable[].class), parameterizedType(List.class).withWildcardTypeParameterWithUpperBound(Serializable[][].class), parameterizedType(Map.class).withTypeArguments(wildcardType().withLowerBound(String[].class), parameterizedType(Map.class).withTypeArguments(parameterizedType(Map.class).withTypeArguments(wildcardType().withLowerBound(String[][][].class), wildcardType()), concreteClass(Serializable[][].class))));
}
use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_imports_generic_code_unit_parameter_type_with_actual_type_arguments_with_multiple_wildcards_with_various_bounds.
@Test
@UseDataProvider
public void test_imports_generic_code_unit_parameter_type_with_actual_type_arguments_with_multiple_wildcards_with_various_bounds(JavaCodeUnit codeUnit) {
JavaType genericParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericParameterType).as("generic parameter type").hasActualTypeArguments(parameterizedType(ClassParameterWithSingleTypeParameter.class).withTypeArguments(parameterizedType(Map.class).withWildcardTypeParameters(wildcardType().withUpperBound(Serializable.class), wildcardType().withLowerBound(File.class))), parameterizedType(ClassParameterWithSingleTypeParameter.class).withTypeArguments(parameterizedType(Reference.class).withWildcardTypeParameterWithLowerBound(String.class)));
}
use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_imports_type_variable_as_generic_code_unit_parameter_type.
@Test
@UseDataProvider
public void test_imports_type_variable_as_generic_code_unit_parameter_type(JavaCodeUnit codeUnit) {
JavaType genericMethodParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericMethodParameterType).as("generic parameter type").isInstanceOf(JavaTypeVariable.class).hasErasure(String.class);
}
use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_imports_generic_code_unit_parameter_type_with_actual_type_argument_parameterized_with_type_variable.
@Test
@UseDataProvider
public void test_imports_generic_code_unit_parameter_type_with_actual_type_argument_parameterized_with_type_variable(JavaCodeUnit codeUnit) {
JavaType genericParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericParameterType).as("generic parameter type").hasActualTypeArguments(parameterizedType(ClassParameterWithSingleTypeParameter.class).withTypeArguments(typeVariable("OF_CLASS")));
}
use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_creates_new_stub_type_variables_for_type_variables_of_enclosing_classes_that_are_out_of_context_for_generic_code_unit_parameter_type_of_inner_class.
@Test
@UseDataProvider
public void test_creates_new_stub_type_variables_for_type_variables_of_enclosing_classes_that_are_out_of_context_for_generic_code_unit_parameter_type_of_inner_class(JavaCodeUnit codeUnit) {
JavaType genericParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericParameterType).as("generic parameter type").hasActualTypeArguments(typeVariable("OUTER").withoutUpperBounds());
}
Aggregations