24
24
import org .junit .jupiter .api .extension .ExtensionContext ;
25
25
import org .junit .jupiter .api .extension .ParameterContext ;
26
26
import org .junit .jupiter .api .extension .ParameterResolver ;
27
- import org .junit .jupiter .api .extension .TestExtensionContext ;
28
27
29
28
/**
30
29
* A JUnit Jupiter {@link Extension} used to automatically manage the
@@ -38,7 +37,7 @@ public class RestDocumentationExtension implements Extension, BeforeEachCallback
38
37
private final ManualRestDocumentation delegate = new ManualRestDocumentation ();
39
38
40
39
@ Override
41
- public void beforeEach (TestExtensionContext context ) throws Exception {
40
+ public void beforeEach (ExtensionContext context ) throws Exception {
42
41
Class <?> testClass = context .getTestClass ().orElseThrow (
43
42
() -> new IllegalStateException ("No test class was available" ));
44
43
Method testMethod = context .getTestMethod ().orElseThrow (
@@ -47,7 +46,7 @@ public void beforeEach(TestExtensionContext context) throws Exception {
47
46
}
48
47
49
48
@ Override
50
- public void afterEach (TestExtensionContext context ) throws Exception {
49
+ public void afterEach (ExtensionContext context ) throws Exception {
51
50
this .delegate .afterTest ();
52
51
}
53
52
@@ -57,14 +56,14 @@ public RestDocumentationContext beforeOperation() {
57
56
}
58
57
59
58
@ Override
60
- public boolean supports (ParameterContext parameterContext ,
59
+ public boolean supportsParameter (ParameterContext parameterContext ,
61
60
ExtensionContext extensionContext ) {
62
61
return RestDocumentationContextProvider .class
63
62
.isAssignableFrom (parameterContext .getParameter ().getType ());
64
63
}
65
64
66
65
@ Override
67
- public Object resolve (ParameterContext parameterContext ,
66
+ public Object resolveParameter (ParameterContext parameterContext ,
68
67
ExtensionContext extensionContext ) {
69
68
return this ;
70
69
}
0 commit comments