@Test public void basic_subvalue_replace() throws Exception { String expected = "Free Connections: 42"; String template = "Free Connections: ${pools[0].numconnfree}"; List<ConnectionPool> pools = new ArrayList<>(); pools.add(new ConnectionPool("anything", 42, 24, 1, 1)); Snapshot snapshot = new Snapshot.Builder().pools(pools).build(); String result = instance.processBasicMessage(template, snapshot); assertEquals(expected, result); }
public String processBasicMessage(String template, Snapshot snapshot) { if (template == null || template.trim().isEmpty()) { return defaultMessage; } return replaceVariables(template, snapshot); }
EscalationMessageProcessor { public String processBasicMessage(String template, Snapshot snapshot) { if (template == null || template.trim().isEmpty()) { return defaultMessage; } return replaceVariables(template, snapshot); } }
EscalationMessageProcessor { public String processBasicMessage(String template, Snapshot snapshot) { if (template == null || template.trim().isEmpty()) { return defaultMessage; } return replaceVariables(template, snapshot); }  }
EscalationMessageProcessor { public String processBasicMessage(String template, Snapshot snapshot) { if (template == null || template.trim().isEmpty()) { return defaultMessage; } return replaceVariables(template, snapshot); }  @PostConstruct void init(); String processBasicMessage(String template, Snapshot snapshot); String processRichMessage(String template, Snapshot snapshot); }
EscalationMessageProcessor { public String processBasicMessage(String template, Snapshot snapshot) { if (template == null || template.trim().isEmpty()) { return defaultMessage; } return replaceVariables(template, snapshot); }  @PostConstruct void init(); String processBasicMessage(String template, Snapshot snapshot); String processRichMessage(String template, Snapshot snapshot);  }