Skip to content

Commit aedb9a7

Browse files
committed
Align with breaking API changes since JUnit 5.0 M4
Closes gh-451
1 parent c7fd075 commit aedb9a7

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ subprojects {
7575
dependency 'org.hibernate:hibernate-validator:5.4.1.Final'
7676
dependency 'org.jacoco:org.jacoco.agent:0.7.9'
7777
dependency 'org.jruby:jruby-complete:9.1.13.0'
78-
dependency 'org.junit.jupiter:junit-jupiter-api:5.0.0-M4'
78+
dependency 'org.junit.jupiter:junit-jupiter-api:5.0.0'
7979
dependency 'org.mockito:mockito-core:1.10.19'
8080
dependency 'org.springframework.hateoas:spring-hateoas:0.23.0.RELEASE'
8181
dependency 'org.synchronoss.cloud:nio-multipart-parser:1.1.0'

samples/junit5/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ buildscript {
33
maven { url 'https://repo.spring.io/milestone' }
44
}
55
dependencies {
6-
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M1'
7-
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4'
6+
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M6'
7+
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
88
}
99
}
1010

@@ -31,7 +31,7 @@ targetCompatibility = 1.8
3131

3232
ext {
3333
snippetsDir = file('build/generated-snippets')
34-
junitJupiterVersion = '5.0.0-M4'
34+
junitJupiterVersion = '5.0.0'
3535
}
3636

3737
ext['spring-restdocs.version'] = '2.0.0.BUILD-SNAPSHOT'

spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentationExtension.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.junit.jupiter.api.extension.ExtensionContext;
2525
import org.junit.jupiter.api.extension.ParameterContext;
2626
import org.junit.jupiter.api.extension.ParameterResolver;
27-
import org.junit.jupiter.api.extension.TestExtensionContext;
2827

2928
/**
3029
* A JUnit Jupiter {@link Extension} used to automatically manage the
@@ -38,7 +37,7 @@ public class RestDocumentationExtension implements Extension, BeforeEachCallback
3837
private final ManualRestDocumentation delegate = new ManualRestDocumentation();
3938

4039
@Override
41-
public void beforeEach(TestExtensionContext context) throws Exception {
40+
public void beforeEach(ExtensionContext context) throws Exception {
4241
Class<?> testClass = context.getTestClass().orElseThrow(
4342
() -> new IllegalStateException("No test class was available"));
4443
Method testMethod = context.getTestMethod().orElseThrow(
@@ -47,7 +46,7 @@ public void beforeEach(TestExtensionContext context) throws Exception {
4746
}
4847

4948
@Override
50-
public void afterEach(TestExtensionContext context) throws Exception {
49+
public void afterEach(ExtensionContext context) throws Exception {
5150
this.delegate.afterTest();
5251
}
5352

@@ -57,14 +56,14 @@ public RestDocumentationContext beforeOperation() {
5756
}
5857

5958
@Override
60-
public boolean supports(ParameterContext parameterContext,
59+
public boolean supportsParameter(ParameterContext parameterContext,
6160
ExtensionContext extensionContext) {
6261
return RestDocumentationContextProvider.class
6362
.isAssignableFrom(parameterContext.getParameter().getType());
6463
}
6564

6665
@Override
67-
public Object resolve(ParameterContext parameterContext,
66+
public Object resolveParameter(ParameterContext parameterContext,
6867
ExtensionContext extensionContext) {
6968
return this;
7069
}

0 commit comments

Comments
 (0)