diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java index 0e7db03..c7b2dc1 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RuleSource.java @@ -32,5 +32,5 @@ package net.kemitix.checkstyle.ruleset.builder; public enum RuleSource { CHECKSTYLE, - SEVNTU; + SEVNTU, } diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RuleSourceTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RuleSourceTest.java new file mode 100644 index 0000000..3cf5562 --- /dev/null +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RuleSourceTest.java @@ -0,0 +1,33 @@ +package net.kemitix.checkstyle.ruleset.builder; + +import lombok.val; +import org.junit.Test; + +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link RuleSource}. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +public class RuleSourceTest { + + @Test + public void valueOf() throws Exception { + assertThat(RuleSource.valueOf("CHECKSTYLE")).isEqualTo(RuleSource.CHECKSTYLE); + assertThat(RuleSource.valueOf("SEVNTU")).isEqualTo(RuleSource.SEVNTU); + } + + @Test + public void values() throws Exception { + //given + val expected = Arrays.asList("CHECKSTYLE", "SEVNTU"); + //when + val values = Arrays.stream(RuleSource.values()) + .map(RuleSource::toString); + //then + assertThat(values).containsExactlyElementsOf(expected); + } +}