0
在我的java spring mvc應用程序中,我試圖重置一堆用於Junit測試的記錄。 但行:ClassMode無法解析爲變量
@DirtiesContext(classMode=ClassMode.AFTER_EACH_TEST_METHOD)
它抱怨有:
ClassMode cannot be resolved to a variable
更新:
我已經加入
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>2.5</version>
</dependency>
但隨後與其他線路
抱怨@ActiveProfiles("test")
@Sql(scripts="requests-dataset.sql")
@DirtiesContext(classMode=ClassMode.AFTER_EACH_TEST_METHOD)
的錯誤是:
所有的ActiveProfiles cannot be resolved to a type
Sql cannot be resolved to a type
Sql cannot be resolved to a type