@Test(expected=C32ParserException.class) public void testParseC32_Given_C32ToGreenCcdTransformerException_Throws_C32ParserException() throws C32ToGreenCcdTransformerException, GreenCcdSerializerException, C32ParserException { String c32Xml = "Is this a valid c32?"; C32ToGreenCcdTransformer c32ToGreenCcdTransformer = mock(C32ToGreenCcdTransformer.class); GreenCcdSerializer greenCcdSerializern = mock(GreenCcdSerializer.class); GreenCCD greenCCD = mock(GreenCCD.class); when(c32ToGreenCcdTransformer.TransformC32ToGreenCcd(anyString())) .thenThrow(C32ParserException.class); C32ParserImpl sut = new C32ParserImpl(c32ToGreenCcdTransformer, greenCcdSerializern); GreenCCD result = sut.ParseC32(c32Xml); }
@Override public GreenCCD ParseC32(String c32xml) throws C32ParserException { Assert.hasText(c32xml); try { String greenCcdXml = c32ToGreenCcdTransformer .TransformC32ToGreenCcd(c32xml); GreenCCD greenCcdDto = greenCcdSerializer.Deserialize(greenCcdXml); return greenCcdDto; } catch (Exception ex) { String errorMessage = "Error occured when trying to parse C32"; logger.error(errorMessage, ex); throw new C32ParserException(errorMessage, ex); } }
C32ParserImpl implements C32Parser { @Override public GreenCCD ParseC32(String c32xml) throws C32ParserException { Assert.hasText(c32xml); try { String greenCcdXml = c32ToGreenCcdTransformer .TransformC32ToGreenCcd(c32xml); GreenCCD greenCcdDto = greenCcdSerializer.Deserialize(greenCcdXml); return greenCcdDto; } catch (Exception ex) { String errorMessage = "Error occured when trying to parse C32"; logger.error(errorMessage, ex); throw new C32ParserException(errorMessage, ex); } } }
C32ParserImpl implements C32Parser { @Override public GreenCCD ParseC32(String c32xml) throws C32ParserException { Assert.hasText(c32xml); try { String greenCcdXml = c32ToGreenCcdTransformer .TransformC32ToGreenCcd(c32xml); GreenCCD greenCcdDto = greenCcdSerializer.Deserialize(greenCcdXml); return greenCcdDto; } catch (Exception ex) { String errorMessage = "Error occured when trying to parse C32"; logger.error(errorMessage, ex); throw new C32ParserException(errorMessage, ex); } } C32ParserImpl();  C32ParserImpl(C32ToGreenCcdTransformer c32ToGreenCcdTransformer,
			GreenCcdSerializer greenCcdSerializer); }
C32ParserImpl implements C32Parser { @Override public GreenCCD ParseC32(String c32xml) throws C32ParserException { Assert.hasText(c32xml); try { String greenCcdXml = c32ToGreenCcdTransformer .TransformC32ToGreenCcd(c32xml); GreenCCD greenCcdDto = greenCcdSerializer.Deserialize(greenCcdXml); return greenCcdDto; } catch (Exception ex) { String errorMessage = "Error occured when trying to parse C32"; logger.error(errorMessage, ex); throw new C32ParserException(errorMessage, ex); } } C32ParserImpl();  C32ParserImpl(C32ToGreenCcdTransformer c32ToGreenCcdTransformer,
			GreenCcdSerializer greenCcdSerializer); @Override GreenCCD ParseC32(String c32xml); }
C32ParserImpl implements C32Parser { @Override public GreenCCD ParseC32(String c32xml) throws C32ParserException { Assert.hasText(c32xml); try { String greenCcdXml = c32ToGreenCcdTransformer .TransformC32ToGreenCcd(c32xml); GreenCCD greenCcdDto = greenCcdSerializer.Deserialize(greenCcdXml); return greenCcdDto; } catch (Exception ex) { String errorMessage = "Error occured when trying to parse C32"; logger.error(errorMessage, ex); throw new C32ParserException(errorMessage, ex); } } C32ParserImpl();  C32ParserImpl(C32ToGreenCcdTransformer c32ToGreenCcdTransformer,
			GreenCcdSerializer greenCcdSerializer); @Override GreenCCD ParseC32(String c32xml);  }