Search in sources :

Example 1 with Audit

use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.

the class AtlasMappingBaseTest method printAudit.

protected String printAudit(AtlasSession session) {
    StringBuilder buf = new StringBuilder("Audits: ");
    for (Audit a : session.getAudits().getAudit()) {
        buf.append('[');
        buf.append(a.getStatus());
        buf.append(", message=");
        buf.append(a.getMessage());
        buf.append(", path=");
        buf.append(a.getPath());
        buf.append("], ");
    }
    return buf.toString();
}
Also used : Audit(io.atlasmap.v2.Audit)

Example 2 with Audit

use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.

the class BaseDefaultAtlasContextTest method printAudit.

protected String printAudit(AtlasSession session) {
    StringBuilder buf = new StringBuilder("Audits: ");
    for (Audit a : session.getAudits().getAudit()) {
        buf.append('[');
        buf.append(a.getStatus());
        buf.append(", message=");
        buf.append(a.getMessage());
        buf.append("], ");
    }
    return buf.toString();
}
Also used : Audit(io.atlasmap.v2.Audit)

Example 3 with Audit

use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.

the class DefaultAtlasSessionTest method testGetSetAudits.

@Test
public void testGetSetAudits() {
    assertNotNull(session.getAudits());
    assertNotNull(session.getAudits().getAudit());
    assertTrue(session.getAudits().getAudit().size() == 0);
    Audits audits = new Audits();
    Audit audit = new Audit();
    audit.setStatus(AuditStatus.INFO);
    audit.setMessage("hello");
    audits.getAudit().add(audit);
    session.setAudits(audits);
    assertNotNull(session.getAudits());
    assertNotNull(session.getAudits().getAudit());
    assertTrue(session.getAudits().getAudit().size() == 1);
}
Also used : Audit(io.atlasmap.v2.Audit) Audits(io.atlasmap.v2.Audits) Test(org.junit.jupiter.api.Test)

Example 4 with Audit

use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.

the class DefaultAtlasSessionTest method testAuditErrors.

@Test
public void testAuditErrors() {
    assertTrue(session.errorCount() == 0);
    assertFalse(session.hasErrors());
    assertTrue(session.warnCount() == 0);
    assertFalse(session.hasWarns());
    Audit error = new Audit();
    error.setStatus(AuditStatus.ERROR);
    session.getAudits().getAudit().add(error);
    assertTrue(session.errorCount() == 1);
    assertTrue(session.hasErrors());
    assertTrue(session.warnCount() == 0);
    assertFalse(session.hasWarns());
}
Also used : Audit(io.atlasmap.v2.Audit) Test(org.junit.jupiter.api.Test)

Example 5 with Audit

use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.

the class DefaultAtlasSessionTest method testAuditWarns.

@Test
public void testAuditWarns() {
    assertTrue(session.errorCount() == 0);
    assertFalse(session.hasErrors());
    assertTrue(session.warnCount() == 0);
    assertFalse(session.hasWarns());
    Audit warn = new Audit();
    warn.setStatus(AuditStatus.WARN);
    session.getAudits().getAudit().add(warn);
    assertTrue(session.errorCount() == 0);
    assertFalse(session.hasErrors());
    assertTrue(session.warnCount() == 1);
    assertTrue(session.hasWarns());
}
Also used : Audit(io.atlasmap.v2.Audit) Test(org.junit.jupiter.api.Test)

Aggregations

Audit (io.atlasmap.v2.Audit)19 Test (org.junit.jupiter.api.Test)7 AtlasSession (io.atlasmap.api.AtlasSession)4 AtlasContext (io.atlasmap.api.AtlasContext)3 AtlasMappingBaseTest (io.atlasmap.itests.reference.AtlasMappingBaseTest)3 BaseContact (io.atlasmap.java.test.BaseContact)3 File (java.io.File)3 AtlasException (io.atlasmap.api.AtlasException)1 TargetContact (io.atlasmap.java.test.TargetContact)1 AtlasJsonTestUnrootedMapper (io.atlasmap.json.test.AtlasJsonTestUnrootedMapper)1 Action (io.atlasmap.v2.Action)1 AtlasMapping (io.atlasmap.v2.AtlasMapping)1 Audits (io.atlasmap.v2.Audits)1 BaseMapping (io.atlasmap.v2.BaseMapping)1 Field (io.atlasmap.v2.Field)1 Mapping (io.atlasmap.v2.Mapping)1 ProcessMappingRequest (io.atlasmap.v2.ProcessMappingRequest)1 ProcessMappingResponse (io.atlasmap.v2.ProcessMappingResponse)1 BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1