Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubbing/supressing should have precedence over mocking #327

Closed
johanhaleby opened this issue Jul 24, 2015 · 1 comment
Closed

Stubbing/supressing should have precedence over mocking #327

johanhaleby opened this issue Jul 24, 2015 · 1 comment

Comments

@johanhaleby
Copy link
Collaborator

From johan.ha...@gmail.com on January 03, 2011 09:43:19

There's a bug in EasyMock that treats methods called in the ctor as mocked even though they're not. In these cases it would be good to simply be able to suppress the methods called in the ctor. But since mocking has precedence over suppressing/stubbing this is not possible. This should be an easy fix in MockGateway.

Hudson hudsonMockedInstance = createPartialMock(Hudson.class, new String[]{ "getRootDir", "getMe" }, new Object[]{ currentTestDirectory, (ServletContext)null }); // Here, the IllegalArgumentException is thrown, saying getExtensionList behaviour has not been defined

Original issue: http://code.google.com/p/powermock/issues/detail?id=307

@johanhaleby
Copy link
Collaborator Author

From johan.ha...@gmail.com on April 10, 2011 05:52:40

Labels: -Milestone-Release1.4 Milestone-Release1.5

@thekingn0thing thekingn0thing modified the milestone: PowerMock 1.6.5 Feb 26, 2016
thekingn0thing added a commit to thekingn0thing/powermock that referenced this issue Mar 12, 2016
* upstream/master:
  Update changelog.txt
  Fix powermock#634 java.lang.NoClassDefFoundError: Could not initialize class org.mockito.internal.util.MockUtil
  More TestNG tests.
  Update dependencies
  Throw exception on mockStatic if the class wasn't prepared for test (@PrepareForTest(ClassWithStatic.class)). Implemented # 604 for: -mockito junit -mockito testng
  Throw exception on when(Class c) if class wasn't prepared for test (@PrepareForTest(ClassWithStatic.class)) Implemented # 622 for: - Mockito jUnit - Mockito TestNG
  Add usage and dependencies statistic
  Update link in test source for issue powermock#105
  Stubbing/supressing should have precedence over mocking powermock#327
  Update changelog.txt
  powermock-590 suppress(method) doesn't work on a @SPY
  powermock-572 Enable @PrepareForTest on enums
  Add guidelines for managing GitHub issues
  Update change log.
  powermock-214 Whitebox.invokeConstructor may not work as expected with overloaded constructors Fix powermock#214
  Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants