From a31b2d81d35276ba52d2ef497e22f599c1cad51b Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 7 Jan 2017 11:56:24 +0000 Subject: [PATCH] builder:RulesPropertiesTest: added Remove unused setter on RulesProperties. --- .../ruleset/builder/RulesProperties.java | 2 -- .../ruleset/builder/RulesPropertiesTest.java | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RulesPropertiesTest.java diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java index 8818219..6abb1e8 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java @@ -25,7 +25,6 @@ SOFTWARE. package net.kemitix.checkstyle.ruleset.builder; import lombok.Getter; -import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; @@ -39,7 +38,6 @@ import java.util.List; * @author Paul Campbell (pcampbell@kemitix.net) */ @Slf4j -@Setter @Getter @Configuration @ConfigurationProperties diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RulesPropertiesTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RulesPropertiesTest.java new file mode 100644 index 0000000..119ce11 --- /dev/null +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/RulesPropertiesTest.java @@ -0,0 +1,35 @@ +package net.kemitix.checkstyle.ruleset.builder; + +import org.junit.Before; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link RulesProperties}. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +public class RulesPropertiesTest { + + private RulesProperties rulesProperties; + + @Before + public void setUp() throws Exception { + rulesProperties = new RulesProperties(); + } + + @Test + public void getEmpty() throws Exception { + assertThat(rulesProperties.getRules()).isEmpty(); + } + @Test + public void getContent() throws Exception { + //given + final Rule rule = new Rule(); + //when + rulesProperties.getRules().add(rule); + //then + assertThat(rulesProperties.getRules()).containsExactly(rule); + } +}