use of org.odk.collect.android.formentry.audit.AuditEventLogger in project collect by opendatakit.
the class BackgroundAudioViewModelTest method setBackgroundRecordingEnabled_whenFalse_logsEventToAuditLog.
@Test
public void setBackgroundRecordingEnabled_whenFalse_logsEventToAuditLog() {
FormController formController = mock(FormController.class);
AuditEventLogger auditEventLogger = mock(AuditEventLogger.class);
when(formController.getAuditEventLogger()).thenReturn(auditEventLogger);
viewModel.formLoaded(formController);
when(clock.get()).thenReturn(1234L);
viewModel.setBackgroundRecordingEnabled(false);
verify(auditEventLogger).logEvent(AuditEvent.AuditEventType.BACKGROUND_AUDIO_DISABLED, true, 1234L);
}
use of org.odk.collect.android.formentry.audit.AuditEventLogger in project collect by opendatakit.
the class BackgroundAudioViewModelTest method setBackgroundRecordingEnabled_whenTrue_logsEventToAuditLog.
@Test
public void setBackgroundRecordingEnabled_whenTrue_logsEventToAuditLog() {
FormController formController = mock(FormController.class);
AuditEventLogger auditEventLogger = mock(AuditEventLogger.class);
when(formController.getAuditEventLogger()).thenReturn(auditEventLogger);
viewModel.formLoaded(formController);
when(clock.get()).thenReturn(1234L);
viewModel.setBackgroundRecordingEnabled(true);
verify(auditEventLogger).logEvent(AuditEvent.AuditEventType.BACKGROUND_AUDIO_ENABLED, true, 1234L);
}
use of org.odk.collect.android.formentry.audit.AuditEventLogger in project collect by opendatakit.
the class FormEntryViewModelTest method setup.
@Before
public void setup() {
formController = mock(FormController.class);
startingIndex = new FormIndex(null, 0, 0, new TreeReference());
when(formController.getFormIndex()).thenReturn(startingIndex);
when(formController.getFormDef()).thenReturn(new FormDef());
AuditEventLogger auditEventLogger = mock(AuditEventLogger.class);
when(formController.getAuditEventLogger()).thenReturn(auditEventLogger);
viewModel = new FormEntryViewModel(mock(Supplier.class));
viewModel.formLoaded(formController);
}
Aggregations