@Test
public void requestFileTestThatRequestIsComposedCorrectly() throws Exception {

    Path targetDirectory = temporaryFolder.newFolder("target").toPath();
    final String expectedJarBaseName = mir.getExpectedJarBaseName(mavenCoordinate, ClassifierInformation.DEFAULT_JAR);
    File expectedJarFile = new File(targetDirectory.toFile(), expectedJarBaseName);
    Mockito.when(defaultInvokerMock.execute(ArgumentMatchers.any(InvocationRequest.class)))
            .then((Answer<InvocationResult>) invocationOnMock -> {
                // touch expected file
                new FileOutputStream(expectedJarFile).close();
                // return dummy result
                return getDummyInvocationResult(0);
            });
    Optional<File> resultFile = mir.requestFile(mavenCoordinate, targetDirectory, ClassifierInformation.DEFAULT_JAR);
    Mockito.verify(defaultInvokerMock).execute(captor.capture());
    assertThat(resultFile.get()).isEqualTo(expectedJarFile);
    InvocationRequest invocationRequest = captor.getValue();
    Collection<String> goals = invocationRequest.getGoals();
    assertThat(goals).isNotEmpty();
    assertThat(goals).filteredOn(s -> s.contains(mavenCoordinate.getNamespace())).hasSize(1);
    assertThat(goals).filteredOn(s -> s.contains(mavenCoordinate.getName())).hasSize(1);
    assertThat(goals).filteredOn(s -> s.contains(mavenCoordinate.getVersion())).hasSize(1);
    assertThat(goals).filteredOn(s -> s.contains(targetDirectory.toString())).hasSize(1);
}