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:
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.
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.