use of com.buschmais.jqassistant.core.configuration.api.Configuration in project jqa-core-framework by jQAssistant.
the class ConfigurationLoaderImplTest method loadFromFiles.
@Test
void loadFromFiles() {
Configuration configuration = configurationLoader.load(Configuration.class);
assertThat(configuration).isNotNull();
List<Plugin> plugins = configuration.plugins();
assertThat(plugins).isNotNull().hasSize(2);
Scan scan = configuration.scan();
assertThat(scan).isNotNull();
assertThat(scan.continueOnError()).isEqualTo(true);
}
use of com.buschmais.jqassistant.core.configuration.api.Configuration in project jqa-core-framework by buschmais.
the class ConfigurationLoaderImpl method load.
@Override
public Configuration load(File configurationDirectory, ConfigSource... configSources) {
List<ConfigSource> yamlConfigSources = getYamlConfigSources(configurationDirectory);
SmallRyeConfig config = new SmallRyeConfigBuilder().withMapping(Configuration.class).addDefaultSources().withSources(yamlConfigSources).withSources(configSources).withValidateUnknown(false).build();
return config.getConfigMapping(Configuration.class);
}
use of com.buschmais.jqassistant.core.configuration.api.Configuration in project jqa-core-framework by buschmais.
the class ConfigurationLoaderImplTest method load.
@Test
void load() {
File workingDirectory = new File("src/test/resources/working directory");
File configurationDirectory = configurationLoader.getDefaultConfigurationDirectory(workingDirectory);
assertThat(configurationDirectory).isEqualTo(new File(workingDirectory, ".jqassistant"));
Configuration configuration = configurationLoader.load(configurationDirectory);
assertThat(configuration).isNotNull();
List<Plugin> plugins = configuration.plugins();
assertThat(plugins).isNotNull().hasSize(2);
}
use of com.buschmais.jqassistant.core.configuration.api.Configuration in project jqa-core-framework by jQAssistant.
the class ConfigurationLoaderImplTest method overrideFromSystemProperty.
@Test
void overrideFromSystemProperty() {
System.setProperty("jqassistant.scan.continue-on-error", "false");
try {
Configuration configuration = configurationLoader.load(Configuration.class);
assertThat(configuration.scan().continueOnError()).isEqualTo(false);
} finally {
System.clearProperty("jqassistant.scan.continue-on-error");
}
}
use of com.buschmais.jqassistant.core.configuration.api.Configuration in project jqa-core-framework by jQAssistant.
the class AbstractPluginIT method getScanner.
/**
* Return an initialized scanner instance using the given properties.
*
* @return The scanner instance.
*/
protected Scanner getScanner(Map<String, Object> properties) {
PropertiesConfigBuilder propertiesConfigBuilder = createPropertiesConfigBuilder().with(Scan.PREFIX, Scan.PROPERTIES, properties);
Configuration configuration = createConfiguration(propertiesConfigBuilder);
return getScanner(configuration);
}
Aggregations