@Test public void testParseMessageResponse() { MessageRequest mr1 = new MessageRequestImpl(); mr1.setId(31000000001l); mr1.setRecipientId("123456789"); mr1.setRequestId("mr1"); GatewayRequest r1 = new GatewayRequestImpl(); r1.setId(31000000002l); r1.setMessageRequest(mr1); r1.setRequestId(mr1.getRequestId()); r1.setMessageStatus(MStatus.PENDING); r1.setRecipientsNumber("15555555555"); for ( String code : statusCodes.keySet()) { Set<GatewayResponse> responses = intellIVRMessageHandler.parseMessageResponse(r1, code); for ( GatewayResponse response : responses ) { assertTrue(response.getDateCreated()!= null); assertEquals(r1, response.getGatewayRequest()); assertEquals(mr1.getId().toString(), response.getGatewayMessageId()); assertEquals(statusCodes.get(code), response.getMessageStatus()); assertEquals("15555555555", response.getRecipientNumber()); assertEquals("mr1", response.getRequestId()); assertEquals(code, response.getResponseText()); } } }
public Set<GatewayResponse> parseMessageResponse(GatewayRequest gatewayRequest, String statusMessage) { Set<GatewayResponse> responses = new HashSet<GatewayResponse>(); GatewayResponse gwResponse = coreManager.createGatewayResponse(); gwResponse.setGatewayRequest(gatewayRequest); gwResponse.setGatewayMessageId(gatewayRequest.getMessageRequest().getId().toString()); gwResponse.setRecipientNumber(gatewayRequest.getRecipientsNumber()); gwResponse.setRequestId(gatewayRequest.getRequestId()); gwResponse.setResponseText(statusMessage); gwResponse.setMessageStatus(lookupStatus(statusMessage)); gwResponse.setDateCreated(new Date()); responses.add(gwResponse); return responses; }
IntellIVRGatewayMessageHandler implements GatewayMessageHandler { public Set<GatewayResponse> parseMessageResponse(GatewayRequest gatewayRequest, String statusMessage) { Set<GatewayResponse> responses = new HashSet<GatewayResponse>(); GatewayResponse gwResponse = coreManager.createGatewayResponse(); gwResponse.setGatewayRequest(gatewayRequest); gwResponse.setGatewayMessageId(gatewayRequest.getMessageRequest().getId().toString()); gwResponse.setRecipientNumber(gatewayRequest.getRecipientsNumber()); gwResponse.setRequestId(gatewayRequest.getRequestId()); gwResponse.setResponseText(statusMessage); gwResponse.setMessageStatus(lookupStatus(statusMessage)); gwResponse.setDateCreated(new Date()); responses.add(gwResponse); return responses; } }
IntellIVRGatewayMessageHandler implements GatewayMessageHandler { public Set<GatewayResponse> parseMessageResponse(GatewayRequest gatewayRequest, String statusMessage) { Set<GatewayResponse> responses = new HashSet<GatewayResponse>(); GatewayResponse gwResponse = coreManager.createGatewayResponse(); gwResponse.setGatewayRequest(gatewayRequest); gwResponse.setGatewayMessageId(gatewayRequest.getMessageRequest().getId().toString()); gwResponse.setRecipientNumber(gatewayRequest.getRecipientsNumber()); gwResponse.setRequestId(gatewayRequest.getRequestId()); gwResponse.setResponseText(statusMessage); gwResponse.setMessageStatus(lookupStatus(statusMessage)); gwResponse.setDateCreated(new Date()); responses.add(gwResponse); return responses; }  }
IntellIVRGatewayMessageHandler implements GatewayMessageHandler { public Set<GatewayResponse> parseMessageResponse(GatewayRequest gatewayRequest, String statusMessage) { Set<GatewayResponse> responses = new HashSet<GatewayResponse>(); GatewayResponse gwResponse = coreManager.createGatewayResponse(); gwResponse.setGatewayRequest(gatewayRequest); gwResponse.setGatewayMessageId(gatewayRequest.getMessageRequest().getId().toString()); gwResponse.setRecipientNumber(gatewayRequest.getRecipientsNumber()); gwResponse.setRequestId(gatewayRequest.getRequestId()); gwResponse.setResponseText(statusMessage); gwResponse.setMessageStatus(lookupStatus(statusMessage)); gwResponse.setDateCreated(new Date()); responses.add(gwResponse); return responses; }  Set<GatewayResponse> parseMessageResponse(GatewayRequest gatewayRequest,
			String statusMessage); MStatus parseMessageStatus(String messageStatus); MStatus lookupResponse(String code); MStatus lookupStatus(String code); CoreManager getCoreManager(); void setCoreManager(CoreManager coreManager); Map<String, MStatus> getStatusMap(); void setStatusMap(Map<String, MStatus> statusMap); Map<String, MStatus> getResponseMap(); void setResponseMap(Map<String, MStatus> responseMap); }
IntellIVRGatewayMessageHandler implements GatewayMessageHandler { public Set<GatewayResponse> parseMessageResponse(GatewayRequest gatewayRequest, String statusMessage) { Set<GatewayResponse> responses = new HashSet<GatewayResponse>(); GatewayResponse gwResponse = coreManager.createGatewayResponse(); gwResponse.setGatewayRequest(gatewayRequest); gwResponse.setGatewayMessageId(gatewayRequest.getMessageRequest().getId().toString()); gwResponse.setRecipientNumber(gatewayRequest.getRecipientsNumber()); gwResponse.setRequestId(gatewayRequest.getRequestId()); gwResponse.setResponseText(statusMessage); gwResponse.setMessageStatus(lookupStatus(statusMessage)); gwResponse.setDateCreated(new Date()); responses.add(gwResponse); return responses; }  Set<GatewayResponse> parseMessageResponse(GatewayRequest gatewayRequest,
			String statusMessage); MStatus parseMessageStatus(String messageStatus); MStatus lookupResponse(String code); MStatus lookupStatus(String code); CoreManager getCoreManager(); void setCoreManager(CoreManager coreManager); Map<String, MStatus> getStatusMap(); void setStatusMap(Map<String, MStatus> statusMap); Map<String, MStatus> getResponseMap(); void setResponseMap(Map<String, MStatus> responseMap);  }