@Test public void testSerialize_BatchRequest() throws SerializationException { IntuitBatchRequest batchRequest = new IntuitBatchRequest(); List<BatchItemRequest> list = new ArrayList<BatchItemRequest>(); Customer customerIn = new Customer(); customerIn.setId("NG:2285964"); customerIn.setSparse(true); customerIn.setDisplayName("updated"); BatchItemRequest batchItemRequest = new BatchItemRequest(); batchItemRequest.setBId("123"); batchItemRequest.setOperation(OperationEnum.UPDATE); batchItemRequest.setIntuitObject(getIntuitObject(customerIn)); list.add(batchItemRequest); batchRequest.setBatchItemRequest(list); String data = new XMLSerializer().serialize(getSerializableRequestObject(batchRequest)); Assert.assertNotNull(data); }
public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; } }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }  }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }  String serialize(T object); @SuppressWarnings("unchecked") Response deserialize(String str, Class<?> cl); @Override Response deserializeEntitlements(String decompressedData, Class<EntitlementsResponse> cl); }
XMLSerializer implements IEntitySerializer { public <T> String serialize(T object) throws SerializationException { if (object == null) { return null; } StringWriter writer = new StringWriter(); try { Marshaller marshaller = MessageUtils.createMarshaller(); marshaller.marshal(object, writer); } catch (JAXBException e) { LOG.error("unable to marshall in XML Serializer", e); throw new SerializationException(e); } String documentToPost = writer.toString(); LOG.debug("XML serialized data : " + documentToPost); return documentToPost; }  String serialize(T object); @SuppressWarnings("unchecked") Response deserialize(String str, Class<?> cl); @Override Response deserializeEntitlements(String decompressedData, Class<EntitlementsResponse> cl);  }