/** * The HTTP POST handler. Posting XML to the queue, receiving result and sets the result as an * attribute to the model. * * @param accountForm form * @param model model */ @RequestMapping(value = "/accountNameChangeEvent", method = RequestMethod.POST) public void testAccountNameChangeEvent(@ModelAttribute AccountForm accountForm, Model model) { AccountForm accForm = createAccountNameChangeForm(accountForm); String xml = accForm.toUpdateEventXML(AccountForm.EventType.UPDATE, AccountUpdateSubType.NAME_CHANGE); LOG.info("called testAccountNameChangeEvent() for POST. xml = " + xml); setUp(); String correlationId = getJms().send(INCOMING, xml); LOG.info("Sent XML with correlationId " + correlationId); AccountNameChangeEvent consumedAccountNameChangeEvent = (AccountNameChangeEvent) getJms().receive(ACCOUNT_NAME_CHANGE, correlationId); model.addAttribute("result", consumedAccountNameChangeEvent); LOG.info("received event = " + consumedAccountNameChangeEvent); }
private AccountForm createAccountNameChangeForm(AccountForm accountForm) { AccountForm accountUpdateCommonForm = createAccountUpdateCommonForm(accountForm); accountUpdateCommonForm.setAccountName(accountForm.getAccountName()); return accountUpdateCommonForm; }