Search in sources :

Example 31 with PluginSetting

use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.

the class PeerForwarderTest method generatePeerForwarder.

private PeerForwarder generatePeerForwarder(final List<String> staticEndpoints, final int spansPerRequest) {
    final HashMap<String, Object> settings = new HashMap<>();
    settings.put(PeerForwarderConfig.DISCOVERY_MODE, "STATIC");
    settings.put(PeerForwarderConfig.STATIC_ENDPOINTS, staticEndpoints);
    settings.put(PeerForwarderConfig.MAX_NUM_SPANS_PER_REQUEST, spansPerRequest);
    settings.put(PeerForwarderConfig.TIME_OUT, 300);
    settings.put(PeerForwarderConfig.SSL, false);
    final PluginSetting pluginSetting = new PluginSetting("peer_forwarder", settings);
    pluginSetting.setPipelineName(TEST_PIPELINE_NAME);
    return new PeerForwarder(pluginSetting);
}
Also used : HashMap(java.util.HashMap) ByteString(com.google.protobuf.ByteString) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting)

Example 32 with PluginSetting

use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.

the class ServiceMapStatefulPrepperTest method testPluginSettingConstructor.

@Test
public void testPluginSettingConstructor() {
    final PluginSetting pluginSetting = new PluginSetting("testPluginSetting", Collections.emptyMap());
    pluginSetting.setProcessWorkers(4);
    pluginSetting.setPipelineName("TestPipeline");
    // Nothing is accessible to validate, so just verify that no exception is thrown.
    final ServiceMapStatefulPrepper serviceMapStatefulPrepper = new ServiceMapStatefulPrepper(pluginSetting);
}
Also used : PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) Test(org.junit.Test)

Example 33 with PluginSetting

use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.

the class DnsPeerListProvider_CreateTest method setup.

@BeforeEach
void setup() {
    pluginSetting = new PluginSetting(PLUGIN_NAME, new HashMap<>()) {

        {
            setPipelineName(PIPELINE_NAME);
        }
    };
    completableFuture = CompletableFuture.completedFuture(null);
    pluginSetting.getSettings().put(PeerForwarderConfig.DISCOVERY_MODE, DiscoveryMode.DNS.toString());
    pluginMetrics = mock(PluginMetrics.class);
}
Also used : HashMap(java.util.HashMap) PluginMetrics(com.amazon.dataprepper.metrics.PluginMetrics) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 34 with PluginSetting

use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.

the class PeerListProviderFactoryTest method setup.

@BeforeEach
void setup() {
    factory = new PeerListProviderFactory();
    pluginSetting = new PluginSetting(PLUGIN_NAME, new HashMap<>()) {

        {
            setPipelineName(PIPELINE_NAME);
        }
    };
}
Also used : HashMap(java.util.HashMap) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 35 with PluginSetting

use of com.amazon.dataprepper.model.configuration.PluginSetting in project data-prepper by opensearch-project.

the class ZipkinOpenSearchToOtel method getBuffer.

private static BlockingBuffer<Record<Object>> getBuffer() {
    final HashMap<String, Object> integerHashMap = new HashMap<>();
    integerHashMap.put("buffer_size", 5);
    return new BlockingBuffer<>(new PluginSetting("blocking_buffer", integerHashMap));
}
Also used : HashMap(java.util.HashMap) BlockingBuffer(com.amazon.dataprepper.plugins.buffer.blockingbuffer.BlockingBuffer) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting)

Aggregations

PluginSetting (com.amazon.dataprepper.model.configuration.PluginSetting)150 Test (org.junit.jupiter.api.Test)58 HashMap (java.util.HashMap)55 Test (org.junit.Test)43 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)26 Record (com.amazon.dataprepper.model.record.Record)22 AsciiString (io.netty.util.AsciiString)16 Measurement (io.micrometer.core.instrument.Measurement)12 StringJoiner (java.util.StringJoiner)12 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)12 Map (java.util.Map)11 Path (java.nio.file.Path)9 Server (com.linecorp.armeria.server.Server)8 Before (org.junit.Before)8 BeforeEach (org.junit.jupiter.api.BeforeEach)8 BlockingBuffer (com.amazon.dataprepper.plugins.buffer.blockingbuffer.BlockingBuffer)7 RestHighLevelClient (org.opensearch.client.RestHighLevelClient)7 PluginMetrics (com.amazon.dataprepper.metrics.PluginMetrics)6 CertificateProvider (com.amazon.dataprepper.plugins.certificate.CertificateProvider)6 ACMCertificateProvider (com.amazon.dataprepper.plugins.certificate.acm.ACMCertificateProvider)6