@Test
public void shouldEstablishJaCoCoProfileUsingAnOption() throws Exception
{

    // define the JaCoCo destination file pattern
    String jacocoDestinationFileName = "jacoco-${bedrock.runtime.id}.exec";
    // create a temp file name for JaCoCo to output the code coverage report to
    File destinationFile = new File(System.getProperty("java.io.tmpdir"), jacocoDestinationFileName);
    // define the JaCoCo profile
    JacocoProfile profile = JacocoProfile.enabled("destfile=" + destinationFile);
    // build and start the SleepingApplication
    LocalPlatform platform = LocalPlatform.get();
    File          telemetricsFile;
    try (JavaApplication application = platform.launch(JavaApplication.class,
                                                       ClassName.of(SleepingApplication.class),
                                                       IPv4Preferred.yes(),
                                                       profile))
    {
        ExpressionEvaluator evaluator = new ExpressionEvaluator(application.getOptions());
        // create a File representing the JaCoCo telemetrics file
        telemetricsFile = new File(System.getProperty("java.io.tmpdir"),
                                   evaluator.evaluate(jacocoDestinationFileName, String.class));
    }
    // assert that JaCoCo created the telemetrics file (and thus the agent ran)
    assertThat(telemetricsFile.exists(), is(true));
    // assert that the telemetrics file contains something
    assertThat(telemetricsFile.length(), is(greaterThan(0L)));
}