use of org.apache.flink.runtime.state.FunctionInitializationContext in project flink by apache.
the class RMQSourceTest method beforeTest.
@Before
public void beforeTest() throws Exception {
OperatorStateStore mockStore = Mockito.mock(OperatorStateStore.class);
FunctionInitializationContext mockContext = Mockito.mock(FunctionInitializationContext.class);
Mockito.when(mockContext.getOperatorStateStore()).thenReturn(mockStore);
Mockito.when(mockStore.getSerializableListState(any(String.class))).thenReturn(null);
source = new RMQTestSource();
source.initializeState(mockContext);
source.open(config);
messageId = 0;
generateCorrelationIds = true;
sourceThread = new Thread(new Runnable() {
@Override
public void run() {
try {
source.run(new DummySourceContext());
} catch (Exception e) {
exception = e;
}
}
});
}
Aggregations