Skip to content

Commit

Permalink
put routing field test back
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell Brown <[email protected]>
  • Loading branch information
Galactus22625 committed Jan 7, 2025
1 parent 6d87001 commit 2e2c586
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,21 @@ void doOutput_with_invalid_version_expression_catches_NumberFormatException_and_
verify(dynamicDocumentVersionDroppedEvents).increment();
}

@Test
void test_routing_field_in_document() throws IOException {
String routingFieldKey = UUID.randomUUID().toString();
String routingKey = UUID.randomUUID().toString();
String routingFieldValue = UUID.randomUUID().toString();
when(indexConfiguration.getRoutingField()).thenReturn(routingFieldKey);
when(indexConfiguration.getRouting()).thenReturn(routingKey);
final OpenSearchSink objectUnderTest = createObjectUnderTest();
final Event event = JacksonEvent.builder()
.withEventType("event")
.withData(Collections.singletonMap(routingFieldKey, routingFieldValue))
.build();
assertThat(objectUnderTest.getDocument(event).getRoutingField(), equalTo(Optional.of(routingFieldValue)));
}

@Test
void test_routing_in_document() throws IOException {
String routingValue = UUID.randomUUID().toString();
Expand Down

0 comments on commit 2e2c586

Please sign in to comment.