@Test public void testLookupResponse() { System.out.println("lookupResponse"); String messageStatus = " "; MStatus expResult = MStatus.SCHEDULED; MStatus result = messageHandler.lookupResponse(messageStatus); assertEquals(expResult, result); messageStatus = "103"; expResult = MStatus.RETRY; result = messageHandler.lookupResponse(messageStatus); assertEquals(expResult, result); messageStatus = "param:"; expResult = MStatus.FAILED; result = messageHandler.lookupResponse(messageStatus); assertEquals(expResult, result); messageStatus = "116"; expResult = MStatus.EXPIRED; result = messageHandler.lookupResponse(messageStatus); assertEquals(expResult, result); }
public MStatus lookupResponse(String code){ if(code.isEmpty()){ return MStatus.SCHEDULED; } for(Entry<MStatus, String> entry: codeResponseMap.entrySet()){ if(entry.getValue().contains(code)){ return entry.getKey(); } } return MStatus.SCHEDULED; }
ORServeGatewayMessageHandlerImpl implements GatewayMessageHandler { public MStatus lookupResponse(String code){ if(code.isEmpty()){ return MStatus.SCHEDULED; } for(Entry<MStatus, String> entry: codeResponseMap.entrySet()){ if(entry.getValue().contains(code)){ return entry.getKey(); } } return MStatus.SCHEDULED; } }
ORServeGatewayMessageHandlerImpl implements GatewayMessageHandler { public MStatus lookupResponse(String code){ if(code.isEmpty()){ return MStatus.SCHEDULED; } for(Entry<MStatus, String> entry: codeResponseMap.entrySet()){ if(entry.getValue().contains(code)){ return entry.getKey(); } } return MStatus.SCHEDULED; }  }
ORServeGatewayMessageHandlerImpl implements GatewayMessageHandler { public MStatus lookupResponse(String code){ if(code.isEmpty()){ return MStatus.SCHEDULED; } for(Entry<MStatus, String> entry: codeResponseMap.entrySet()){ if(entry.getValue().contains(code)){ return entry.getKey(); } } return MStatus.SCHEDULED; }  Set<GatewayResponse> parseMessageResponse(GatewayRequest message, String gatewayResponse); MStatus parseMessageStatus(String gatewayResponse); MStatus lookupStatus(String code); MStatus lookupResponse(String code); CoreManager getCoreManager(); void setCoreManager(CoreManager coreManager); Map<MStatus, String> getCodeStatusMap(); void setCodeStatusMap(Map<MStatus, String> codeStatusMap); Map<MStatus, String> getCodeResponseMap(); void setCodeResponseMap(Map<MStatus, String> codeResponseMap); }
ORServeGatewayMessageHandlerImpl implements GatewayMessageHandler { public MStatus lookupResponse(String code){ if(code.isEmpty()){ return MStatus.SCHEDULED; } for(Entry<MStatus, String> entry: codeResponseMap.entrySet()){ if(entry.getValue().contains(code)){ return entry.getKey(); } } return MStatus.SCHEDULED; }  Set<GatewayResponse> parseMessageResponse(GatewayRequest message, String gatewayResponse); MStatus parseMessageStatus(String gatewayResponse); MStatus lookupStatus(String code); MStatus lookupResponse(String code); CoreManager getCoreManager(); void setCoreManager(CoreManager coreManager); Map<MStatus, String> getCodeStatusMap(); void setCodeStatusMap(Map<MStatus, String> codeStatusMap); Map<MStatus, String> getCodeResponseMap(); void setCodeResponseMap(Map<MStatus, String> codeResponseMap);  }