Align with breaking API changes since JUnit 5.0 M4
Closes gh-451
This commit is contained in:
@@ -75,7 +75,7 @@ subprojects {
|
||||
dependency 'org.hibernate:hibernate-validator:5.4.1.Final'
|
||||
dependency 'org.jacoco:org.jacoco.agent:0.7.9'
|
||||
dependency 'org.jruby:jruby-complete:9.1.13.0'
|
||||
dependency 'org.junit.jupiter:junit-jupiter-api:5.0.0-M4'
|
||||
dependency 'org.junit.jupiter:junit-jupiter-api:5.0.0'
|
||||
dependency 'org.mockito:mockito-core:1.10.19'
|
||||
dependency 'org.springframework.hateoas:spring-hateoas:0.23.0.RELEASE'
|
||||
dependency 'org.synchronoss.cloud:nio-multipart-parser:1.1.0'
|
||||
|
||||
@@ -3,8 +3,8 @@ buildscript {
|
||||
maven { url 'https://repo.spring.io/milestone' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M1'
|
||||
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4'
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M6'
|
||||
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ targetCompatibility = 1.8
|
||||
|
||||
ext {
|
||||
snippetsDir = file('build/generated-snippets')
|
||||
junitJupiterVersion = '5.0.0-M4'
|
||||
junitJupiterVersion = '5.0.0'
|
||||
}
|
||||
|
||||
ext['spring-restdocs.version'] = '2.0.0.BUILD-SNAPSHOT'
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.junit.jupiter.api.extension.Extension;
|
||||
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||
import org.junit.jupiter.api.extension.ParameterContext;
|
||||
import org.junit.jupiter.api.extension.ParameterResolver;
|
||||
import org.junit.jupiter.api.extension.TestExtensionContext;
|
||||
|
||||
/**
|
||||
* A JUnit Jupiter {@link Extension} used to automatically manage the
|
||||
@@ -38,7 +37,7 @@ public class RestDocumentationExtension implements Extension, BeforeEachCallback
|
||||
private final ManualRestDocumentation delegate = new ManualRestDocumentation();
|
||||
|
||||
@Override
|
||||
public void beforeEach(TestExtensionContext context) throws Exception {
|
||||
public void beforeEach(ExtensionContext context) throws Exception {
|
||||
Class<?> testClass = context.getTestClass().orElseThrow(
|
||||
() -> new IllegalStateException("No test class was available"));
|
||||
Method testMethod = context.getTestMethod().orElseThrow(
|
||||
@@ -47,7 +46,7 @@ public class RestDocumentationExtension implements Extension, BeforeEachCallback
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterEach(TestExtensionContext context) throws Exception {
|
||||
public void afterEach(ExtensionContext context) throws Exception {
|
||||
this.delegate.afterTest();
|
||||
}
|
||||
|
||||
@@ -57,14 +56,14 @@ public class RestDocumentationExtension implements Extension, BeforeEachCallback
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(ParameterContext parameterContext,
|
||||
public boolean supportsParameter(ParameterContext parameterContext,
|
||||
ExtensionContext extensionContext) {
|
||||
return RestDocumentationContextProvider.class
|
||||
.isAssignableFrom(parameterContext.getParameter().getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object resolve(ParameterContext parameterContext,
|
||||
public Object resolveParameter(ParameterContext parameterContext,
|
||||
ExtensionContext extensionContext) {
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user