@Test
public void testLoadExternalClassShouldInstantiateClassWhenBeanWasNotFound() throws InstantiationException, IllegalAccessException,
    InvocationTargetException {

    //GIVEN
    given(beanRegistryService.getBean(BEAN_NAME, INTERFACE_TO_CAST)).willThrow(new NoSuchBeanDefinitionException("error"));
    Collection<File> jarFiles = new ArrayList<>();
    given(fileUtils.listFiles(folder, "jar")).willReturn(jarFiles);
    DummySequenceHandler externalClass = new DummySequenceHandler();
    given(classInstantiator.createClassInstanceOf(DummySequenceHandler.class)).willReturn(externalClass);
    //WHEN
    Object result = underTest.loadExternalClass(PACKAGE_NAME, JAR_FOLDER_PATH, INTERFACE_TO_CAST);
    //THEN
    verify(logger).info(Mockito.anyString(), Mockito.anyObject(), Mockito.anyObject(), Mockito.anyObject());
    assertNotNull(result);
}