Skip to content

Commit

Permalink
[Connectors API] Check for null sync job id in UpdateConnectorSyncJob…
Browse files Browse the repository at this point in the history
…IngestionStatsActionRequestTests (elastic#105551)
  • Loading branch information
timgrein committed Feb 15, 2024
1 parent 15877f5 commit 4b21d67
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ public void testValidate_WhenConnectorSyncJobIdIsEmpty_ExpectValidationError() {
assertThat(exception.getMessage(), containsString(EMPTY_CONNECTOR_SYNC_JOB_ID_ERROR_MESSAGE));
}

public void testValidate_WhenConnectorSyncJobIdIsNull_ExpectValidationError() {
UpdateConnectorSyncJobIngestionStatsAction.Request request = new UpdateConnectorSyncJobIngestionStatsAction.Request(
null,
0L,
0L,
0L,
0L,
Instant.now()
);
ActionRequestValidationException exception = request.validate();

assertThat(exception, notNullValue());
assertThat(exception.getMessage(), containsString(EMPTY_CONNECTOR_SYNC_JOB_ID_ERROR_MESSAGE));
}

public void testValidate_WhenDeletedDocumentCountIsNegative_ExpectValidationError() {
UpdateConnectorSyncJobIngestionStatsAction.Request request = new UpdateConnectorSyncJobIngestionStatsAction.Request(
randomAlphaOfLength(10),
Expand Down

0 comments on commit 4b21d67

Please sign in to comment.