Search in sources :

Example 1 with CallsRealMethods

use of org.mockito.internal.stubbing.answers.CallsRealMethods in project mockito by mockito.

the class AbstractByteBuddyMockMakerTest method settingsWithSuperCall.

private static <T> MockCreationSettings<T> settingsWithSuperCall(Class<T> type) {
    MockSettingsImpl<T> mockSettings = new MockSettingsImpl<T>();
    mockSettings.setTypeToMock(type);
    mockSettings.defaultAnswer(new CallsRealMethods());
    return mockSettings;
}
Also used : CallsRealMethods(org.mockito.internal.stubbing.answers.CallsRealMethods) MockSettingsImpl(org.mockito.internal.creation.MockSettingsImpl)

Example 2 with CallsRealMethods

use of org.mockito.internal.stubbing.answers.CallsRealMethods in project geode by apache.

the class RemoteOperationMessageTest method setUp.

@Before
public void setUp() throws InterruptedException {
    cache = Fakes.cache();
    dm = mock(DistributionManager.class);
    msg = mock(RemoteOperationMessage.class);
    r = mock(LocalRegion.class);
    txMgr = mock(TXManagerImpl.class);
    tx = mock(TXStateProxyImpl.class);
    when(msg.checkCacheClosing(dm)).thenReturn(false);
    when(msg.checkDSClosing(dm)).thenReturn(false);
    when(msg.getCache(dm)).thenReturn(cache);
    when(msg.getRegionByPath(cache)).thenReturn(r);
    when(msg.getTXManager(cache)).thenReturn(txMgr);
    doAnswer(new CallsRealMethods()).when(msg).process(dm);
}
Also used : TXManagerImpl(org.apache.geode.internal.cache.TXManagerImpl) CallsRealMethods(org.mockito.internal.stubbing.answers.CallsRealMethods) TXStateProxyImpl(org.apache.geode.internal.cache.TXStateProxyImpl) DistributionManager(org.apache.geode.distributed.internal.DistributionManager) Before(org.junit.Before)

Example 3 with CallsRealMethods

use of org.mockito.internal.stubbing.answers.CallsRealMethods in project geode by apache.

the class PartitionMessageTest method setUp.

@Before
public void setUp() throws PRLocallyDestroyedException, InterruptedException {
    cache = Fakes.cache();
    dm = mock(DistributionManager.class);
    msg = mock(PartitionMessage.class);
    pr = mock(PartitionedRegion.class);
    txMgr = mock(TXManagerImpl.class);
    tx = mock(TXStateProxyImpl.class);
    when(msg.checkCacheClosing(dm)).thenReturn(false);
    when(msg.checkDSClosing(dm)).thenReturn(false);
    when(msg.getPartitionedRegion()).thenReturn(pr);
    when(msg.getInternalCache()).thenReturn(cache);
    when(msg.getStartPartitionMessageProcessingTime(pr)).thenReturn(startTime);
    when(msg.getTXManagerImpl(cache)).thenReturn(txMgr);
    doAnswer(new CallsRealMethods()).when(msg).process(dm);
}
Also used : TXManagerImpl(org.apache.geode.internal.cache.TXManagerImpl) CallsRealMethods(org.mockito.internal.stubbing.answers.CallsRealMethods) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) TXStateProxyImpl(org.apache.geode.internal.cache.TXStateProxyImpl) DistributionManager(org.apache.geode.distributed.internal.DistributionManager) Before(org.junit.Before)

Aggregations

CallsRealMethods (org.mockito.internal.stubbing.answers.CallsRealMethods)3 DistributionManager (org.apache.geode.distributed.internal.DistributionManager)2 TXManagerImpl (org.apache.geode.internal.cache.TXManagerImpl)2 TXStateProxyImpl (org.apache.geode.internal.cache.TXStateProxyImpl)2 Before (org.junit.Before)2 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)1 MockSettingsImpl (org.mockito.internal.creation.MockSettingsImpl)1