use of com.optimizely.ab.config.ProjectConfig in project java-sdk by optimizely.
the class BatchEventProcessorTest method testFlushOnMismatchRevision.
@Test
public void testFlushOnMismatchRevision() throws Exception {
setEventProcessor(logEvent -> eventHandlerRule.dispatchEvent(logEvent));
ProjectConfig projectConfig1 = mock(ProjectConfig.class);
when(projectConfig1.getRevision()).thenReturn("1");
when(projectConfig1.getProjectId()).thenReturn("X");
UserEvent userEvent1 = buildConversionEvent(EVENT_NAME, projectConfig1);
eventProcessor.process(userEvent1);
eventHandlerRule.expectConversion(EVENT_NAME, USER_ID);
ProjectConfig projectConfig2 = mock(ProjectConfig.class);
when(projectConfig2.getRevision()).thenReturn("2");
when(projectConfig1.getProjectId()).thenReturn("X");
UserEvent userEvent2 = buildConversionEvent(EVENT_NAME, projectConfig2);
eventProcessor.process(userEvent2);
eventHandlerRule.expectConversion(EVENT_NAME, USER_ID);
eventProcessor.close();
eventHandlerRule.expectCalls(2);
}
Aggregations