@Test(expected = IllegalArgumentException.class) public void testDeserialize_Given_Null_GreenCcdXml_Throws_IllegalArgumentException() throws Throwable { GreenCcdSerializerImpl sut = new GreenCcdSerializerImpl(); sut.Deserialize(null); }
@Override public GreenCCD Deserialize(String greenCcdXml) throws GreenCcdSerializerException { Assert.hasText(greenCcdXml); try { JAXBContext jaxbContext = JAXBContext.newInstance(GreenCCD.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(greenCcdXml); GreenCCD greenCcd = (GreenCCD) unmarshaller.unmarshal(reader); reader.close(); return greenCcd; } catch (Exception ex) { String erroMessage = "Error occured when trying to serialize Green CCD XML"; logger.error(erroMessage, ex); throw new GreenCcdSerializerException(erroMessage, ex); } }
GreenCcdSerializerImpl implements GreenCcdSerializer { @Override public GreenCCD Deserialize(String greenCcdXml) throws GreenCcdSerializerException { Assert.hasText(greenCcdXml); try { JAXBContext jaxbContext = JAXBContext.newInstance(GreenCCD.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(greenCcdXml); GreenCCD greenCcd = (GreenCCD) unmarshaller.unmarshal(reader); reader.close(); return greenCcd; } catch (Exception ex) { String erroMessage = "Error occured when trying to serialize Green CCD XML"; logger.error(erroMessage, ex); throw new GreenCcdSerializerException(erroMessage, ex); } } }
GreenCcdSerializerImpl implements GreenCcdSerializer { @Override public GreenCCD Deserialize(String greenCcdXml) throws GreenCcdSerializerException { Assert.hasText(greenCcdXml); try { JAXBContext jaxbContext = JAXBContext.newInstance(GreenCCD.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(greenCcdXml); GreenCCD greenCcd = (GreenCCD) unmarshaller.unmarshal(reader); reader.close(); return greenCcd; } catch (Exception ex) { String erroMessage = "Error occured when trying to serialize Green CCD XML"; logger.error(erroMessage, ex); throw new GreenCcdSerializerException(erroMessage, ex); } }  }
GreenCcdSerializerImpl implements GreenCcdSerializer { @Override public GreenCCD Deserialize(String greenCcdXml) throws GreenCcdSerializerException { Assert.hasText(greenCcdXml); try { JAXBContext jaxbContext = JAXBContext.newInstance(GreenCCD.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(greenCcdXml); GreenCCD greenCcd = (GreenCCD) unmarshaller.unmarshal(reader); reader.close(); return greenCcd; } catch (Exception ex) { String erroMessage = "Error occured when trying to serialize Green CCD XML"; logger.error(erroMessage, ex); throw new GreenCcdSerializerException(erroMessage, ex); } }  @Override GreenCCD Deserialize(String greenCcdXml); }
GreenCcdSerializerImpl implements GreenCcdSerializer { @Override public GreenCCD Deserialize(String greenCcdXml) throws GreenCcdSerializerException { Assert.hasText(greenCcdXml); try { JAXBContext jaxbContext = JAXBContext.newInstance(GreenCCD.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(greenCcdXml); GreenCCD greenCcd = (GreenCCD) unmarshaller.unmarshal(reader); reader.close(); return greenCcd; } catch (Exception ex) { String erroMessage = "Error occured when trying to serialize Green CCD XML"; logger.error(erroMessage, ex); throw new GreenCcdSerializerException(erroMessage, ex); } }  @Override GreenCCD Deserialize(String greenCcdXml);  }