allure-framework / allure-java

Allure integrations for Java test frameworks
Apache License 2.0
355 stars 225 forks source link

NPE when null is test Parameter (from dataprovider) #129

Closed dimkin-eu closed 5 years ago

dimkin-eu commented 7 years ago

I'm submitting a ...

What is the current behavior?

test, running from dataprovider, where data could have null-s - fails with NPE

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

Having null as parameter not hurting for test

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.3.1
Test framework testng@6.8
Allure adaptor allure-testng@2.0-BETA16
Generate report using allure-maven@2.18

Other information

java.lang.NullPointerException
    at io.qameta.allure.aspects.Allure1Annotations.getMethodParameters(Allure1Annotations.java:104)
    at io.qameta.allure.aspects.Allure1Annotations.getParameters(Allure1Annotations.java:95)
    at io.qameta.allure.aspects.Allure1Annotations.updateParameters(Allure1Annotations.java:85)
    at io.qameta.allure.AllureLifecycle.lambda$updateTestCase$10(AllureLifecycle.java:178)
    at java.util.Optional.ifPresent(Optional.java:159)
    at io.qameta.allure.AllureLifecycle.updateTestCase(AllureLifecycle.java:176)
    at io.qameta.allure.aspects.Allure1TestCaseAspects.lambda$updateTestCase$0(Allure1TestCaseAspects.java:38)
    at java.util.Optional.ifPresent(Optional.java:159)
    at io.qameta.allure.aspects.Allure1TestCaseAspects.updateTestCase(Allure1TestCaseAspects.java:35)
    at io.qameta.allure.aspects.Allure1TestCaseAspects.testNgTestStart(Allure1TestCaseAspects.java:27)
baev commented 5 years ago

fixed via https://github.com/allure-framework/allure-java/commit/1b1152b69e5785764617c6f526b83ee685ebcf58