Search in sources :

Example 16 with UpdateColumnAuditLogEntry

use of org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry 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());
}
Also used : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) UpdateColumnAuditLogEntry(org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) FactPattern(org.drools.workbench.models.datamodel.rule.FactPattern) Test(org.junit.Test)

Aggregations

UpdateColumnAuditLogEntry (org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry)16 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)15 Test (org.junit.Test)15 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)14 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)6 PortableStringParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableStringParameterDefinition)2 PortableWorkDefinition (org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)2 ActionWorkItemCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)2 AttributeCol52 (org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52)2 BRLActionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn)2 BRLConditionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn)2 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)2 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)2 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)2 ActionRetractFact (org.drools.workbench.models.datamodel.rule.ActionRetractFact)1 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)1 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)1 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)1 ActionRetractFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52)1 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)1