diff --git a/spring-cloud-context-integration-tests/pom.xml b/spring-cloud-context-integration-tests/pom.xml index d0eedb67..301f06cd 100644 --- a/spring-cloud-context-integration-tests/pom.xml +++ b/spring-cloud-context-integration-tests/pom.xml @@ -60,11 +60,6 @@ spring-boot-configuration-processor true - - org.junit.vintage - junit-vintage-engine - test - diff --git a/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/JdbcConfigurationTests.java b/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/JdbcConfigurationTests.java index ada3a53a..f33294f1 100644 --- a/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/JdbcConfigurationTests.java +++ b/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/JdbcConfigurationTests.java @@ -16,7 +16,7 @@ package org.springframework.cloud.context.integration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.WebApplicationType; diff --git a/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/RefreshScopeIntegrationTests.java b/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/RefreshScopeIntegrationTests.java index 098db40a..be8bb6c0 100644 --- a/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/RefreshScopeIntegrationTests.java +++ b/spring-cloud-context-integration-tests/src/test/java/org/springframework/cloud/context/integration/RefreshScopeIntegrationTests.java @@ -18,10 +18,10 @@ package org.springframework.cloud.context.integration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.aop.framework.Advised; import org.springframework.aop.scope.ScopedProxyUtils; @@ -41,11 +41,9 @@ import org.springframework.context.annotation.Configuration; import org.springframework.jmx.export.annotation.ManagedAttribute; import org.springframework.jmx.export.annotation.ManagedResource; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.BDDAssertions.then; -@RunWith(SpringRunner.class) @SpringBootTest(classes = TestConfiguration.class) @SuppressWarnings("Duplicates") public class RefreshScopeIntegrationTests { @@ -59,13 +57,13 @@ public class RefreshScopeIntegrationTests { @Autowired private org.springframework.cloud.context.scope.refresh.RefreshScope scope; - @Before + @BeforeEach public void init() { then(ExampleService.getInitCount()).isEqualTo(1); ExampleService.reset(); } - @After + @AfterEach public void close() { ExampleService.reset(); } @@ -121,10 +119,12 @@ public class RefreshScopeIntegrationTests { } // see gh-349 - @Test(expected = ServiceException.class) + @Test @DirtiesContext public void testCheckedException() throws Exception { - this.service.throwsException(); + Assertions.assertThrows(ServiceException.class, () -> { + this.service.throwsException(); + }); } public interface Service {