### Question:
SoapTransportCommandProcessor extends AbstractTerminateableHttpCommandProcessor<OMElement> { @ManagedAttribute public void setSchemaValidationEnabled(boolean schemaValidationEnabled) { this.schemaValidationEnabled = schemaValidationEnabled; } SoapTransportCommandProcessor(DehydratedExecutionContextResolution contextResolution, String requestTimeoutHeader, SchemaValidationFailureParser schemaValidationFailureParser); @ManagedAttribute boolean isSchemaValidationEnabled(); @ManagedAttribute void setSchemaValidationEnabled(boolean schemaValidationEnabled); @Override void onCougarStart();  }### Answer:
@Test public void validationDisabled() throws Exception { when(request.getInputStream()).thenReturn( new TestServletInputStream(buildSoapMessage(null, firstOpInDuplicate, null, null))); when(request.getScheme()).thenReturn("http"); soapCommandProcessor.setSchemaValidationEnabled(false); soapCommandProcessor.process(command); ev.getObserver().onResult(new ExecutionResult("goodbye")); assertEquals(CommandStatus.Complete, command.getStatus()); assertSoapyEquals(buildSoapMessage(null, firstOpOut, null, null), testOut.getOutput()); verify(response).setContentType(MediaType.TEXT_XML); verify(logger).logAccess(eq(command), isA(ExecutionContext.class), anyLong(), anyLong(), any(MediaType.class), any(MediaType.class), any(ResponseCode.class)); verifyTracerCalls(firstOpKey); }
@Test public void validationEnabledValidInput() throws Exception { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); schemaFactory.newSchema(new StreamSource(getClass().getClassLoader().getResourceAsStream("xsd/foo.xsd"))); soapCommandProcessor.setSchemaValidationEnabled(true); testProcess(); }
@Test public void validationEnabledInvalidInput() throws Exception { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); schemaFactory.newSchema(new StreamSource(getClass().getClassLoader().getResourceAsStream("xsd/foo.xsd"))); when(request.getInputStream()).thenReturn( new TestServletInputStream(buildSoapMessage(null, firstOpInDuplicate, null, null))); when(request.getScheme()).thenReturn("http"); soapCommandProcessor.setSchemaValidationEnabled(true); soapCommandProcessor.process(command); assertEquals(CommandStatus.Complete, command.getStatus()); assertSoapyEquals(buildSoapMessage(null, null, invalidInputFault, null), testOut.getOutput()); verify(response).setContentType(MediaType.TEXT_XML); verify(response).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); verify(logger).logAccess(eq(command), any(ExecutionContext.class), anyLong(), anyLong(), any(MediaType.class), any(MediaType.class), any(ResponseCode.class)); }