ResponseDescriptorParser implements NodeParser<ResponseDescriptor> { @Override public ResponseDescriptor parseNode(final Node responseDescriptorNode, final Document document) { ResponseDescriptor responseDescriptor = null; if (responseDescriptorNode != null) { Element el = (Element) responseDescriptorNode; ResponseDescriptorAttributes attributes = getAttributes(el, document); Set<ResponseFormatterDescriptor> responseFormatters = templateDescriptorParser.parseNode(el, document); responseDescriptor = new ResponseDescriptor(attributes, responseFormatters); } return responseDescriptor; }  @Override ResponseDescriptor parseNode(final Node responseDescriptorNode, final Document document);  }
@Test public void testParseNodeShouldReturnResponseDescriptorTemplateFormatter() { ResponseDescriptor actual = underTest.parseNode(responseDescriptorNode, document); assertTrue(actual.getResponseFormatters().contains(templateFormatterDescriptor)); }
@Test public void testParseNodeWhenNodeIsNullShouldReturnNull() { ResponseDescriptor actual = underTest.parseNode(null, document); assertNull(actual); }