builder:RuleSourceTest: added

Replace final delimiter in RuleSource.
This commit is contained in:
Paul Campbell 2017-01-07 12:08:38 +00:00
parent a31b2d81d3
commit 9b3f0869ea
2 changed files with 34 additions and 1 deletions

View file

@ -32,5 +32,5 @@ package net.kemitix.checkstyle.ruleset.builder;
public enum RuleSource {
CHECKSTYLE,
SEVNTU;
SEVNTU,
}

View file

@ -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);
}
}