@Test
    void retryIfInsufficientPortBindingInformation(
        @Mock Container container,
        @Mock ImageConfiguration imageConfiguration,
        @Mock PortMapping portMapping
    ) throws DockerAccessException {

        Mockito.doReturn("containerId")
            .when(docker).createContainer(Mockito.any(ContainerCreateConfig.class), Mockito.anyString());

        Mockito.doReturn(true).when(portMapping).needsPropertiesUpdate();
        Mockito.doReturn(container).when(queryService).getMandatoryContainer("containerId");
        Mockito.doReturn(true).when(container).isRunning();
        Mockito.doReturn(new RunImageConfiguration()).when(imageConfiguration).getRunConfiguration();

        Mockito.doThrow(new PortBindingException("5432/tcp", new Gson().fromJson("{\"5432/tcp\": []}", JsonObject.class)))
            .doReturn(ImmutableMap.of("5432/tcp", new Container.PortBinding(56741, "0.0.0.0")))
            .when(container).getPortBindings();

        String containerId = runService.createAndStartContainer(imageConfiguration, portMapping, new GavLabel("Im:A:Test"), properties, getBaseDirectory(), "blah", new Date());
        Assertions.assertEquals("containerId", containerId);
    }
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