I have a controller which returns XML data in response of a call. Below is the code
@RequestMapping(value = "/balance.xml",method = RequestMethod.GET,produces="application/xml")
public AccountBalanceList getAccountBalanceList(@RequestParam("accountId") Integer accountId)
{
AccountBalanceList accountBalanceList = new AccountBalanceList();
List<AccountBalance> list = new ArrayList<AccountBalance>();
list = accountService.getAccountBalanceList(accountId);
accountBalanceList.setList(list);
return accountBalanceList;
}
accountBalanceList is annotated with xml.The response I am getting from this call is like this
<points>
<point>
<balance>$1134.99</balance>
<lots>10000.0</lots>
<onDate>2012-11-11 15:44:00</onDate>
</point>
</points>
I want to write integration test for this controller call. I know how to test a controller with JSON response but I don't know how to test when the response is in XML.Any help will be appreciated.
Regards