Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Submission Svc: Timeout handling #602

Merged
merged 4 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions services/submission/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ services:
batch-size: 5

spring:
transaction:
default-timeout: 20
jpa:
hibernate:
ddl-auto: validate
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
7 changes: 7 additions & 0 deletions services/submission/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ management:
health:
probes:
enabled: true

feign:
client:
config:
default:
connect-timeout: 500
read-timeout: 500