GatewaySenderFactory mockGatewaySenderFactory = mock(GatewaySenderFactory.class);
GatewaySender mockGatewaySender = mock(GatewaySender.class);
when(mockGatewaySender.getId()).thenReturn(gatewaySenderName);
when(mockGatewaySender.getRemoteDSId()).thenReturn(remoteDistributedSystemId);
when(mockGatewaySenderFactory.create(eq(gatewaySenderName), eq(remoteDistributedSystemId)))
.thenReturn(mockGatewaySender);
return mockGatewaySenderFactory;
}