IntelliJ在IDE中無法識別我的@Test註釋。我能夠使用IDE和命令行運行我的測試。但是,我無法刪除「@Test」下面的紅色波形錯誤行Intellij不識別測試註釋
錯誤消息顯示「'@Test'不適用於方法」...但它應該是,特別是如果測試運行。
有沒有人有解決這個問題?
版本:IntelliJ IDEA的15.0.6
錯誤圖片
我pom.xml文件看起來是這樣的:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>javaForTesters</groupId>
<artifactId>javaForTesters</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>