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_one_type_argument.
@Test
@UseDataProvider
public void test_imports_generic_code_unit_parameter_type_with_one_type_argument(JavaCodeUnit codeUnit) {
JavaType genericParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericParameterType).as("generic parameter type").hasErasure(ClassParameterWithSingleTypeParameter.class).hasActualTypeArguments(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_primitive_array_type_argument.
@Test
@UseDataProvider
public void test_imports_generic_code_unit_parameter_type_with_primitive_array_type_argument(JavaCodeUnit codeUnit) {
JavaType genericMethodParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericMethodParameterType).as("generic parameter type").hasErasure(ClassParameterWithSingleTypeParameter.class).hasActualTypeArguments(int[].class);
}
use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_references_outer_type_variable_assigned_to_actual_type_argument_of_generic_code_unit_parameter_type_of_inner_class.
@Test
@UseDataProvider
public void test_references_outer_type_variable_assigned_to_actual_type_argument_of_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").withUpperBounds(String.class));
}
use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_imports_wildcards_of_generic_code_unit_parameter_type_bound_by_type_variables_of_enclosing_classes.
@Test
@UseDataProvider
public void test_imports_wildcards_of_generic_code_unit_parameter_type_bound_by_type_variables_of_enclosing_classes(JavaCodeUnit codeUnit) {
JavaType genericParameterType = codeUnit.getParameterTypes().get(0);
assertThatType(genericParameterType).as("generic parameter type").hasActualTypeArguments(parameterizedType(ClassParameterWithSingleTypeParameter.class).withWildcardTypeParameterWithUpperBound(typeVariable("OUTER_ONE").withUpperBounds(String.class)), parameterizedType(ClassParameterWithSingleTypeParameter.class).withWildcardTypeParameterWithLowerBound(typeVariable("OUTER_TWO").withUpperBounds(Serializable.class)));
}
use of com.tngtech.archunit.core.domain.JavaType in project ArchUnit by TNG.
the class ClassFileImporterGenericCodeUnitParameterTypesTest method test_imports_non_generic_code_unit_parameter_type.
@Test
@UseDataProvider
public void test_imports_non_generic_code_unit_parameter_type(JavaCodeUnit codeUnit, Class<?> expectedParameterType) {
JavaType parameterType = codeUnit.getParameterTypes().get(0);
assertThatType(parameterType).as("parameter type").matches(expectedParameterType);
}
Aggregations