Moves back to assertThrows
@@ -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");
}
