@Test public void saveAuditWithUser() throws Exception { AsyncTaskAuditEventWriter writer = new AsyncTaskAuditEventWriter(auditFile, false, false, true, false); writer.writeEvents(getSampleAuditEventsWithUser()); String expectedAuditContent = FileUtils.readFileToString(auditFile); String expectedData = "event,node,start,end,user\n" + "form start,,1548106927319,,User1\n" + "question,/data/q1,1548106927323,1548106930112,User1\n" + "add repeat,/data/g1[1],1548106930118,1548106931611,User1\n" + "question,/data/g1[1]/q2,1548106931612,1548106937122,User1\n" + "add repeat,/data/g1[2],1548106937123,1548106938276,User1\n" + "question,/data/g1[2]/q2,1548106938277,1548106948127,User1\n" + "add repeat,/data/g1[3],1548106948128,1548106949446,User1\n" + "end screen,,1548106949448,1548106953601,User1\n" + "form save,,1548106953600,,User1\n" + "form exit,,1548106953601,,User1\n" + "form finalize,,1548106953601,,User1\n"; assertEquals(expectedData, expectedAuditContent); }
@Override public void writeEvents(List<AuditEvent> auditEvents) { AuditEvent[] auditEventArray = auditEvents.toArray(new AuditEvent[0]); saveTask = new AuditEventSaveTask(file, isLocationEnabled, isTrackingChangesEnabled, isUserRequired, isTrackChangesReasonEnabled).execute(auditEventArray); }
AsyncTaskAuditEventWriter implements AuditEventLogger.AuditEventWriter { @Override public void writeEvents(List<AuditEvent> auditEvents) { AuditEvent[] auditEventArray = auditEvents.toArray(new AuditEvent[0]); saveTask = new AuditEventSaveTask(file, isLocationEnabled, isTrackingChangesEnabled, isUserRequired, isTrackChangesReasonEnabled).execute(auditEventArray); } }
AsyncTaskAuditEventWriter implements AuditEventLogger.AuditEventWriter { @Override public void writeEvents(List<AuditEvent> auditEvents) { AuditEvent[] auditEventArray = auditEvents.toArray(new AuditEvent[0]); saveTask = new AuditEventSaveTask(file, isLocationEnabled, isTrackingChangesEnabled, isUserRequired, isTrackChangesReasonEnabled).execute(auditEventArray); } AsyncTaskAuditEventWriter(@NonNull File file, boolean isLocationEnabled, boolean isTrackingChangesEnabled, boolean isUserRequired, boolean isTrackChangesReasonEnabled); }
AsyncTaskAuditEventWriter implements AuditEventLogger.AuditEventWriter { @Override public void writeEvents(List<AuditEvent> auditEvents) { AuditEvent[] auditEventArray = auditEvents.toArray(new AuditEvent[0]); saveTask = new AuditEventSaveTask(file, isLocationEnabled, isTrackingChangesEnabled, isUserRequired, isTrackChangesReasonEnabled).execute(auditEventArray); } AsyncTaskAuditEventWriter(@NonNull File file, boolean isLocationEnabled, boolean isTrackingChangesEnabled, boolean isUserRequired, boolean isTrackChangesReasonEnabled); @Override void writeEvents(List<AuditEvent> auditEvents); @Override boolean isWriting(); }
AsyncTaskAuditEventWriter implements AuditEventLogger.AuditEventWriter { @Override public void writeEvents(List<AuditEvent> auditEvents) { AuditEvent[] auditEventArray = auditEvents.toArray(new AuditEvent[0]); saveTask = new AuditEventSaveTask(file, isLocationEnabled, isTrackingChangesEnabled, isUserRequired, isTrackChangesReasonEnabled).execute(auditEventArray); } AsyncTaskAuditEventWriter(@NonNull File file, boolean isLocationEnabled, boolean isTrackingChangesEnabled, boolean isUserRequired, boolean isTrackChangesReasonEnabled); @Override void writeEvents(List<AuditEvent> auditEvents); @Override boolean isWriting();  }