reportportal/agent-java-testNG

NPE for skipped test

pskvortsov opened this issue · 1 comments

Libs:

    rpTestngAgentVersion = '4.0.1'
    rpLog4jVersion = '4.0.0'
    rpLogbackVersion = '4.0.0'
    testngVersion = '6.14.2'

Steps to reproduce:

  1. Create Example.java
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class Example {

    @BeforeMethod
    public void before() {
        Assert.assertTrue(false);
    }

    @Test
    public void test() {
        Assert.assertTrue(true);
    }
}
  1. Add it to testng.xml
    <test name="Example test">
        <classes>
            <class name="Example" />
        </classes>
    </test>
  1. Run via command line ./gradlew clean test

Actual result:

  • test failed by NPE
java.lang.NullPointerException
	at com.epam.reportportal.testng.TestNGService.buildFinishTestMethodRq(TestNGService.java:324)
	at com.epam.reportportal.testng.TestNGService.finishTestMethod(TestNGService.java:155)
	at com.epam.reportportal.testng.BaseTestNGListener.onTestSkipped(BaseTestNGListener.java:103)

Duplicate
Fixed in 4.0.2 version