Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.opensearch.dataprepper.model.configuration;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.opensearch.dataprepper.model.plugin.InvalidPluginConfigurationException;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -54,5 +55,14 @@ void pipelines_list_with_two_or_more_pipelines_throws_exception() {
void empty_pipelines_list_throws_exception() {
assertThrows(InvalidPluginConfigurationException.class, ()->new SinkForwardConfig(List.of(), Map.of(), Map.of()));
}

@Test
void jackson_deserialization_succeeds() throws Exception {
String json = "{\"pipelines\":[\"pipeline1\"],\"with_data\":{\"key\":\"value\"},\"with_metadata\":{\"meta\":\"data\"}}";
ObjectMapper mapper = new ObjectMapper();
SinkForwardConfig config = mapper.readValue(json, SinkForwardConfig.class);
assertThat(config.getPipelineNames().size(), equalTo(1));
assertThat(config.getPipelineNames().get(0), equalTo("pipeline1"));
}
}

Loading