@Test public void testValidateOnStatelessServicePUT() throws Throwable { Operation response = doOperation(Action.PUT, TestValidationStatelessService.SELF_LINK, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Override public void handleStart(Operation post) { handleOperationValidationException(post); }
@Test public void testValidateOnStatefulServiceStartUp() throws Throwable { Operation response = doOperation(Action.POST, TestValidationFactoryService.SELF_LINK, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Override public void handlePut(Operation put) { handleOperationValidationException(put); }
@Test public void testValidateOnStatefulServiceStartUp() throws Throwable { Operation response = doOperation(Action.POST, TestValidationFactoryService.SELF_LINK, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Override public void handleStart(Operation post) { handleOperationValidationException(post); }
@Test public void testValidateOnStatelessServicePUT() throws Throwable { Operation response = doOperation(Action.PUT, TestValidationStatelessService.SELF_LINK, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Override public void handlePut(Operation put) { handleOperationValidationException(put); }
@Test public void testValidateOnStatelessServicePatchWithOperationFailHandling() throws Throwable { Operation response = doOperation(Action.PATCH, TestValidationStatelessService.SELF_LINK, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Override public void handleRequest(Operation op) { if (Action.PUT == op.getAction()) { handleOperationValidationException(op); return; } else if (Action.PATCH == op.getAction()) { handleOperationFail(op); return; } super.handleRequest(op); } }
@Test public void testValidateOnStatelessServicePatchWithOperationFailHandling() throws Throwable { Operation response = doOperation(Action.PATCH, TestValidationStatelessService.SELF_LINK, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Override public void handleRequest(Operation op) { if (Action.PUT == op.getAction()) { handleOperationValidationException(op); return; } else if (Action.PATCH == op.getAction()) { handleOperationFail(op); return; } super.handleRequest(op); } }
@Test public void testValidateOnStatefulServicePatchWithOperationFailHandling() throws Throwable { this.state.name = "testName"; Operation response = doOperation(Action.POST, TestValidationFactoryService.SELF_LINK, this.state); assertEquals(Operation.STATUS_CODE_OK, response.getStatusCode()); this.state = response.getBody(TestValidationServiceState.class); this.state.name = null; response = doOperation(Action.PATCH, this.state.documentSelfLink, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Test public void testValidateOnStatefulServicePatchWithOperationFailHandling() throws Throwable { this.state.name = "testName"; Operation response = doOperation(Action.POST, TestValidationFactoryService.SELF_LINK, this.state); assertEquals(Operation.STATUS_CODE_OK, response.getStatusCode()); this.state = response.getBody(TestValidationServiceState.class); this.state.name = null; response = doOperation(Action.PATCH, this.state.documentSelfLink, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Test public void testValidateOnStatefulServicePUT() throws Throwable { this.state.name = "testName"; Operation response = doOperation(Action.POST, TestValidationFactoryService.SELF_LINK, this.state); assertEquals(Operation.STATUS_CODE_OK, response.getStatusCode()); this.state = response.getBody(TestValidationServiceState.class); this.state.name = null; response = doOperation(Action.PUT, this.state.documentSelfLink, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }
@Test public void testValidateOnStatefulServicePUT() throws Throwable { this.state.name = "testName"; Operation response = doOperation(Action.POST, TestValidationFactoryService.SELF_LINK, this.state); assertEquals(Operation.STATUS_CODE_OK, response.getStatusCode()); this.state = response.getBody(TestValidationServiceState.class); this.state.name = null; response = doOperation(Action.PUT, this.state.documentSelfLink, this.state); validateServiceValidationError(response, ERROR_MSG_NAME_REQUIRED); }