@Test
public void factoryClonePostExpectFailure() throws Throwable {

    MinimalFactoryTestService f = new MinimalFactoryTestService();
    MinimalFactoryTestService factoryService = (MinimalFactoryTestService) this.host
            .startServiceAndWait(f, UUID.randomUUID().toString(), null);
    this.host.waitForServiceAvailable(factoryService.getUri());
    // create a child service
    MinimalTestServiceState initState = (MinimalTestServiceState) this.host
            .buildMinimalTestState();
    initState.documentSelfLink = UUID.randomUUID().toString();
    this.host.testStart(1);
    this.host.send(Operation.createPost(factoryService.getUri())
            .setBody(initState)
            .setCompletion(this.host.getCompletion()));
    this.host.testWait();
    ServiceDocumentQueryResult rsp = this.host.getFactoryState(factoryService.getUri());
    // create a clone POST, by setting the source link
    initState = new MinimalTestServiceState();
    initState.documentSelfLink = UUID.randomUUID().toString();
    initState.documentSourceLink = rsp.documentLinks.iterator().next();
    // we expect this to fail since the minimal factory service does not support clone
    this.host.testStart(1);
    this.host.send(Operation.createPost(factoryService.getUri())
            .setBody(initState)
            .setCompletion(this.host.getExpectedFailureCompletion()));
    this.host.testWait();
}