dgroup / docker-unittests

Testing of base docker images during CI/CD process
MIT License
35 stars 4 forks source link

False.java:35: Remove the class. Use {@code new... #182

Closed 0pdd closed 5 years ago

0pdd commented 5 years ago

The puzzle DEV-459facf2 from #DEV has to be resolved:

https://github.com/dgroup/docker-unittests/blob/1d6026641ccae85de2adb735e310b1bbed720cd4/src/main/java/com/github/dgroup/dockertest/hamcrest/False.java#L35-L35

The puzzle was created by Yurii Dubinka on 15-Dec-18.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be \"done\" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

bodax commented 5 years ago

@dgroup How to use this strucutre "Use {@code new IsEqual<>(false)}"?

dgroup commented 5 years ago

@bodax , for example, this test com.github.dgroup.dockertest.cmd.ArgAtTest#notSpecified is using False

    @Test
    public void notSpecified() {
        MatcherAssert.assertThat(
            new ArgOf(
                "-o",
                new ListOf<>(
                    "-f", "single-test.yml",
                    "-i", "alpine:jdk9"
                ),
                "Argument `-o` wasn't found"
            ).specifiedByUser(),
            new False()
        );
    }

this can be rewriten as

    @Test
    public void notSpecified() {
        MatcherAssert.assertThat(
            new ArgOf(
                "-o",
                new ListOf<>(
                    "-f", "single-test.yml",
                    "-i", "alpine:jdk9"
                ),
                "Argument `-o` wasn't found"
            ).specifiedByUser(),
            new IsNot<>(new IsTrue())
        );
    }

where IsNot is org.hamcrest.core.IsNot, and IsTrue is org.llorllale.cactoos.matchers.IsTrue The key problem that IsTrue matcher wasn't released yet, but I hope it will be done soon https://github.com/llorllale/cactoos-matchers/issues/76

bodax commented 5 years ago

@dgroup, please check this issue, i did it with #181.

dgroup commented 5 years ago

@bodax thanks, closed.