@Test
    void removeAllWithOneImageAndImagePatternOnly() throws IOException, MojoExecutionException {
        givenProjectWithResolvedImage(singleImageWithoutBuildOrRunWithRemoveNamePattern("**:latest"));

        givenRemoveMode("all");
        givenRemoveNamePattern(null);

        givenListOfImageNames("example:latest", "example:fastest", "example:loosest");

        whenMojoExecutes();

        thenListImagesIsCalled();
        thenRemoveImageIsCalledFor("example:latest");
        thenRemoveImageIsNotCalledFor("example:fastest");
        thenRemoveImageIsNotCalledFor("example:loosest");
    }
Mock project with one image that is removed by pattern
src/test/java/io/fabric8/maven/docker/RemoveMojoTest.java