Added unit-test for new ParserConfiguration field.
@@ -19,14 +19,14 @@ class ParserConfigurationTest {
private static final List<GroovyParser> PARSERS = Collections.singletonList(mock(GroovyParser.class));
@Test
- void shouldHaveNoRootFoldersWhenCreated() {
+ void shouldHaveNoParsersWhenCreated() {
ParserConfiguration configuration = new ParserConfiguration(mock(GlobalConfigurationFacade.class));
assertThat(configuration.getParsers()).isEmpty();
}
@Test
- void shouldSaveConfigurationIfFoldersAreAdded() {
+ void shouldSaveConfigurationIfParsersAreAdded() {
GlobalConfigurationFacade facade = mock(GlobalConfigurationFacade.class);
ParserConfiguration configuration = new ParserConfiguration(facade);
@@ -35,4 +35,24 @@ class ParserConfigurationTest {
verify(facade).save();
assertThat(configuration.getParsers()).isEqualTo(PARSERS);
}
+
+ @Test
+ void shouldHaveConsoleLogScanningPermittedSetToFalseWhenCreated() {
+ GlobalConfigurationFacade facade = mock(GlobalConfigurationFacade.class);
+
+ ParserConfiguration configuration = new ParserConfiguration(facade);
+
+ assertThat(configuration.isConsoleLogScanningPermitted()).isEqualTo(false);
+ }
+
+ @Test
+ void shouldSaveConfigurationIfConsoleLogScanningPermittedIsSet() {
+ GlobalConfigurationFacade facade = mock(GlobalConfigurationFacade.class);
+
+ ParserConfiguration configuration = new ParserConfiguration(facade);
+ configuration.setConsoleLogScanningPermitted(true);
+
+ verify(facade).save();
+ assertThat(configuration.isConsoleLogScanningPermitted()).isEqualTo(true);
+ }
}
