use of org.apache.geode.internal.cache.DistributedCacheOperation.CacheOperationMessage in project geode by apache.
the class CacheOperationMessageTest method shouldBeMockable.
@Test
public void shouldBeMockable() throws Exception {
CacheOperationMessage mockCacheOperationMessage = mock(CacheOperationMessage.class);
DistributionManager mockDistributionManager = mock(DistributionManager.class);
when(mockCacheOperationMessage.supportsDirectAck()).thenReturn(true);
when(mockCacheOperationMessage._mayAddToMultipleSerialGateways(eq(mockDistributionManager))).thenReturn(true);
mockCacheOperationMessage.process(mockDistributionManager);
verify(mockCacheOperationMessage, times(1)).process(mockDistributionManager);
assertThat(mockCacheOperationMessage.supportsDirectAck()).isTrue();
assertThat(mockCacheOperationMessage._mayAddToMultipleSerialGateways(mockDistributionManager)).isTrue();
}
use of org.apache.geode.internal.cache.DistributedCacheOperation.CacheOperationMessage in project geode by apache.
the class DistributedCacheOperationTest method shouldBeMockable.
@Test
public void shouldBeMockable() throws Exception {
DistributedCacheOperation mockDistributedCacheOperation = mock(DistributedCacheOperation.class);
CacheOperationMessage mockCacheOperationMessage = mock(CacheOperationMessage.class);
Map<InternalDistributedMember, PersistentMemberID> persistentIds = new HashMap<>();
when(mockDistributedCacheOperation.supportsDirectAck()).thenReturn(false);
mockDistributedCacheOperation.waitForAckIfNeeded(mockCacheOperationMessage, persistentIds);
verify(mockDistributedCacheOperation, times(1)).waitForAckIfNeeded(mockCacheOperationMessage, persistentIds);
assertThat(mockDistributedCacheOperation.supportsDirectAck()).isFalse();
}
Aggregations