use of com.google.gwt.safehtml.shared.SafeHtml in project drools-wb by kiegroup.
the class AuditLogEntryCellHelperTest method getSafeHtml_ActionSetField.
@Test
public void getSafeHtml_ActionSetField() {
ActionSetFieldCol52 originalColumn = new ActionSetFieldCol52();
originalColumn.setBoundName("bind1");
originalColumn.setFactField("field1");
originalColumn.setUpdate(false);
originalColumn.setValueList("q,w,e");
originalColumn.setHeader("action1");
originalColumn.setHideColumn(false);
originalColumn.setDefaultValue(new DTCellValue52("def1"));
ActionSetFieldCol52 newColumn = new ActionSetFieldCol52();
newColumn.setBoundName("bind2");
newColumn.setFactField("field2");
newColumn.setUpdate(true);
newColumn.setValueList("a,s,d");
newColumn.setHeader("action2");
newColumn.setHideColumn(true);
newColumn.setDefaultValue(new DTCellValue52("def2"));
List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
assertEquals(getActionHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
use of com.google.gwt.safehtml.shared.SafeHtml in project drools-wb by kiegroup.
the class AuditLogEntryCellHelperTest method getSafeHtml_BrlCondition_DefinitionOnly.
@Test
public void getSafeHtml_BrlCondition_DefinitionOnly() {
BRLConditionColumn originalColumn = new BRLConditionColumn();
originalColumn.setDefinition(Arrays.asList(new FactPattern("FactType1")));
originalColumn.setHeader("condition");
originalColumn.setHideColumn(false);
BRLConditionColumn newColumn = new BRLConditionColumn();
originalColumn.setDefinition(Arrays.asList(new FactPattern("FactType2"), new FactPattern("FactType3")));
newColumn.setHeader("condition");
newColumn.setHideColumn(false);
List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
// Definition diffs are currently not supported, maybe #soon?
// assertEquals(getHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
assertEquals(getHeaderRepre(newColumn.getHeader()) + getDiffRepre(new ArrayList<>()), result.asString());
}
Aggregations