@Test public void testParseNodeShouldReturnWithNullConditionWhenConditionNodeArgumentHasOneChildWithUnknownTagName() { given(node.getChildNodes()).willReturn(nodeList); given(nodeList.getLength()).willReturn(1); given(nodeList.item(0)).willReturn(node); given(node.getNodeType()).willReturn(Node.ELEMENT_NODE); given(node.getTagName()).willReturn("UNKNOWN_TAG_NAME"); ConditionDescriptor actual = underTest.parseNode(node, document); assertNull(actual.getCondition()); }
@Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); } }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }  }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }  @Override ConditionDescriptor parseNode(final Node conDes, final Document document); }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }  @Override ConditionDescriptor parseNode(final Node conDes, final Document document);  }