简体   繁体   English

无法解析intellij中的符号AbstractTestNGSpringContextTests

[英]Can not resolve symbol AbstractTestNGSpringContextTests in intellij

I am experiencing very strange problem in using testng in my project. 我在项目中使用testng时遇到非常奇怪的问题。 I have created project with following dependencies. 我创建了具有以下依赖项的项目。

<dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.13.1</version>
        </dependency>

        <dependency>
            <groupId>com.aventstack</groupId>
            <artifactId>extentreports</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.mongodb</groupId>
                    <artifactId>mongodb-driver</artifactId>
                </exclusion>
            </exclusions>
            <version>3.1.5</version>
        </dependency>

        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>bson</artifactId>
            <version>2.3</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>2.0.1.RELEASE</version>
        </dependency>

    </dependencies>

I have written one class which extends AbstractTestNGSpringContextTests 我写了一个扩展AbstractTestNGSpringContextTests

import com.digicert.daas.reporting.listeners.ReportListener;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Listeners;


@Listeners(value = {ReportListener.class})
public  class ApplicationTestcaseReportListener extends AbstractTestNGSpringContextTests{


}

When I import this maven project in my eclipse it works fine. 当我在Eclipse中导入该Maven项目时,它可以正常工作。 But same project when I import in intellij it gives following error 但是当我在IntelliJ中导入相同的项目时,它给出了以下错误

Can not resolve symbol AbstractTestNGSpringContextTests 无法解析符号AbstractTestNGSpringContextTests

I tried to do rebuild project in intellij,but its not helping. 我试图在intellij中重建项目,但没有帮助。 How to resolve this issue? 如何解决这个问题?

Are you sure you are not missing this dependency: 您确定不丢失此依赖项:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
    </dependency>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Intellij MavenWrapperDownloader.java:无法解决符号错误 - Intellij MavenWrapperDownloader.java: Can not resolve symbol error IntelliJ:无法解析符号“springframework” - IntelliJ: Cannot resolve symbol 'springframework' IntelliJ 无法解析 JPA @Query 中的符号“NULL” - IntelliJ cannot resolve symbol 'NULL' in JPA @Query 安装 spring 启动后 Intellij“无法解析符号” - Intellij "cannot resolve symbol" after installing spring boot 无法解析 spring boot 应用程序中的符号“安全” - Can not resolve symbol "security" in spring boot application 什么是 AbstractTestNGSpringContextTests - what is AbstractTestNGSpringContextTests 无法在 IntelliJ 中解析 EnableEurekaServer 的符号。 是的,我有依赖/无效+重新启动我的 IDE) - Cannot resolve symbol for EnableEurekaServer in intelliJ. Yes I have the dependency/invalidated+restarted my IDE) Spring:如果无法扩展AbstractTestNGSpringContextTests,如何在Testng测试类中获取spring applicationContext - Spring: How to get spring applicationContext in a Testng test class, if I can NOT extend AbstractTestNGSpringContextTests .jsp 文件中的 ModelAttribute:无法解析符号。 春天 - ModelAttribute in .jsp file: Can not resolve symbol. Spring 为什么 IntelliJ 无法解析 pom.xml 文件? - Why can't IntelliJ resolve the pom.xml file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM