Hi all,
I pass null as a paremeter to one of my under the
test methods. Now I want to know is there any better way than putting this method call in a try/catch block and check to see myException.getClass().getName() == java.lang.NullPointerException" or myException instanceof NullPointerException or this is the best way in your opinion.
Of course I could use a mock object (e.g. using easyMock) and expect my desirable Exception but I prefer using a real one instead of playing with mocks in this case.
Your ideas are appreciated