@Test
  public void testDockerDaemon_simpleWithIncompatibleJava11() {
    assumeTrue(isJavaRuntimeAtLeast(11));

    Exception exception =
        assertThrows(
            UnexpectedBuildFailure.class,
            () ->
                JibRunHelper.buildToDockerDaemonAndRun(
                    simpleTestProject, "willnotbuild", "build-java11-incompatible.gradle"));
    assertThat(exception)
        .hasMessageThat()
        .contains(
            "Your project is using Java 11 but the base image is for Java 8, perhaps you should "
                + "configure a Java 11-compatible base image using the 'jib.from.image' parameter, "
                + "or set targetCompatibility = 8 or below in your build configuration");
  }
Asserts that the test project has the required exposed ports, labels and volumes.

@param imageReference the image to test
@throws IOException if the {@code docker inspect} command fails to run
@throws InterruptedException if the {@code docker inspect} command is interrupted
jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/SingleProjectIntegrationTest.java