* Upgrade JUnit version (#973) See gh-973
This commit is contained in:
@@ -60,11 +60,6 @@
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user