Search in sources :

Example 1 with EventWorker

use of org.ff4j.audit.EventWorker in project ff4j by ff4j.

the class EventWorkerTest method testEventWorkerCall.

@Test
public void testEventWorkerCall() throws Exception {
    // Given
    EventRepository er = mock(EventRepository.class);
    Event evt = new Event(SOURCE_JAVA, TARGET_FEATURE, "F1", ACTION_CHECK_OK);
    when(er.saveEvent(evt)).thenReturn(false);
    EventWorker ew = new EventWorker(evt, er);
    // When
    ew.call();
}
Also used : EventWorker(org.ff4j.audit.EventWorker) Event(org.ff4j.audit.Event) InMemoryEventRepository(org.ff4j.audit.repository.InMemoryEventRepository) EventRepository(org.ff4j.audit.repository.EventRepository) Test(org.junit.Test)

Example 2 with EventWorker

use of org.ff4j.audit.EventWorker in project ff4j by ff4j.

the class EventWorkerTest method testEventWorker.

@Test
public void testEventWorker() {
    // Given
    EventRepository er = new InMemoryEventRepository();
    Event evt = new Event(SOURCE_JAVA, TARGET_FEATURE, "F1", ACTION_CHECK_OFF);
    EventWorker ew = new EventWorker(evt, er);
    // When
    ew.setName("NAME1");
    // Then
    Assert.assertEquals("NAME1", ew.getName());
}
Also used : EventWorker(org.ff4j.audit.EventWorker) InMemoryEventRepository(org.ff4j.audit.repository.InMemoryEventRepository) Event(org.ff4j.audit.Event) InMemoryEventRepository(org.ff4j.audit.repository.InMemoryEventRepository) EventRepository(org.ff4j.audit.repository.EventRepository) Test(org.junit.Test)

Aggregations

Event (org.ff4j.audit.Event)2 EventWorker (org.ff4j.audit.EventWorker)2 EventRepository (org.ff4j.audit.repository.EventRepository)2 InMemoryEventRepository (org.ff4j.audit.repository.InMemoryEventRepository)2 Test (org.junit.Test)2