diff --git a/services/submission/src/main/resources/application.yaml b/services/submission/src/main/resources/application.yaml index c72c5dd02f..cef63d6b68 100644 --- a/services/submission/src/main/resources/application.yaml +++ b/services/submission/src/main/resources/application.yaml @@ -34,6 +34,8 @@ services: batch-size: 5 spring: + transaction: + default-timeout: 20 jpa: hibernate: ddl-auto: validate @@ -107,3 +109,10 @@ server: key-store-password: ${SSL_SUBMISSION_KEYSTORE_PASSWORD} key-store-provider: SUN key-store-type: JKS + +feign: + client: + config: + default: + connect-timeout: 5000 + read-timeout: 5000 \ No newline at end of file diff --git a/services/submission/src/test/java/app/coronawarn/server/services/submission/verification/TanVerifierTest.java b/services/submission/src/test/java/app/coronawarn/server/services/submission/verification/TanVerifierTest.java index b1a13c74a3..e33d1fe068 100644 --- a/services/submission/src/test/java/app/coronawarn/server/services/submission/verification/TanVerifierTest.java +++ b/services/submission/src/test/java/app/coronawarn/server/services/submission/verification/TanVerifierTest.java @@ -130,4 +130,14 @@ void checkInternalServerError() { assertThatExceptionOfType(FeignException.class).isThrownBy(() -> tanVerifier.verifyTan(randomUUID)); } + @Test + void checkTimeout() { + server.stubFor( + post(urlEqualTo(verificationPath)) + .withRequestBody(matchingJsonPath("tan", equalTo(randomUUID))) + .withHeader(CONTENT_TYPE, equalTo(MediaType.APPLICATION_JSON.toString())) + .willReturn(aResponse().withStatus(HttpStatus.OK.value()).withFixedDelay(1000))); + + assertThatExceptionOfType(FeignException.class).isThrownBy(() -> tanVerifier.verifyTan(randomUUID)); + } } diff --git a/services/submission/src/test/resources/application.yaml b/services/submission/src/test/resources/application.yaml index c4b8409067..2fad6ec458 100644 --- a/services/submission/src/test/resources/application.yaml +++ b/services/submission/src/test/resources/application.yaml @@ -48,3 +48,10 @@ management: health: probes: enabled: true + +feign: + client: + config: + default: + connect-timeout: 500 + read-timeout: 500 \ No newline at end of file