diff --git a/services/submission/src/main/java/app/coronawarn/server/services/submission/validation/ValidSubmissionPayload.java b/services/submission/src/main/java/app/coronawarn/server/services/submission/validation/ValidSubmissionPayload.java index b7e427065a..3a0b420a0e 100644 --- a/services/submission/src/main/java/app/coronawarn/server/services/submission/validation/ValidSubmissionPayload.java +++ b/services/submission/src/main/java/app/coronawarn/server/services/submission/validation/ValidSubmissionPayload.java @@ -88,11 +88,6 @@ public boolean isValid(SubmissionPayload submissionPayload, ConstraintValidatorC List exposureKeys = submissionPayload.getKeysList(); validatorContext.disableDefaultConstraintViolation(); - if (Objects.isNull(exposureKeys)) { - addViolation(validatorContext, "Field 'keys' points to Null."); - return false; - } - boolean isValid = checkKeyCollectionSize(exposureKeys, validatorContext); isValid &= checkUniqueStartIntervalNumbers(exposureKeys, validatorContext); isValid &= checkNoOverlapsInTimeWindow(exposureKeys, validatorContext); diff --git a/services/submission/src/test/java/app/coronawarn/server/services/submission/monitoring/VerificationServiceHealthIndicatorTest.java b/services/submission/src/test/java/app/coronawarn/server/services/submission/monitoring/VerificationServiceHealthIndicatorTest.java index c11cbda13c..197e965083 100644 --- a/services/submission/src/test/java/app/coronawarn/server/services/submission/monitoring/VerificationServiceHealthIndicatorTest.java +++ b/services/submission/src/test/java/app/coronawarn/server/services/submission/monitoring/VerificationServiceHealthIndicatorTest.java @@ -57,12 +57,19 @@ public void setup() { } @Test - void checkIsHealthyIfVerificationServerIsRunning() throws Exception { + void checkIsHealthyIfVerificationServerIsRunningAndExceptionIsThrown() throws Exception { when(verificationServerClient.verifyTan(any())).thenThrow(FeignException.NotFound.class); mvc.perform(get("/actuator/health")) .andExpect(status().is2xxSuccessful()).andReturn(); } + @Test + void checkIsHealthyIfVerificationServerIsRunning() throws Exception { + when(verificationServerClient.verifyTan(any())).thenReturn("ok"); + mvc.perform(get("/actuator/health")) + .andExpect(status().is2xxSuccessful()).andReturn(); + } + @Test void checkIsUnhealthyIfVerificationServerIsDown() throws Exception { when(verificationServerClient.verifyTan(any())).thenThrow(FeignException.InternalServerError.class);