diff --git a/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceLocatorRetryTests.java b/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceLocatorRetryTests.java index e4783f05..6058a13c 100644 --- a/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceLocatorRetryTests.java +++ b/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceLocatorRetryTests.java @@ -38,8 +38,7 @@ public class ConsulPropertySourceLocatorRetryTests { @Test public void testRetry() { - //Assert.assertThrows(TransportException.class, () -> { - try { + Assert.assertThrows(TransportException.class, () -> { new SpringApplicationBuilder(Config.class).properties( "spring.application.name=testConsulPropertySourceLocatorRetry", "spring.cloud.consul.host=53210a7c-4809-42cb-8b30-057d2db85fcc", @@ -48,11 +47,7 @@ public class ConsulPropertySourceLocatorRetryTests { "spring.cloud.consul.retry.maxAttempts=1", "spring.cloud.consul.config.failFast=true").run(); Assert.fail("Did not throw TransportException"); - } - catch (TransportException e) { - // success - } - //}); + }); assertThat(output).contains("RetryContext retrieved"); }