use of com.twitter.heron.common.network.HeronClient in project incubator-heron by apache.
the class CheckpointManagerServerTest method testGetInstanceState.
@Test
public void testGetInstanceState() throws Exception {
final Checkpoint checkpoint = new Checkpoint(TOPOLOGY_NAME, instance, instanceStateCheckpoint);
when(statefulStorage.restore(TOPOLOGY_NAME, CHECKPOINT_ID, instance)).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).restore(TOPOLOGY_NAME, CHECKPOINT_ID, instance);
assertEquals(checkpoint.getCheckpoint(), ((CheckpointManager.GetInstanceStateResponse) response).getCheckpoint());
}
}));
}
Aggregations