@Test public void testGetMessageStatus(){ expect(voiceManager.getMessageStatus(voiceGatewayResponse)).andReturn("OK"); replay(voiceManager); compositeGateway.getMessageStatus(voiceGatewayResponse); verify(voiceManager); reset(voiceManager); expect(textManager.getMessageStatus(textGatewayResponse)).andReturn("OK"); replay(textManager); compositeGateway.getMessageStatus(textGatewayResponse); verify(textManager); reset(textManager); }
public String getMessageStatus(GatewayResponse response) { if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.VOICE ) { return voiceGatewayManager.getMessageStatus(response); } if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.TEXT ) { return textGatewayManager.getMessageStatus(response); } return null; }
CompositeGatewayManager implements GatewayManager { public String getMessageStatus(GatewayResponse response) { if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.VOICE ) { return voiceGatewayManager.getMessageStatus(response); } if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.TEXT ) { return textGatewayManager.getMessageStatus(response); } return null; } }
CompositeGatewayManager implements GatewayManager { public String getMessageStatus(GatewayResponse response) { if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.VOICE ) { return voiceGatewayManager.getMessageStatus(response); } if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.TEXT ) { return textGatewayManager.getMessageStatus(response); } return null; }  }
CompositeGatewayManager implements GatewayManager { public String getMessageStatus(GatewayResponse response) { if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.VOICE ) { return voiceGatewayManager.getMessageStatus(response); } if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.TEXT ) { return textGatewayManager.getMessageStatus(response); } return null; }  String getMessageStatus(GatewayResponse response); MStatus mapMessageStatus(GatewayResponse response); @Transactional @SuppressWarnings("unchecked") Set<GatewayResponse> sendMessage(GatewayRequest gatewayRequest); GatewayMessageHandler getMessageHandler(); void setMessageHandler(GatewayMessageHandler messageHandler); CompositeGatewayMessageHandler getCompositeMessageHandler(); void setCompositeMessageHandler(
			CompositeGatewayMessageHandler compositeMessageHandler); GatewayManager getVoiceGatewayManager(); void setVoiceGatewayManager(GatewayManager voiceGatewayManager); GatewayManager getTextGatewayManager(); void setTextGatewayManager(GatewayManager textGatewayManager); }
CompositeGatewayManager implements GatewayManager { public String getMessageStatus(GatewayResponse response) { if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.VOICE ) { return voiceGatewayManager.getMessageStatus(response); } if ( response .getGatewayRequest() .getMessageRequest() .getMessageType() == MessageType.TEXT ) { return textGatewayManager.getMessageStatus(response); } return null; }  String getMessageStatus(GatewayResponse response); MStatus mapMessageStatus(GatewayResponse response); @Transactional @SuppressWarnings("unchecked") Set<GatewayResponse> sendMessage(GatewayRequest gatewayRequest); GatewayMessageHandler getMessageHandler(); void setMessageHandler(GatewayMessageHandler messageHandler); CompositeGatewayMessageHandler getCompositeMessageHandler(); void setCompositeMessageHandler(
			CompositeGatewayMessageHandler compositeMessageHandler); GatewayManager getVoiceGatewayManager(); void setVoiceGatewayManager(GatewayManager voiceGatewayManager); GatewayManager getTextGatewayManager(); void setTextGatewayManager(GatewayManager textGatewayManager);  }