nazymko / powermock

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

When mocking a static method in a class, this method is actually executed, this is not handy. #114

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

When running the "http://code.google.com/p/powermock/wiki/MockStatic"
MockStatic example, at line 52:
expect(IdGenerator.generateNewId()).andReturn(expectedId);

the problem is that this method generateNewId() is really executed (which
is logical) but if in this method some other code is present which needs
some environment setup (like hibernate) , this will fail.

Any workaround for this?

Original issue reported on code.google.com by stef.hey...@gmail.com on 3 Jun 2009 at 1:21

GoogleCodeExporter commented 9 years ago
Please use our mailing list (powermock@googlegroups.com) instead of posting a 
new
issue before we know that a new issue is needed. If you send this message to the
mailing-list I will answer you asap!

Original comment by johan.ha...@gmail.com on 4 Jun 2009 at 8:23

GoogleCodeExporter commented 9 years ago
Sent to mailing list.

Original comment by stef.hey...@gmail.com on 4 Jun 2009 at 8:26

GoogleCodeExporter commented 9 years ago
???

We're writing to let you know that the group that you tried to contact
(powermock) either doesn't exist, or you don't have permission to post to it.
There are a few possible reasons why this happened:

 * You might have spelled or formatted the group name incorrectly.
 * The owner of the group removed this group, so there's nobody there to
contact.
 * You may need to join the group before being allowed to post.
 * This group may not be open to posting.

 If you have questions about this or any other group, please visit the Google
Groups Help Center at http://groups.google.com/support.

 Thanks, and we hope you'll continue to enjoy Google Groups.

 The Google Groups Team

Original comment by stef.hey...@gmail.com on 4 Jun 2009 at 8:28

GoogleCodeExporter commented 9 years ago
You must first join the group, goto http://groups.google.com/group/powermock. 
Then
send e-mails to powermock@googlegroups.com. Thanks.

Original comment by johan.ha...@gmail.com on 4 Jun 2009 at 8:38

GoogleCodeExporter commented 9 years ago
This is not an error report but rather something that should be discussed on the
mailing-list. Changing status to invalid.

Original comment by johan.ha...@gmail.com on 5 Jun 2009 at 6:58