@Test public void testInitializeWithClassListShouldParseJavaClass() throws IOException { List<String> list = new ArrayList<>(); list.add(FOLDER_NAME); Collection<File> filesInFolder = new ArrayList<>(); String classFileName = "Something.class"; String className = "Something"; File classFile = new File(classFileName); filesInFolder.add(classFile); given(fileUtils.listFiles(FOLDER)).willReturn(filesInFolder); given(javaClassFactory.createJavaClass(classFile)).willReturn(javaClass); given(javaClass.getClassName()).willReturn(className); underTest.initialize(list); verify(javaClassFactory, times(1)).createJavaClass(classFile); }
public void initialize(final List<String> everyPathAsString) { for (String resourcePath : everyPathAsString) { addClassNamesFromFolder(resourcePath); } }
ClassNameMapper { public void initialize(final List<String> everyPathAsString) { for (String resourcePath : everyPathAsString) { addClassNamesFromFolder(resourcePath); } } }
ClassNameMapper { public void initialize(final List<String> everyPathAsString) { for (String resourcePath : everyPathAsString) { addClassNamesFromFolder(resourcePath); } } ClassNameMapper(); }
ClassNameMapper { public void initialize(final List<String> everyPathAsString) { for (String resourcePath : everyPathAsString) { addClassNamesFromFolder(resourcePath); } } ClassNameMapper(); void initialize(final List<String> everyPathAsString); void put(final String simpleClassName, final String fullClassName); String get(final String simpleClassName); }
ClassNameMapper { public void initialize(final List<String> everyPathAsString) { for (String resourcePath : everyPathAsString) { addClassNamesFromFolder(resourcePath); } } ClassNameMapper(); void initialize(final List<String> everyPathAsString); void put(final String simpleClassName, final String fullClassName); String get(final String simpleClassName);  }