AssertSoapFault extends AbstractActionContainer { public AssertSoapFault(Builder builder) { super("soap-fault", builder); this.action = builder.action.build(); this.faultString = builder.faultString; this.faultCode = builder.faultCode; this.faultActor = builder.faultActor; this.faultDetails = builder.faultDetails; this.faultDetailResourcePaths = builder.faultDetailResourcePaths; this.validator = builder.validator; this.validationContext = builder.validationContext.build(); } AssertSoapFault(Builder builder); @Override void doExecute(TestContext context); TestAction getAction(); @Override TestAction getTestAction(int index); @Override List<TestAction> getActions(); String getFaultString(); String getFaultCode(); List<String> getFaultDetails(); List<String> getFaultDetailResourcePaths(); SoapFaultValidator getValidator(); String getFaultActor(); SoapFaultValidationContext getValidationContext();  }
@Test public void testAssertSoapFault() throws Exception { TestAction action = new AbstractTestAction() { @Override public void doExecute(TestContext context) { SoapMessage faultMessage; faultMessage = messageFactory.createWebServiceMessage(); Soap11Fault fault = ((Soap11Body)faultMessage.getSoapBody()).addFault(QNameUtils.parseQNameString("{http: "Internal server error", Locale.GERMANY); fault.setFaultActorOrRole("SERVER"); throw new SoapFaultClientException(faultMessage); } }; AssertSoapFault assertAction = new AssertSoapFault.Builder() .validator(soapFaultValidator) .when(action) .faultActor("SERVER") .faultCode("{http: .faultString("Internal server error") .build(); assertAction.execute(context); }