@Test
public void testLoadExternalClassShouldAddJarFilesInFolderPathToClassPathWhenBeanWasNotFound() {

    //GIVEN
    given(beanRegistryService.getBean(BEAN_NAME, INTERFACE_TO_CAST)).willThrow(new NoSuchBeanDefinitionException("error"));
    Collection<File> jarFiles = new ArrayList<>();
    File one = new File("one");
    File two = new File("two");
    jarFiles.add(one);
    jarFiles.add(two);
    given(fileUtils.listFiles(folder, "jar")).willReturn(jarFiles);
    //WHEN
    underTest.loadExternalClass(PACKAGE_NAME, JAR_FOLDER_PATH, INTERFACE_TO_CAST);
    //THEN
    verify(classPathExtender).addFile(one.getPath());
    verify(classPathExtender).addFile(two.getPath());
}