use of com.amazon.dataprepper.plugins.TestPlugin in project data-prepper by opensearch-project.
the class DefaultPluginFactoryIT method loadPlugin_should_return_a_new_plugin_instance_with_the_expected_configuration.
@Test
void loadPlugin_should_return_a_new_plugin_instance_with_the_expected_configuration() {
final String requiredStringValue = UUID.randomUUID().toString();
final String optionalStringValue = UUID.randomUUID().toString();
final Map<String, Object> pluginSettingMap = new HashMap<>();
pluginSettingMap.put("required_string", requiredStringValue);
pluginSettingMap.put("optional_string", optionalStringValue);
final PluginSetting pluginSetting = createPluginSettings(pluginSettingMap);
final TestPluggableInterface plugin = createObjectUnderTest().loadPlugin(TestPluggableInterface.class, pluginSetting);
assertThat(plugin, instanceOf(TestPlugin.class));
final TestPlugin testPlugin = (TestPlugin) plugin;
final TestPluginConfiguration configuration = testPlugin.getConfiguration();
assertThat(configuration.getRequiredString(), equalTo(requiredStringValue));
assertThat(configuration.getOptionalString(), equalTo(optionalStringValue));
}
Aggregations