@Test public void testGetClauseFromXmlEmptyValue() throws Exception { Document doc = new Document("<customfield_100 monkey=''/>"); Element el = doc.getElement("customfield_100"); final SimpleCustomFieldClauseXmlHandler handler = new SimpleCustomFieldClauseXmlHandler("monkey", Operator.GREATER_THAN); assertNull(handler.convertXmlToClause(el).getClause()); }
@Test public void testGetClauseFromXmlHappyPath() throws Exception { Document doc = new Document("<customfield_100 monkey='bob'/>"); Element el = doc.getElement("customfield_100"); final TerminalClauseImpl expected = new TerminalClauseImpl("cf[100]", Operator.GREATER_THAN, "bob"); final SimpleCustomFieldClauseXmlHandler handler = new SimpleCustomFieldClauseXmlHandler("monkey", Operator.GREATER_THAN); assertEquals(expected, handler.convertXmlToClause(el).getClause()); }