From b1202b0c47b7ba66af2c3d4e34c9fbeefdf742a8 Mon Sep 17 00:00:00 2001 From: Maxwell Brown Date: Fri, 3 Jan 2025 14:04:48 -0800 Subject: [PATCH] integraton tests should pass now Signed-off-by: Maxwell Brown --- .../plugins/sink/opensearch/OpenSearchSinkIT.java | 4 ++-- .../sink/opensearch/OpenSearchSinkConfigurationTests.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data-prepper-plugins/opensearch/src/integrationTest/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkIT.java b/data-prepper-plugins/opensearch/src/integrationTest/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkIT.java index 80b15162d5..2e83534ba0 100644 --- a/data-prepper-plugins/opensearch/src/integrationTest/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkIT.java +++ b/data-prepper-plugins/opensearch/src/integrationTest/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkIT.java @@ -918,7 +918,7 @@ public void testOpenSearchBulkActionsCreateWithInvalidExpression() throws IOExce metadata.put(IndexConfiguration.DOCUMENT_ID_FIELD, testIdField); metadata.put(IndexConfiguration.ACTION, "unknown"); final OpenSearchSinkConfig openSearchSinkConfig = generateOpenSearchSinkConfigByMetadata(metadata); - assertThrows(IllegalArgumentException.class, () -> createObjectUnderTest(openSearchSinkConfig, true)); + assertThrows(NullPointerException.class, () -> createObjectUnderTest(openSearchSinkConfig, true)); } @Test @@ -1314,7 +1314,7 @@ public void testOpenSearchDocumentId(final String testDocumentIdField) throws IO final List> testRecords = Collections.singletonList(new Record<>(testEvent)); Map metadata = initializeConfigurationMetadata(null, testIndexAlias, null); - metadata.put(IndexConfiguration.DOCUMENT_ID, testDocumentIdField); + metadata.put(IndexConfiguration.DOCUMENT_ID_FIELD, testDocumentIdField); final OpenSearchSinkConfig openSearchSinkConfig = generateOpenSearchSinkConfigByMetadata(metadata); final OpenSearchSink sink = createObjectUnderTest(openSearchSinkConfig, true); sink.output(testRecords); diff --git a/data-prepper-plugins/opensearch/src/test/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkConfigurationTests.java b/data-prepper-plugins/opensearch/src/test/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkConfigurationTests.java index cfe97dbbbe..22e1df982e 100644 --- a/data-prepper-plugins/opensearch/src/test/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkConfigurationTests.java +++ b/data-prepper-plugins/opensearch/src/test/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSinkConfigurationTests.java @@ -45,25 +45,25 @@ public void testReadESConfig() throws IOException { assertEquals(OpenSearchBulkActions.INDEX.toString(), openSearchSinkConfiguration.getIndexConfiguration().getAction()); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = NullPointerException.class) public void testInvalidAction() throws IOException { OpenSearchSinkConfiguration.readOSConfig(generateOpenSearchSinkConfig(INVALID_ACTION_CONFIG)); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = NullPointerException.class) public void testInvalidActions() throws IOException { OpenSearchSinkConfiguration.readOSConfig(generateOpenSearchSinkConfig(INVALID_ACTIONS_CONFIG)); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = NullPointerException.class) public void testInvalidActionWithExpression() throws IOException { expressionEvaluator = mock(ExpressionEvaluator.class); when(expressionEvaluator.isValidExpressionStatement(anyString())).thenReturn(false); OpenSearchSinkConfiguration.readOSConfig(generateOpenSearchSinkConfig(INVALID_ACTION_WITH_EXPRESSION_CONFIG), expressionEvaluator); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = NullPointerException.class) public void testInvalidActionsWithExpression() throws IOException { expressionEvaluator = mock(ExpressionEvaluator.class); when(expressionEvaluator.isValidExpressionStatement(anyString())).thenReturn(false);