use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.
the class GrokPrepperConfigTests method testInvalidConfig.
@Test
public void testInvalidConfig() {
final PluginSetting invalidPluginSetting = completePluginSettingForGrokPrepper(false, true, TEST_MATCH, false, TEST_KEYS_TO_OVERWRITE, TEST_PATTERNS_DIRECTORIES, TEST_PATTERNS_FILES_GLOB, TEST_PATTERN_DEFINITIONS, TEST_TIMEOUT_MILLIS, TEST_TARGET_KEY);
invalidPluginSetting.getSettings().put(GrokPrepperConfig.MATCH, TEST_INVALID_MATCH);
assertThrows(IllegalArgumentException.class, () -> GrokPrepperConfig.buildConfig(invalidPluginSetting));
}
use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.
the class SinkFactoryTests method testNewSinkClassByNameThatExists.
/**
* Tests if SinkFactory is able to retrieve default Source plugins by name
*/
@Test
public void testNewSinkClassByNameThatExists() {
final PluginSetting stdOutSinkConfiguration = new PluginSetting("stdout", new HashMap<>());
final Sink actualSink = SinkFactory.newSink(stdOutSinkConfiguration);
final Sink expectedSink = new StdOutSink();
assertThat(actualSink, notNullValue());
assertThat(actualSink.getClass().getSimpleName(), is(equalTo(expectedSink.getClass().getSimpleName())));
}
use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.
the class SourceFactoryTests method testSourceClassByName.
/**
* Tests if SourceFactory is able to retrieve default Source plugins by name
*/
@Test
public void testSourceClassByName() {
final PluginSetting stdInSourceConfiguration = new PluginSetting("stdin", new HashMap<>());
stdInSourceConfiguration.setPipelineName(TEST_PIPELINE);
final Source actualSource = SourceFactory.newSource(stdInSourceConfiguration);
final Source expectedSource = new StdInSource(500, TEST_PIPELINE);
assertThat(actualSource, notNullValue());
assertThat(actualSource.getClass().getSimpleName(), is(equalTo(expectedSource.getClass().getSimpleName())));
}
use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.
the class FileSourceTests method getBuffer.
private BlockingBuffer<Record<Object>> getBuffer() {
final HashMap<String, Object> integerHashMap = new HashMap<>();
integerHashMap.put("buffer_size", 2);
integerHashMap.put("batch_size", 2);
final PluginSetting pluginSetting = new PluginSetting("blocking_buffer", integerHashMap);
pluginSetting.setPipelineName(TEST_PIPELINE_NAME);
return new BlockingBuffer<>(pluginSetting);
}
use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.
the class AggregateProcessor method loadAggregateAction.
private AggregateAction loadAggregateAction(final PluginFactory pluginFactory) {
final PluginModel actionConfiguration = aggregateProcessorConfig.getAggregateAction();
final PluginSetting actionPluginSetting = new PluginSetting(actionConfiguration.getPluginName(), actionConfiguration.getPluginSettings());
return pluginFactory.loadPlugin(AggregateAction.class, actionPluginSetting);
}
Aggregations