builder:RuleSourceTest: added
Replace final delimiter in RuleSource.
This commit is contained in:
parent
a31b2d81d3
commit
9b3f0869ea
2 changed files with 34 additions and 1 deletions
|
@ -32,5 +32,5 @@ package net.kemitix.checkstyle.ruleset.builder;
|
||||||
public enum RuleSource {
|
public enum RuleSource {
|
||||||
|
|
||||||
CHECKSTYLE,
|
CHECKSTYLE,
|
||||||
SEVNTU;
|
SEVNTU,
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue