79495983

Date: 2025-03-09 13:35:09
Score: 0.5
Natty:
Report link

it was not working for me when method param which was sent is null.

doThrow(Exception.class).when(mockedObj).method(anyString())

mockedObj.method(name); //value of name = null.

So, i had to change test as below

doThrow(Exception.class).when(mockedObj).method(eq(null))

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: U_R_Naveen UR_Naveen