Groups
Groups
Sign in
Groups
Groups
PowerMock
Conversations
About
Send feedback
Help
isAssignableFrom returns false
21 views
Skip to first unread message
CraigA
unread,
Feb 13, 2012, 11:30:56 AM
2/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PowerMock
A mocked object apparently can't be tested against via
isAssignableFrom(). For example:
Foo foo = createMock(Foo.class);
if (Foo.getClass().isAssignableFrom(Foo.class)
always returns false. Is there a way to make this work? If not, is
there some way to work around this?
Thanks.
CraigA
unread,
Feb 13, 2012, 4:32:51 PM
2/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PowerMock
Sorry, that should say:
if (foo.getClass.isAssignableFrom(Foo.class))
so that it's using the mocked object. So - "foo.getClass()" rather
than "Foo.getClass()". Of course.
Reply all
Reply to author
Forward
0 new messages