Mockito.when(mockConnection.getConfiguration()).thenReturn(conf);
Mockito.when(mockConnection.getMaster()).thenReturn(mockMaster);
// set the max wait time for the snapshot to complete
Mockito
.when(
mockMaster.snapshot(
Mockito.any(HSnapshotDescription.class))).thenReturn((long)maxWaitTime);
// first five times, we return false, last we get success
Mockito.when(
mockMaster.isSnapshotDone(
Mockito.any(HSnapshotDescription.class))).thenReturn(false, false,