@Test
public void failOnDestinationNodeFailureBeforeIssuingQuery() throws Throwable {

    createExampleDocuments(this.exampleSourceFactory, getSourceHost(), this.serviceCount);
    MigrationTaskService.State migrationState = validMigrationState(ExampleService.FACTORY_LINK);
    migrationState.sourceNodeGroupReference = UriUtils.extendUri(getSourceHost().getPublicUri(), ServiceUriPaths.DEFAULT_NODE_GROUP);
    migrationState.destinationNodeGroupReference = FAKE_URI;
    Operation op = Operation.createPost(this.destinationFactoryUri).setBody(migrationState);
    State state = this.sender.sendAndWait(op, State.class);
    State waitForServiceCompletion = waitForServiceCompletion(state.documentSelfLink, getDestinationHost());
    assertEquals(TaskStage.FAILED, waitForServiceCompletion.taskInfo.stage);
}