Skip to content

NullPointerException with SelionAssert.assertXXX in DataProvider #378

@sbheemanadham

Description

@sbheemanadham

SeLion Version : 1.2.0

Component : SeLion

Expected Behavior : Hard asserts should work from the DataProvider

Actual Behavior : NullPointerException when hard assert is in DataProvider

Caused by: java.lang.NullPointerException
at com.paypal.selion.platform.asserts.SeLionHardAssert.showAssertInfo(SeLionHardAssert.java:38)
at com.paypal.selion.platform.asserts.SeLionHardAssert.onAssertSuccess(SeLionHardAssert.java:29)
at org.testng.asserts.Assertion.doAssert(Assertion.java:16)
at org.testng.asserts.Assertion.assertTrue(Assertion.java:109)
at com.paypal.selion.platform.asserts.SeLionAsserts.assertTrue(SeLionAsserts.java:384)

Steps to Reproduce:

@dataProvider(name = "dp1", parallel = true)
public static Object[][] dp1() throws Exception {

    String fileName = "DPFile.xlsx";

    SeLionAsserts.assertTrue(!StringUtils.isEmpty(fileName), "Found the spreadsheet");

    DataResource resource = new FileSystemResource(fileName, DPFilePojo.class);
    SeLionDataProvider dataProvider = DataProviderFactory.getDataProvider(resource);
    return dataProvider.getAllData();

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions