@Test public void shouldBuildSuccessfully(@Mocked OdeDepRequest mockOdeDepRequest) { new Expectations() { { mockOdeDepRequest.getEncodeType(); result = "BASE64"; } }; DdsDepRequest actualDdsRequest = null; try { actualDdsRequest = (DdsDepRequest) testDdsDepositRequestManager.buildDdsRequest(mockOdeDepRequest); assertNotNull("Failed to build actualDdsRequest", actualDdsRequest); } catch (Exception e) { fail("Unexpected exception: " + e); } assertEquals("BASE64", actualDdsRequest.getEncodeType()); }
@Override protected DdsRequest buildDdsRequest(OdeRequest odeRequest) throws DdsRequestManagerException { DdsDepRequest ddsDepReq = new DdsDepRequest(); if (odeRequest instanceof OdeDepRequest) { OdeDepRequest odeDepReq = (OdeDepRequest) odeRequest; String sEncodeType = StringUtils.upperCase(odeDepReq.getEncodeType()); if (sEncodeType != null) { EncodeType encodeType = DdsRequest.EncodeType.valueOf(sEncodeType); ddsDepReq.setSystemDepositName(DdsDepositRequestManager.systemName(odeDepReq).getName()) .setEncodeType(encodeType.name()).setEncodedMsg(odeDepReq.getData()); } else { throw new DdsRequestManagerException("Invalid or unsupported EncodeType Deposit: " + sEncodeType + ". Supported encode types are: " + Arrays.asList(DdsRequest.EncodeType.values())); } } else { throw new DdsRequestManagerException("Invalid Request: " + odeRequest.toJson(odeProperties.getVerboseJson())); } return ddsDepReq; }
DdsDepositRequestManager extends DdsRequestManager<DdsStatusMessage> { @Override protected DdsRequest buildDdsRequest(OdeRequest odeRequest) throws DdsRequestManagerException { DdsDepRequest ddsDepReq = new DdsDepRequest(); if (odeRequest instanceof OdeDepRequest) { OdeDepRequest odeDepReq = (OdeDepRequest) odeRequest; String sEncodeType = StringUtils.upperCase(odeDepReq.getEncodeType()); if (sEncodeType != null) { EncodeType encodeType = DdsRequest.EncodeType.valueOf(sEncodeType); ddsDepReq.setSystemDepositName(DdsDepositRequestManager.systemName(odeDepReq).getName()) .setEncodeType(encodeType.name()).setEncodedMsg(odeDepReq.getData()); } else { throw new DdsRequestManagerException("Invalid or unsupported EncodeType Deposit: " + sEncodeType + ". Supported encode types are: " + Arrays.asList(DdsRequest.EncodeType.values())); } } else { throw new DdsRequestManagerException("Invalid Request: " + odeRequest.toJson(odeProperties.getVerboseJson())); } return ddsDepReq; } }
DdsDepositRequestManager extends DdsRequestManager<DdsStatusMessage> { @Override protected DdsRequest buildDdsRequest(OdeRequest odeRequest) throws DdsRequestManagerException { DdsDepRequest ddsDepReq = new DdsDepRequest(); if (odeRequest instanceof OdeDepRequest) { OdeDepRequest odeDepReq = (OdeDepRequest) odeRequest; String sEncodeType = StringUtils.upperCase(odeDepReq.getEncodeType()); if (sEncodeType != null) { EncodeType encodeType = DdsRequest.EncodeType.valueOf(sEncodeType); ddsDepReq.setSystemDepositName(DdsDepositRequestManager.systemName(odeDepReq).getName()) .setEncodeType(encodeType.name()).setEncodedMsg(odeDepReq.getData()); } else { throw new DdsRequestManagerException("Invalid or unsupported EncodeType Deposit: " + sEncodeType + ". Supported encode types are: " + Arrays.asList(DdsRequest.EncodeType.values())); } } else { throw new DdsRequestManagerException("Invalid Request: " + odeRequest.toJson(odeProperties.getVerboseJson())); } return ddsDepReq; } DdsDepositRequestManager(OdeProperties odeProperties); }
DdsDepositRequestManager extends DdsRequestManager<DdsStatusMessage> { @Override protected DdsRequest buildDdsRequest(OdeRequest odeRequest) throws DdsRequestManagerException { DdsDepRequest ddsDepReq = new DdsDepRequest(); if (odeRequest instanceof OdeDepRequest) { OdeDepRequest odeDepReq = (OdeDepRequest) odeRequest; String sEncodeType = StringUtils.upperCase(odeDepReq.getEncodeType()); if (sEncodeType != null) { EncodeType encodeType = DdsRequest.EncodeType.valueOf(sEncodeType); ddsDepReq.setSystemDepositName(DdsDepositRequestManager.systemName(odeDepReq).getName()) .setEncodeType(encodeType.name()).setEncodedMsg(odeDepReq.getData()); } else { throw new DdsRequestManagerException("Invalid or unsupported EncodeType Deposit: " + sEncodeType + ". Supported encode types are: " + Arrays.asList(DdsRequest.EncodeType.values())); } } else { throw new DdsRequestManagerException("Invalid Request: " + odeRequest.toJson(odeProperties.getVerboseJson())); } return ddsDepReq; } DdsDepositRequestManager(OdeProperties odeProperties);  }
DdsDepositRequestManager extends DdsRequestManager<DdsStatusMessage> { @Override protected DdsRequest buildDdsRequest(OdeRequest odeRequest) throws DdsRequestManagerException { DdsDepRequest ddsDepReq = new DdsDepRequest(); if (odeRequest instanceof OdeDepRequest) { OdeDepRequest odeDepReq = (OdeDepRequest) odeRequest; String sEncodeType = StringUtils.upperCase(odeDepReq.getEncodeType()); if (sEncodeType != null) { EncodeType encodeType = DdsRequest.EncodeType.valueOf(sEncodeType); ddsDepReq.setSystemDepositName(DdsDepositRequestManager.systemName(odeDepReq).getName()) .setEncodeType(encodeType.name()).setEncodedMsg(odeDepReq.getData()); } else { throw new DdsRequestManagerException("Invalid or unsupported EncodeType Deposit: " + sEncodeType + ". Supported encode types are: " + Arrays.asList(DdsRequest.EncodeType.values())); } } else { throw new DdsRequestManagerException("Invalid Request: " + odeRequest.toJson(odeProperties.getVerboseJson())); } return ddsDepReq; } DdsDepositRequestManager(OdeProperties odeProperties);   }