private void validateAndComplete(Operation op) { if (!op.getUri().getPath().startsWith(getSelfLink())) { op.fail(new IllegalArgumentException("request must start with self link")); return; } op.complete(); }
private void validateAndComplete(Operation op) { if (!op.getUri().getPath().startsWith(getSelfLink())) { op.fail(new IllegalArgumentException("request must start with self link")); return; } op.complete(); }
if (!s1.getSelfLink().equals(d.documentSelfLink)) { this.host.failIteration(new IllegalStateException( "Wrong service replied: " + d.documentSelfLink));
if (!s1.getSelfLink().equals(d.documentSelfLink)) { this.host.failIteration(new IllegalStateException( "Wrong service replied: " + d.documentSelfLink));
private void verifyDeleteOnNamespaceOwner(PrefixDispatchService s) throws Throwable { // finally, verify we can actually target the service itself, using a DELETE Operation delete = Operation.createDelete(s.getUri()) .setCompletion(this.host.getCompletion()); this.host.testStart(1); this.host.send(delete); this.host.testWait(); assertTrue(this.host.getServiceStage(s.getSelfLink()) == null); }
@Override public void handlePut(Operation op) { ServiceDocument body = new ServiceDocument(); body.documentSelfLink = getSelfLink(); op.setBody(body); validateAndComplete(op); }
private void verifyDeleteOnNamespaceOwner(PrefixDispatchService s) throws Throwable { // finally, verify we can actually target the service itself, using a DELETE Operation delete = Operation.createDelete(s.getUri()) .setCompletion(this.host.getCompletion()); this.host.testStart(1); this.host.send(delete); this.host.testWait(); assertTrue(this.host.getServiceStage(s.getSelfLink()) == null); }
@Override public void handlePut(Operation op) { ServiceDocument body = new ServiceDocument(); body.documentSelfLink = getSelfLink(); op.setBody(body); validateAndComplete(op); }