Thoppan / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

Better error messages when I forget to PrepareForTest #330

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Run the tests in the attached Maven project.

The test runs this code: 
PowerMockito.doThrow(new RuntimeException()).when(app).finalMethod();

But it "forgets" to prepare the class for test.

Actual: Exception not thrown; the test fails and it's not clear why.

Expected: When I try to mock out a final method, but the class isn't prepared 
for test, I wish PowerMock would give me an error message reminding me to 
prepare. (Or, even better, just PrepareForTest on the fly!)

(I lost an hour on this today. :-p)

Original issue reported on code.google.com by dan.fabu...@redfin.com on 19 May 2011 at 1:43

Attachments: