use of org.ff4j.audit.repository.InMemoryEventRepository in project ff4j by ff4j.
the class FF4jTest method monitoringAudit.
@Test
public void monitoringAudit() {
// Given
FF4j ff4j = new FF4j();
ff4j.setEventPublisher(new EventPublisher());
ff4j.setEventRepository(new InMemoryEventRepository());
ff4j.removeCurrentContext();
ff4j.getCurrentContext();
// When
ff4j.stop();
// When
ff4j.setEventPublisher(null);
ff4j.getEventPublisher();
ff4j.stop();
// When
Event evt = new Event("f1", EventConstants.TARGET_FEATURE, "f2", EventConstants.ACTION_CHECK_OK);
Assert.assertNotNull(evt.toJson());
Assert.assertNotNull(evt.toString());
// When
EventPublisher ep = new EventPublisher();
new EventPublisher(ep.getRepository(), null);
ep.setRepository(new InMemoryEventRepository());
// Then
Assert.assertNotNull(ep.getRepository());
}
use of org.ff4j.audit.repository.InMemoryEventRepository 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());
}
Aggregations