@Test
public void validateOperationChecks() throws Throwable {

    URI noUri = null;
    URI noHostUri = new URI("/foo/bar/baz");
    Operation noUriOp = Operation.createGet(noUri).setReferer(noHostUri);
    Operation noHostOp = Operation.createGet(noHostUri).setReferer(noHostUri);
    this.host.testStart(2);
    noUriOp.setCompletion((op, ex) -> {
        if (ex == null) {
            this.host.failIteration(ex);
            return;
        }
        if (!ex.getMessage().contains("Uri is required")) {
            this.host.failIteration(new IllegalStateException("Unexpected exception"));
            return;
        }
        this.host.completeIteration();
    });
    noHostOp.setCompletion((op, ex) -> {
        if (ex == null) {
            this.host.failIteration(ex);
            return;
        }
        if (!ex.getMessage().contains("host")) {
            this.host.failIteration(new IllegalStateException("Unexpected exception"));
            return;
        }
        this.host.completeIteration();
    });
    this.host.toggleNegativeTestMode(true);
    ServiceClient cl = this.host.getClient();
    cl.send(noUriOp);
    cl.send(noHostOp);
    this.host.testWait();
    this.host.toggleNegativeTestMode(false);
}