TestCase.getName() cannot be null with Spring AbstractJpaTests PowerMockito

26 views
Skip to first unread message

Jey Duraisamy

unread,
Feb 28, 2012, 3:05:31 PM2/28/12
to PowerMock
I am using PowerMockito(1.4.11) , Junit 4.4, with Spring
AbstractJpaTests(Spring test 1.6.0). When I execute the Test case it
gives

junit.framework.AssertionFailedError: TestCase.getName() cannot be
null
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at junit.framework.Assert.assertNotNull(Assert.java:214)
at
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.getTestMethod(AbstractAnnotationAwareTransactionalTests.java:
226)

Test case works if getName() method is overridden. But this is not
going to work since there will be more than one testcase in the class.

ps: The same works with out any issue if I use Mockito

Any idea of what might be causing this?
Thanks in advance.

--Jey

Johan Haleby

unread,
Feb 29, 2012, 2:14:53 AM2/29/12
to powe...@googlegroups.com
Hmm I suppose you're using one of the JUnit rules? If you're not using the javagent based rule you should try it out and see if it makes any difference.

/Johan


--Jey

--
You received this message because you are subscribed to the Google Groups "PowerMock" group.
To post to this group, send email to powe...@googlegroups.com.
To unsubscribe from this group, send email to powermock+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/powermock?hl=en.


Reply all
Reply to author
Forward
0 new messages