@Test(expectedExceptions = CannotUploadExternalResourceException.class)
public void testCreateFilePathShouldRethrowIOExceptionAsCannotUploadExternalResourceException() throws IOException {

    //GIVEN
    given(fileFactory.createFile(FILE_NAME)).willReturn(file);
    given(file.getParent()).willReturn(PARENT_DIRECTORY);
    given(file.getName()).willReturn(SIMPLE_CLASS_NAME);
    given(javaClassFactory.createJavaClass(classFile, FILE_NAME)).willThrow(new IOException());
    //WHEN
    underTest.createFilePath(classFile, FILE_NAME, EXCEPTION_MESSAGE);
    //THEN error is thrown
}