use of com.tngtech.archunit.junit.internal.ClassCache.CacheClassFileImporter in project ArchUnit by TNG.
the class ClassCacheTest method if_whole_classpath_is_set_true_then_the_whole_classpath_is_imported.
@Test
public void if_whole_classpath_is_set_true_then_the_whole_classpath_is_imported() {
TestAnalysisRequest defaultOptions = new TestAnalysisRequest().withWholeClasspath(true);
Class<?>[] expectedImportResult = new Class[] { getClass() };
doReturn(new ClassFileImporter().importClasses(expectedImportResult)).when(cacheClassFileImporter).importClasses(any(ImportOptions.class), ArgumentMatchers.<Location>anyCollection());
JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, defaultOptions);
assertThatTypes(classes).matchExactly(expectedImportResult);
verify(cacheClassFileImporter).importClasses(any(ImportOptions.class), locationCaptor.capture());
assertThat(locationCaptor.getValue()).has(locationContaining("archunit")).has(locationContaining("asm")).has(locationContaining("google")).has(locationContaining("mockito"));
}
Aggregations