我正在尝试基于spring-restdocs生成一个 Rest API 文档
在以下代码中,我在apply()处收到编译时错误
未定义类型 DefaultMockMvcBuilder 的方法 apply(RestDocumentationMockMvcConfigurer)
@ContextConfiguration(locations = { "classpath:/testApplicationRestService.xml" })
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
public class CustomerControllerTest {
@Rule
public final RestDocumentation restDocumentation = new RestDocumentation(
"build/generated-snippets");
@Autowired
private WebApplicationContext context;
private MockMvc mockMvc;
@Before
public void setUp() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
.apply(documentationConfiguration(this.restDocumentation))
.build();
}
}