SimpleRopRequestContext context = new SimpleRopRequestContext(ropContext);
context.setMessageFormat(MessageFormat.xml);
TypeDescriptor addrTypeDescriptor = TypeDescriptor.valueOf(Addresss.class);
TypeDescriptor strTypeDescriptor = TypeDescriptor.valueOf(String.class);
RopRequestMessageConverter converter = new RopRequestMessageConverter();
String addressStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<address zoneCode=\"001\" doorCode=\"002\">\n" +
" <streets>\n" +
" <street no=\"001\" name=\"street1\"/>\n" +
" <street no=\"002\" name=\"street2\"/>\n" +
" </streets>\n" +
"</address>";
Object destObj = converter.convert(addressStr, strTypeDescriptor, addrTypeDescriptor);
assertTrue(destObj instanceof Addresss);
Addresss addresss = (Addresss) destObj;
assertEquals(addresss.getZoneCode(), "001");
assertEquals(addresss.getDoorCode(), "002");
assertEquals(addresss.getStreets().size(), 2);