spring MockMvc perform()方法出错

6rvt4ljy  于 5个月前  发布在  Spring
关注(0)|答案(1)|浏览(50)

我正在创建一个Spring MVC Controller测试。编译器显示下面用粗体显示的方法的错误。我的代码中缺少了一些库或其他东西吗?有什么建议吗?
我使用以下依赖项:

<dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>3.2.3.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>

个字符

ffx8fchx

ffx8fchx1#

添加以下内容以导入这些方法

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;

字符串

相关问题