diff options
Diffstat (limited to 'src/integrationTest/kotlin/dev')
3 files changed, 20 insertions, 9 deletions
diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/config/AppConfigurationTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/config/AppConfigurationTest.kt index e1e9f0d..2278c3d 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/config/AppConfigurationTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/config/AppConfigurationTest.kt @@ -48,7 +48,7 @@ import org.springframework.beans.factory.getBean import org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration import org.springframework.boot.test.context.SpringBootTest import org.springframework.context.ApplicationContext -import org.springframework.retry.support.RetryTemplate +import org.springframework.core.retry.RetryTemplate import org.springframework.security.crypto.password.PasswordEncoder import org.springframework.security.provisioning.InMemoryUserDetailsManager import org.springframework.test.context.ContextConfiguration @@ -331,9 +331,10 @@ class AppConfigurationTest { val retryTemplate = context.getBean<RetryTemplate>() assertThat(retryTemplate).isNotNull + var retries = 0 assertThrows<RuntimeException> { - retryTemplate.execute<Void, RuntimeException> { - assertThat(it.retryCount).isLessThan(maxRetryAttempts) + retryTemplate.execute { + assertThat(retries++).isLessThan(maxRetryAttempts) throw RuntimeException() } } diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt index bbad55a..9094478 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt @@ -39,11 +39,11 @@ import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest +import org.springframework.core.retry.RetryPolicy +import org.springframework.core.retry.RetryTemplate import org.springframework.http.HttpMethod import org.springframework.http.HttpStatus import org.springframework.http.MediaType -import org.springframework.retry.policy.SimpleRetryPolicy -import org.springframework.retry.support.RetryTemplateBuilder import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import org.springframework.test.context.bean.override.mockito.MockitoBean @@ -89,7 +89,11 @@ class RestDipMtbFileSenderTest { ) { val restTemplate = restTemplate val restTargetProperties = RestTargetProperties("http://localhost:9000/api", null, null) - val retryTemplate = RetryTemplateBuilder().customPolicy(SimpleRetryPolicy(1)).build() + val retryTemplate = RetryTemplate( + RetryPolicy.builder() + .maxRetries(0) + .build() + ) this.mockRestServiceServer = MockRestServiceServer.createServer(restTemplate) diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt index 78089d6..c91e8a9 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt @@ -27,11 +27,11 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows +import org.springframework.core.retry.RetryPolicy +import org.springframework.core.retry.RetryTemplate import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod import org.springframework.http.HttpStatus -import org.springframework.retry.policy.SimpleRetryPolicy -import org.springframework.retry.support.RetryTemplateBuilder import org.springframework.test.web.client.MockRestServiceServer import org.springframework.test.web.client.match.MockRestRequestMatchers.method import org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo @@ -49,7 +49,13 @@ class GpasPseudonymGeneratorTest { @BeforeEach fun setup() { - val retryTemplate = RetryTemplateBuilder().customPolicy(SimpleRetryPolicy(1)).build() + val retryTemplate = + RetryTemplate( + RetryPolicy + .builder() + .maxRetries(0) + .build(), + ) val gPasConfigProperties = GPasConfigProperties(CONFIGURED_URI, null, null, "test", "test2", null, null) |
