Skip to content

Commit 846416a

Browse files
committed
fix: update Jackson BOM to 2.20.2 and fix logstash expected YAML
Signed-off-by: Siqi Ding <dingdd@amazon.com>
1 parent ff519f6 commit 846416a

15 files changed

+128
-1
lines changed

data-prepper-api/src/test/java/org/opensearch/dataprepper/model/configuration/PluginModelTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.io.Reader;
2727
import java.nio.charset.Charset;
2828
import java.nio.charset.StandardCharsets;
29+
import java.util.Arrays;
2930
import java.util.HashMap;
3031
import java.util.List;
3132
import java.util.Map;
@@ -80,7 +81,7 @@ final void testSerialization_empty_plugin_to_YAML() throws JsonGenerationExcepti
8081
InputStream inputStream = PluginModelTests.class.getResourceAsStream("plugin_model_with_empty_object.yaml");
8182

8283
assertThat(serialized, notNullValue());
83-
assertThat(serialized, equalTo(convertInputStreamToString(inputStream)));
84+
assertThat(serialized, equalTo(stripComments(convertInputStreamToString(inputStream))));
8485
}
8586

8687
@ParameterizedTest
@@ -283,4 +284,12 @@ static String convertInputStreamToString(InputStream inputStream) throws IOExcep
283284
return stringBuilder.toString();
284285
}
285286

287+
static String stripComments(final String content) {
288+
final String stripped = Arrays.stream(content.split("\n"))
289+
.filter(line -> !line.startsWith("#"))
290+
.collect(java.util.stream.Collectors.joining("\n"))
291+
.replaceAll("^\n+", "");
292+
return content.endsWith("\n") ? stripped + "\n" : stripped;
293+
}
294+
286295
}

data-prepper-api/src/test/resources/list_of_plugins_multiple_fields.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
9+
110
listOfPlugins:
211
- customPluginA:
312
key1: value1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin: [1, 2, 3]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin: ""
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin: {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin: 123
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin: {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
#
2+
# Copyright OpenSearch Contributors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# The OpenSearch Contributors require contributions made to
6+
# this file be licensed under the Apache-2.0 license or a
7+
# compatible open source license.
8+
#
19
---
210
customPlugin: null

0 commit comments

Comments
 (0)