@Test
    void removeDataWithOneBuildAndRunImage() throws IOException, MojoExecutionException {
        givenProjectWithResolvedImage(singleImageWithBuildAndRun());

        givenRemoveMode("data");

        whenMojoExecutes();

        thenHasImageIsNotCalled();
        thenRemoveImageIsNotCalledFor("example:latest");
        thenListImagesIsNotCalled();
    }
Mock project with one build image that is removed
src/test/java/io/fabric8/maven/docker/RemoveMojoTest.java