@Test
    void shutdownWithPreStopExecConfig() throws DockerAccessException, ExecException {
        Mockito.doReturn("execContainerId")
            .when(docker)
            .createExecContainer(Mockito.eq(container), Mockito.any(Arguments.class));

        Mockito.doReturn(new ExecDetails(JsonFactory.newJsonObject("{\"Running\":true}"))).when(docker).getExecContainer("execContainerId");

        long start = System.currentTimeMillis();
        runService.stopContainer(container, createImageConfigWithExecConfig(SHUTDOWN_WAIT), true, false);
        Assertions.assertTrue(System.currentTimeMillis() - start < SHUTDOWN_WAIT, "No wait");

        verifyStop(0);
    }
This test need to be refactored. In fact, testing Mojos must be setup correctly at all. Blame on me that there are so
few tests ...
src/test/java/io/fabric8/maven/docker/service/RunServiceTest.java