@Test
public void failOnMigrateDocumentsWithAllVersionsWithoutDeleteAfter() throws Throwable {

    // this test dirties destination host, requires clean up
    clearSourceAndDestInProcessPeers = true;
    // disable idempotent post on destination
    for (VerificationHost host : destinationHost.getInProcessHostMap().values()) {
        host.toggleServiceOptions(UriUtils.buildUri(host, ExampleService.FACTORY_LINK),
                null, EnumSet.of(ServiceOption.IDEMPOTENT_POST));
    }
    // create same doc in source and dest hosts
    ExampleServiceState doc = new ExampleService.ExampleServiceState();
    doc.name = "foo" ;
    doc.documentSelfLink = "foo";
    this.sender.sendAndWait(Operation.createPost(this.exampleSourceFactory).setBody(doc));
    this.sender.sendAndWait(Operation.createPost(this.exampleDestinationFactory).setBody(doc));
    // start migration
    MigrationTaskService.State migrationState = validMigrationState(ExampleService.FACTORY_LINK);
    migrationState.migrationOptions = EnumSet.of(MigrationOption.ALL_VERSIONS);
    Operation post = Operation.createPost(this.destinationFactoryUri).setBody(migrationState);
    State taskState = this.sender.sendAndWait(post, State.class);
    State finalState = waitForServiceCompletion(taskState.documentSelfLink, getDestinationHost());
    assertEquals(TaskStage.FAILED, finalState.taskInfo.stage);
}