Skip to content

Commit

Permalink
fixed files form Mockito #16
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent f840778 commit dd9f371
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions projects/Mockito/16/org/mockito/Mockito.java
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public static <T> T mock(Class<T> classToMock, Answer defaultAnswer) {
* @return mock object
*/
public static <T> T mock(Class<T> classToMock, MockSettings mockSettings) {
return MOCKITO_CORE.mock(classToMock, mockSettings);
return MOCKITO_CORE.mock(classToMock, mockSettings, true);
}

/**
Expand Down Expand Up @@ -896,7 +896,7 @@ public static <T> T mock(Class<T> classToMock, MockSettings mockSettings) {
public static <T> T spy(T object) {
return MOCKITO_CORE.mock((Class<T>) object.getClass(), withSettings()
.spiedInstance(object)
.defaultAnswer(CALLS_REAL_METHODS));
.defaultAnswer(CALLS_REAL_METHODS), true);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions projects/Mockito/16/org/mockito/internal/MockitoCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public class MockitoCore {
private final MockUtil mockUtil = new MockUtil();
private final MockingProgress mockingProgress = new ThreadSafeMockingProgress();

public <T> T mock(Class<T> classToMock, MockSettings mockSettings, boolean shouldResetOngoingStubbing) { return mock(classToMock, mockSettings); }
public <T> T mock(Class<T> classToMock, MockSettings mockSettings) {
public <T> T mock(Class<T> classToMock, MockSettings mockSettings, boolean shouldResetOngoingStubbing) {
mockingProgress.validateState();
if (shouldResetOngoingStubbing) {
mockingProgress.resetOngoingStubbing();
}
return mockUtil.createMock(classToMock, (MockSettingsImpl) mockSettings);
}

Expand Down

0 comments on commit dd9f371

Please sign in to comment.