Skip to content

Commit

Permalink
integraton tests should pass now
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell Brown <[email protected]>
  • Loading branch information
Galactus22625 committed Jan 3, 2025
1 parent 018857c commit b1202b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1314,7 +1314,7 @@ public void testOpenSearchDocumentId(final String testDocumentIdField) throws IO
final List<Record<Event>> testRecords = Collections.singletonList(new Record<>(testEvent));

Map<String, Object> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b1202b0

Please sign in to comment.