@Test
public void testRequestFileWithExceptions() throws IOException {

    ArtifactResolutionResult result = new ArtifactResolutionResult()
            .setOriginatingArtifact(stubbedMavenArtifact)
            .addMissingArtifact(stubbedMavenArtifact);
    doReturn(stubbedMavenArtifact)
            .when(repositorySystem)
            .createArtifact(anyString(), anyString(), anyString(), anyString());
    doReturn(result)
            .when(repositorySystem)
            .resolve(any());
    Path targetDirectory = temporaryFolder.newFolder("dependencies").toPath();
    Optional<File> file = mavenRuntimeRequester.requestFile(coordinate, targetDirectory, ClassifierInformation.DEFAULT_JAR);
    assertThat(file).isEmpty();
}