@Test
public void testRequestFileWithSuccess() throws IOException {

    File artifactFile = temporaryFolder.newFile("downloadedJar.jar");
    stubbedMavenArtifact.setFile(artifactFile);
    ArtifactResolutionResult result  = new ArtifactResolutionResult()
            .setOriginatingArtifact(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).isPresent();
    assertThat(Arrays.stream(targetDirectory.toFile().listFiles())
            .anyMatch(f -> f.equals(file.get()))).isTrue();
}