Search in sources :

Example 1 with ClassWithNestedClass

use of com.tngtech.archunit.core.importer.testexamples.nestedimport.ClassWithNestedClass in project ArchUnit by TNG.

the class ClassFileImporterTest method handles_static_modifier_of_nested_classes.

@Test
public void handles_static_modifier_of_nested_classes() {
    JavaClasses classes = new ClassFileImporter().importUrl(getClass().getResource("testexamples/nestedimport"));
    assertThat(classes.get(ClassWithNestedClass.class).getModifiers()).as("modifiers of ClassWithNestedClass").doesNotContain(STATIC);
    assertThat(classes.get(ClassWithNestedClass.NestedClass.class).getModifiers()).as("modifiers of ClassWithNestedClass.NestedClass").doesNotContain(STATIC);
    assertThat(classes.get(ClassWithNestedClass.StaticNestedClass.class).getModifiers()).as("modifiers of ClassWithNestedClass.StaticNestedClass").contains(STATIC);
    assertThat(classes.get(ClassWithNestedClass.NestedInterface.class).getModifiers()).as("modifiers of ClassWithNestedClass.NestedInterface").contains(STATIC);
    assertThat(classes.get(ClassWithNestedClass.StaticNestedInterface.class).getModifiers()).as("modifiers of ClassWithNestedClass.StaticNestedInterface").contains(STATIC);
}
Also used : JavaClasses(com.tngtech.archunit.core.domain.JavaClasses) ClassWithNestedClass(com.tngtech.archunit.core.importer.testexamples.nestedimport.ClassWithNestedClass) Test(org.junit.Test)

Aggregations

JavaClasses (com.tngtech.archunit.core.domain.JavaClasses)1 ClassWithNestedClass (com.tngtech.archunit.core.importer.testexamples.nestedimport.ClassWithNestedClass)1 Test (org.junit.Test)1