anshooarora / extentreports-java

Community version of Extent API for Java has moved to https://github.com/extent-framework/
http://extentreports.com
Other
528 stars 318 forks source link

Return null when get category with size >=2 #1088

Open banv opened 6 years ago

banv commented 6 years ago

I wrote some UT then found bellow problem. When I call ExtentTest.assignCategory to add 2 category, then verify. ExtentTest.getModel().getCategory(0) return null.

I check the ExtentTest class I think problem is bellow code:

https://github.com/anshooarora/extentreports-java/blob/6b052be442a330e37c05a98714b1578a9f0bd157/src/main/java/com/aventstack/extentreports/model/Test.java#L275

The condition: index.intValue() >= this.category.size() - 1 return false in my case (index = 0 and category.size = 2) so the above line return null when getting category.

foursyth commented 6 years ago

Thanks, I will have a look and update you