@Test
public void forwardWithNullBodyResponse() throws Throwable {

    int nodeCount = 2;
    this.host.setPeerSynchronizationEnabled(true);
    this.host.setUpPeerHosts(nodeCount);
    this.host.joinNodesAndVerifyConvergence(nodeCount, true);
    this.host.setNodeGroupQuorum(nodeCount);
    VerificationHost targetHost = this.host.getPeerHost();
    TestRequestSender sender = this.host.getTestRequestSender();
    for (VerificationHost host : this.host.getInProcessHostMap().values()) {
        host.startFactory(new NoBodyExampleService());
    }
    URI serviceUri = UriUtils.buildUri(targetHost.getUri(), NoBodyExampleService.FACTORY_LINK);
    host.waitForReplicatedFactoryServiceAvailable(serviceUri);
    String documentSelfLink = UriUtils.buildUriPath(NoBodyExampleService.FACTORY_LINK, "foo");
    // create a doc
    ExampleServiceState initState = new ExampleServiceState();
    initState.name = "foo";
    initState.counter = 0L;
    initState.documentSelfLink = documentSelfLink;
    Operation post = Operation.createPost(targetHost, NoBodyExampleService.FACTORY_LINK).setBody(initState);
    sender.sendAndWait(post, ExampleServiceState.class);
    VerificationHost ownerNode = this.host.getOwnerPeer(documentSelfLink);
    VerificationHost nonOwnerNode = this.host.getNonOwnerPeer(documentSelfLink);
    ExampleServiceState updateState;
    Operation patch;
    Operation response;
    // update on owner node
    updateState = new ExampleServiceState();
    updateState.counter = 1L;
    patch = Operation.createPatch(ownerNode, documentSelfLink).setBody(updateState);
    response = ownerNode.getTestRequestSender().sendAndWait(patch);
    assertNull(response.getBodyRaw());
    // update on owner node with remote call
    updateState = new ExampleServiceState();
    updateState.counter = 2L;
    patch = Operation.createPatch(ownerNode, documentSelfLink).setBody(updateState).forceRemote();
    response = ownerNode.getTestRequestSender().sendAndWait(patch);
    assertNull(response.getBodyRaw());
    // update on non-owner node
    updateState = new ExampleServiceState();
    updateState.counter = 3L;
    patch = Operation.createPatch(nonOwnerNode, documentSelfLink).setBody(updateState);
    response = nonOwnerNode.getTestRequestSender().sendAndWait(patch);
    assertNull(response.getBodyRaw());
    // update on non-owner node with remote call
    updateState = new ExampleServiceState();
    updateState.counter = 4L;
    patch = Operation.createPatch(nonOwnerNode, documentSelfLink).setBody(updateState).forceRemote();
    response = nonOwnerNode.getTestRequestSender().sendAndWait(patch);
    assertNull(response.getBodyRaw());
}