NotificationToEmailConverterCommon { public String getTableEntryTemplate(int numOfColumns) { StringBuilder tableEntryTemplate = new StringBuilder(256); tableEntryTemplate.append("<tr>"); for (int i = 0; i < numOfColumns; ++i) { tableEntryTemplate.append("<td class=\"cv\">{"); tableEntryTemplate.append(i); tableEntryTemplate.append("}</td>"); } tableEntryTemplate.append("</tr>"); return tableEntryTemplate.toString(); } NotificationToEmailConverterCommon(); String readContentFromFile(ClassLoader classLoader, String fileName); String generateBodyFromTemplate(Map<String, String> metaDetails,
                                            String bodyTemplate,
                                            String bodyTemplateDetails,
                                            String tableValuesKey,
                                            int tableEntryNumColumns); String getTableEntryTemplate(int numOfColumns); String addCssStyleToBody(String body); String getSubject(String propertyName); Set<String> getFullyQualifiedEmailAddresses(Set<String> recipients); String getWorkflowUrl(); String getAthenzUIUrl();  }
@Test public void testgettTbleEntryTemplate() { NotificationToEmailConverterCommon notificationToEmailConverterCommon = new NotificationToEmailConverterCommon(); int numOfColumns = 1; String tableEntryTemplate = notificationToEmailConverterCommon.getTableEntryTemplate(numOfColumns); assertEquals(tableEntryTemplate, "<tr><td class=\"cv\">{0}</td></tr>"); numOfColumns = 3; tableEntryTemplate = notificationToEmailConverterCommon.getTableEntryTemplate(numOfColumns); assertEquals(tableEntryTemplate, "<tr><td class=\"cv\">{0}</td><td class=\"cv\">{1}</td><td class=\"cv\">{2}</td></tr>"); numOfColumns = 6; tableEntryTemplate = notificationToEmailConverterCommon.getTableEntryTemplate(numOfColumns); assertEquals(tableEntryTemplate, "<tr><td class=\"cv\">{0}</td><td class=\"cv\">{1}</td><td class=\"cv\">{2}</td><td class=\"cv\">{3}</td><td class=\"cv\">{4}</td><td class=\"cv\">{5}</td></tr>"); }