@Test void testEvaluateExpressionNull() { when(expressionAttribute.getExpression()).thenReturn(null); assertThrows( TemplateExpressionException.class, () -> templateExpressionEvaluator.evaluate(mock(Entity.class))); }
@Override public Object evaluate(Entity entity) { initTemplate(); Map<String, Object> tagValues = getTemplateTagValue(entity); try { return template.apply(Context.newContext(tagValues)); } catch (IOException e) { throw new TemplateExpressionException(attribute, e); } }
TemplateExpressionEvaluator implements ExpressionEvaluator { @Override public Object evaluate(Entity entity) { initTemplate(); Map<String, Object> tagValues = getTemplateTagValue(entity); try { return template.apply(Context.newContext(tagValues)); } catch (IOException e) { throw new TemplateExpressionException(attribute, e); } } }
TemplateExpressionEvaluator implements ExpressionEvaluator { @Override public Object evaluate(Entity entity) { initTemplate(); Map<String, Object> tagValues = getTemplateTagValue(entity); try { return template.apply(Context.newContext(tagValues)); } catch (IOException e) { throw new TemplateExpressionException(attribute, e); } } TemplateExpressionEvaluator(Attribute attribute, EntityType entityType); }
TemplateExpressionEvaluator implements ExpressionEvaluator { @Override public Object evaluate(Entity entity) { initTemplate(); Map<String, Object> tagValues = getTemplateTagValue(entity); try { return template.apply(Context.newContext(tagValues)); } catch (IOException e) { throw new TemplateExpressionException(attribute, e); } } TemplateExpressionEvaluator(Attribute attribute, EntityType entityType); @Override Object evaluate(Entity entity); static Template getTemplate(Attribute attribute); }
TemplateExpressionEvaluator implements ExpressionEvaluator { @Override public Object evaluate(Entity entity) { initTemplate(); Map<String, Object> tagValues = getTemplateTagValue(entity); try { return template.apply(Context.newContext(tagValues)); } catch (IOException e) { throw new TemplateExpressionException(attribute, e); } } TemplateExpressionEvaluator(Attribute attribute, EntityType entityType); @Override Object evaluate(Entity entity); static Template getTemplate(Attribute attribute);  }