use of org.apache.heron.common.network.StatusCode in project heron by twitter.
the class CheckpointManagerServerTest method testGetInstanceState.
@Test
public void testGetInstanceState() throws Exception {
final CheckpointInfo info = new CheckpointInfo(CHECKPOINT_ID, instance);
final Checkpoint checkpoint = new Checkpoint(checkpointPartition);
when(statefulStorage.restoreCheckpoint(any(CheckpointInfo.class))).thenReturn(checkpoint);
runTest(TestRequestHandler.RequestType.GET_INSTANCE_STATE, new HeronServerTester.SuccessResponseHandler(CheckpointManager.GetInstanceStateResponse.class, new HeronServerTester.TestResponseHandler() {
@Override
public void handleResponse(HeronClient client, StatusCode status, Object ctx, Message response) throws Exception {
verify(statefulStorage).restoreCheckpoint(info);
assertEquals(checkpoint.getCheckpoint(), ((CheckpointManager.GetInstanceStateResponse) response).getCheckpoint());
}
}));
}
Aggregations