How to use getFaultDetails method of com.consol.citrus.ws.actions.SendSoapFaultAction class

Best Citrus code snippet using com.consol.citrus.ws.actions.SendSoapFaultAction.getFaultDetails

Source:SendSoapFaultTestRunnerTest.java Github

copy

Full Screen

...137 doAnswer(invocation -> {138 SoapFault message = (SoapFault) invocation.getArguments()[0];139 Assert.assertEquals(message.getFaultCode(), FAULT_CODE);140 Assert.assertEquals(message.getFaultString(), FAULT_STRING);141 Assert.assertEquals(message.getFaultDetails().size(), 1L);142 Assert.assertEquals(message.getFaultDetails().get(0), ERROR_DETAIL);143 return null;144 }).when(messageProducer).send(any(Message.class), any(TestContext.class));145 when(resource.getInputStream()).thenReturn(new ByteArrayInputStream(ERROR_DETAIL.getBytes()));146 MockTestRunner builder = new MockTestRunner(getClass().getSimpleName(), applicationContext, context) {147 @Override148 public void execute() {149 soap(builder -> builder.server(soapServer)150 .sendFault()151 .faultCode(FAULT_CODE)152 .faultDetailResource(resource)153 .faultString(FAULT_STRING));154 }155 };156 TestCase test = builder.getTestCase();157 Assert.assertEquals(test.getActionCount(), 1);158 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);159 SendSoapFaultAction action = (SendSoapFaultAction)((DelegatingTestAction)test.getActions().get(0)).getDelegate();160 Assert.assertEquals(action.getName(), "send");161 Assert.assertEquals(action.getEndpoint(), soapServer);162 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);163 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();164 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");165 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);166 Assert.assertEquals(action.getFaultDetails().size(), 1L);167 Assert.assertEquals(action.getFaultDetails().get(0), ERROR_DETAIL);168 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);169 Assert.assertEquals(action.getFaultString(), FAULT_STRING);170 }171 @Test172 public void testSendSoapFaultWithDetail() {173 reset(soapServer, messageProducer);174 when(soapServer.createProducer()).thenReturn(messageProducer);175 when(soapServer.getActor()).thenReturn(null);176 doAnswer(invocation -> {177 SoapFault message = (SoapFault) invocation.getArguments()[0];178 Assert.assertEquals(message.getFaultCode(), FAULT_CODE);179 Assert.assertEquals(message.getFaultString(), FAULT_STRING);180 Assert.assertEquals(message.getFaultDetails().size(), 1L);181 Assert.assertEquals(message.getFaultDetails().get(0), "DETAIL");182 return null;183 }).when(messageProducer).send(any(Message.class), any(TestContext.class));184 MockTestRunner builder = new MockTestRunner(getClass().getSimpleName(), applicationContext, context) {185 @Override186 public void execute() {187 soap(builder -> builder.server(soapServer)188 .sendFault()189 .faultCode(FAULT_CODE)190 .faultDetail("DETAIL")191 .faultString(FAULT_STRING));192 }193 };194 TestCase test = builder.getTestCase();195 Assert.assertEquals(test.getActionCount(), 1);196 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);197 SendSoapFaultAction action = (SendSoapFaultAction)((DelegatingTestAction)test.getActions().get(0)).getDelegate();198 Assert.assertEquals(action.getName(), "send");199 Assert.assertEquals(action.getEndpoint(), soapServer);200 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);201 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();202 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");203 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);204 Assert.assertEquals(action.getFaultDetails().size(), 1L);205 Assert.assertEquals(action.getFaultDetails().get(0), "DETAIL");206 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);207 Assert.assertEquals(action.getFaultString(), FAULT_STRING);208 }209 @Test210 public void testSendSoapFaultWithDetailResourcePath() {211 reset(soapServer, messageProducer);212 when(soapServer.createProducer()).thenReturn(messageProducer);213 when(soapServer.getActor()).thenReturn(null);214 doAnswer(invocation -> {215 SoapFault message = (SoapFault) invocation.getArguments()[0];216 Assert.assertEquals(message.getFaultCode(), FAULT_CODE);217 Assert.assertEquals(message.getFaultString(), FAULT_STRING);218 Assert.assertEquals(message.getFaultDetails().size(), 1L);219 Assert.assertEquals(message.getFaultDetails().get(0), ERROR_DETAIL);220 return null;221 }).when(messageProducer).send(any(Message.class), any(TestContext.class));222 MockTestRunner builder = new MockTestRunner(getClass().getSimpleName(), applicationContext, context) {223 @Override224 public void execute() {225 soap(builder -> builder.server(soapServer)226 .sendFault()227 .faultCode(FAULT_CODE)228 .faultDetailResource("classpath:com/consol/citrus/dsl/runner/soap-fault-detail.xml")229 .faultString(FAULT_STRING));230 }231 };232 TestCase test = builder.getTestCase();233 Assert.assertEquals(test.getActionCount(), 1);234 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);235 SendSoapFaultAction action = (SendSoapFaultAction)((DelegatingTestAction)test.getActions().get(0)).getDelegate();236 Assert.assertEquals(action.getName(), "send");237 Assert.assertEquals(action.getEndpoint(), soapServer);238 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);239 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();240 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");241 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);242 Assert.assertEquals(action.getFaultDetails().size(), 0L);243 Assert.assertEquals(action.getFaultDetailResourcePaths().size(), 1L);244 Assert.assertEquals(action.getFaultDetailResourcePaths().get(0), "classpath:com/consol/citrus/dsl/runner/soap-fault-detail.xml");245 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);246 Assert.assertEquals(action.getFaultString(), FAULT_STRING);247 }248 @Test249 public void testSendSoapFaultWithMultipleDetail() {250 reset(soapServer, messageProducer);251 when(soapServer.createProducer()).thenReturn(messageProducer);252 when(soapServer.getActor()).thenReturn(null);253 doAnswer(invocation -> {254 SoapFault message = (SoapFault) invocation.getArguments()[0];255 Assert.assertEquals(message.getFaultCode(), FAULT_CODE);256 Assert.assertEquals(message.getFaultString(), FAULT_STRING);257 Assert.assertEquals(message.getFaultDetails().size(), 2L);258 Assert.assertEquals(message.getFaultDetails().get(0), "DETAIL1");259 Assert.assertEquals(message.getFaultDetails().get(1), "DETAIL2");260 return null;261 }).when(messageProducer).send(any(Message.class), any(TestContext.class));262 MockTestRunner builder = new MockTestRunner(getClass().getSimpleName(), applicationContext, context) {263 @Override264 public void execute() {265 soap(builder -> builder.server(soapServer)266 .sendFault()267 .faultCode(FAULT_CODE)268 .faultDetail("DETAIL1")269 .faultDetail("DETAIL2")270 .faultString(FAULT_STRING));271 }272 };273 TestCase test = builder.getTestCase();274 Assert.assertEquals(test.getActionCount(), 1);275 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);276 SendSoapFaultAction action = (SendSoapFaultAction)((DelegatingTestAction)test.getActions().get(0)).getDelegate();277 Assert.assertEquals(action.getName(), "send");278 Assert.assertEquals(action.getEndpoint(), soapServer);279 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);280 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();281 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");282 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);283 Assert.assertEquals(action.getFaultDetails().size(), 2L);284 Assert.assertEquals(action.getFaultDetails().get(0), "DETAIL1");285 Assert.assertEquals(action.getFaultDetails().get(1), "DETAIL2");286 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);287 Assert.assertEquals(action.getFaultString(), FAULT_STRING);288 }289}...

Full Screen

Full Screen

Source:SendSoapFaultTestDesignerTest.java Github

copy

Full Screen

...128 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);129 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();130 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");131 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);132 Assert.assertEquals(action.getFaultDetails().size(), 1L);133 Assert.assertEquals(action.getFaultDetails().get(0), "someDetailData");134 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);135 Assert.assertEquals(action.getFaultString(), FAULT_STRING);136 }137 @Test138 public void testSendSoapFaultWithDetail() {139 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {140 @Override141 public void configure() {142 soap().server(soapServer)143 .sendFault()144 .faultCode(FAULT_CODE)145 .faultDetail("DETAIL")146 .faultString(FAULT_STRING);147 }148 };149 builder.configure();150 TestCase test = builder.getTestCase();151 Assert.assertEquals(test.getActionCount(), 1);152 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);153 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapFaultAction.class);154 SendSoapFaultAction action = (SendSoapFaultAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();155 Assert.assertEquals(action.getName(), "send");156 Assert.assertEquals(action.getEndpoint(), soapServer);157 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);158 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();159 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");160 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);161 Assert.assertEquals(action.getFaultDetails().size(), 1L);162 Assert.assertEquals(action.getFaultDetails().get(0), "DETAIL");163 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);164 Assert.assertEquals(action.getFaultString(), FAULT_STRING);165 }166 @Test167 public void testSendSoapFaultWithDetailResourcePath() {168 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {169 @Override170 public void configure() {171 soap().server(soapServer)172 .sendFault()173 .faultCode(FAULT_CODE)174 .faultDetailResource("com/consol/citrus/soap/fault.xml")175 .faultString(FAULT_STRING);176 }177 };178 builder.configure();179 TestCase test = builder.getTestCase();180 Assert.assertEquals(test.getActionCount(), 1);181 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);182 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapFaultAction.class);183 SendSoapFaultAction action = (SendSoapFaultAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();184 Assert.assertEquals(action.getName(), "send");185 Assert.assertEquals(action.getEndpoint(), soapServer);186 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);187 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();188 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");189 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);190 Assert.assertEquals(action.getFaultDetails().size(), 0L);191 Assert.assertEquals(action.getFaultDetailResourcePaths().size(), 1L);192 Assert.assertEquals(action.getFaultDetailResourcePaths().get(0), "com/consol/citrus/soap/fault.xml");193 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);194 Assert.assertEquals(action.getFaultString(), FAULT_STRING);195 }196 @Test197 public void testSendSoapFaultWithMultipleDetail() {198 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {199 @Override200 public void configure() {201 soap().server(soapServer)202 .sendFault()203 .faultCode(FAULT_CODE)204 .faultDetail("DETAIL1")205 .faultDetail("DETAIL2")206 .faultString(FAULT_STRING);207 }208 };209 builder.configure();210 TestCase test = builder.getTestCase();211 Assert.assertEquals(test.getActionCount(), 1);212 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);213 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapFaultAction.class);214 SendSoapFaultAction action = (SendSoapFaultAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();215 Assert.assertEquals(action.getName(), "send");216 Assert.assertEquals(action.getEndpoint(), soapServer);217 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);218 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();219 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");220 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);221 Assert.assertEquals(action.getFaultDetails().size(), 2L);222 Assert.assertEquals(action.getFaultDetails().get(0), "DETAIL1");223 Assert.assertEquals(action.getFaultDetails().get(1), "DETAIL2");224 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);225 Assert.assertEquals(action.getFaultString(), FAULT_STRING);226 }227}...

Full Screen

Full Screen

Source:SendSoapFaultActionParserTest.java Github

copy

Full Screen

...39 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 1L);40 Assert.assertEquals(messageBuilder.getMessageHeaders().get("operation"), "sendFault");41 Assert.assertEquals(action.getFaultCode(), "{http://www.citrusframework.org/faults}citrus-ns:FAULT-1000");42 Assert.assertEquals(action.getFaultString(), "FaultString");43 Assert.assertEquals(action.getFaultDetails().size(), 1);44 Assert.assertTrue(action.getFaultDetails().get(0).startsWith("<ns0:FaultDetail xmlns:ns0=\"http://www.consol.de/schemas/samples/sayHello.xsd\">"));45 Assert.assertNull(action.getFaultActor());46 47 // 2nd action48 action = getNextTestActionFromTest();49 Assert.assertEquals(action.getEndpoint(), beanDefinitionContext.getBean("soapServer"));50 Assert.assertNotNull(action.getMessageBuilder());51 Assert.assertEquals(action.getMessageBuilder().getClass(), PayloadTemplateMessageBuilder.class);52 53 messageBuilder = (PayloadTemplateMessageBuilder)action.getMessageBuilder();54 Assert.assertNull(messageBuilder.getPayloadData());55 Assert.assertNull(messageBuilder.getPayloadResourcePath());56 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 1);57 Assert.assertEquals(messageBuilder.getMessageHeaders().get("operation"), "sendFault");58 Assert.assertEquals(action.getFaultCode(), "{http://www.citrusframework.org/faults}citrus-ns:FAULT-1001");59 Assert.assertEquals(action.getFaultString(), "FaultString");60 Assert.assertEquals(action.getFaultDetails().size(), 0);61 Assert.assertEquals(action.getFaultDetailResourcePaths().size(), 1);62 Assert.assertEquals(action.getFaultDetailResourcePaths().get(0), "classpath:com/consol/citrus/ws/actions/test-fault-detail.xml");63 Assert.assertEquals(action.getFaultActor(), "FaultActor");64 }65}...

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.samples;2import org.springframework.context.annotation.Bean;3import org.springframework.context.annotation.Configuration;4import org.springframework.context.annotation.Import;5import com.consol.citrus.dsl.endpoint.CitrusEndpoints;6import com.consol.citrus.dsl.runner.TestRunner;7import com.consol.citrus.message.MessageType;8import com.consol.citrus.ws.client.WebServiceClient;9import com.consol.citrus.ws.server.WebServiceServer;10@Import(HelloWorldIT.class)11public class HelloWorldConfig {12 public WebServiceClient wsClient() {13 .soap()14 .client()15 .build();16 }17 public WebServiceServer wsServer() {18 .soap()19 .server()20 .port(8080)21 .autoStart(true)22 .build();23 }24 public TestRunner helloWorldIT() {25 .test()26 .description("Hello World SOAP Web Service IT")27 .actions(28 wsServer().receive()29 .messageType(MessageType.XML)30 .extractFromHeader("citrus_jms_messageId", "correlation_id"),31 wsClient().send()32 .messageType(MessageType.XML)33 .header("citrus_jms_correlationId", "${correlation_id}"),34 wsServer().sendFault()35 .faultString("Server error")

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.ws.actions;2import com.consol.citrus.TestActionBuilder;3import com.consol.citrus.context.TestContext;4import com.consol.citrus.exceptions.CitrusRuntimeException;5import com.consol.citrus.message.Message;6import com.consol.citrus.message.MessageType;7import com.consol.citrus.report.TestActionListeners;8import com.consol.citrus.ws.message.SoapFault;9import org.springframework.ws.soap.SoapFaultDetailElement;10import org.springframework.ws.soap.SoapFaultDetailElementSource;11import org.springframework.ws.soap.SoapFaultDetailSource;12import org.springframework.ws.soap.SoapMessage;13import org.springframework.ws.soap.SoapMessageFactory;14import org.springframework.ws.soap.SoapVersion;15import org.springframework.ws.soap.server.SoapFaultDefinition;16import org.springframework.ws.soap.server.SoapFaultDefinitionEditor;17import org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver;18import org.springframework.ws.soap.server.endpoint.SoapFaultResolver;19import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor;20import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor.SoapEnvelopeLoggingInterceptorBuilder;21import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor.SoapEnvelopeLoggingInterceptorBuilder.SoapEnvelopeLoggingInterceptorBuilderHelper;22import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor.SoapEnvelopeLoggingInterceptorBuilder.SoapEnvelopeLoggingInterceptorBuilderHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelper;23import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor.SoapEnvelopeLoggingInterceptorBuilder.SoapEnvelopeLoggingInterceptorBuilderHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelperHelper;24import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor.SoapEnvelopeLoggingInterceptorBuilder.SoapEnvelopeLoggingInterceptorBuilderHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelperHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelperHelperHelper;25import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor.SoapEnvelopeLoggingInterceptorBuilder.SoapEnvelopeLoggingInterceptorBuilderHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelperHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelperHelperHelper.SoapEnvelopeLoggingInterceptorBuilderHelperHelperHelperHelperHelper;26import org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelope

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.ws.actions;2import java.util.ArrayList;3import java.util.List;4import com.consol.citrus.exceptions.CitrusRuntimeException;5import com.consol.citrus.message.Message;6import com.consol.citrus.message.MessageType;7import com.consol.citrus.ws.message.SoapFault;8import com.consol.citrus.ws.message.SoapMessage;9public class SendSoapFaultAction extends AbstractSendSoapFaultAction<SendSoapFaultAction> {10 public SendSoapFaultAction() {11 super("send-fault");12 }13 protected void doExecute(SoapMessage soapMessage) {14 SoapFault soapFault = getFaultDetails(soapMessage);15 soapFault.setFaultCode(getFaultCode());16 soapFault.setFaultString(getFaultString());17 soapFault.setFaultActor(getFaultActor());18 soapFault.setFaultDetail(getFaultDetail());19 soapMessage.setFault(soapFault);20 super.doExecute(soapMessage);21 }22 protected SoapFault getFaultDetails(SoapMessage soapMessage) {23 if (soapMessage.getFault() != null) {24 return soapMessage.getFault();25 } else if (soapMessage.getPayload() instanceof SoapFault) {26 return (SoapFault) soapMessage.getPayload();27 } else {28 throw new CitrusRuntimeException("Unable to extract fault details from received soap message");29 }30 }31 protected String getFaultCode() {32 String faultCode = getFaultCodeExpression().getValue(getContext());33 if (faultCode.startsWith("[")) {34 faultCode = faultCode.substring(1, faultCode.length() - 1);35 }36 return faultCode;37 }38 protected String getFaultString() {39 return getFaultStringExpression().getValue(getContext());40 }41 protected String getFaultActor() {42 return getFaultActorExpression().getValue(getContext());43 }44 protected String getFaultDetail() {

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.samples;2import com.consol.citrus.dsl.testng.TestNGCitrusTestDesigner;3import org.springframework.http.HttpStatus;4import org.springframework.http.MediaType;5import org.springframework.web.bind.annotation.RequestMethod;6import org.testng.annotations.Test;7public class SendSoapFaultActionIT extends TestNGCitrusTestDesigner {8 public void SendSoapFaultActionIT() {9 variable("faultCode", "Client");10 variable("faultString", "Invalid Request");11 variable("faultDetail", "Invalid Request");12 variable("faultDetailElement", "<detail><faultDetail>Invalid Request</faultDetail></detail>");13 variable("faultDetailElementName", "faultDetail");14 http(httpActionBuilder -> httpActionBuilder.client("httpClient")15 .send()16 .post()17 .fork(true)18 .contentType(MediaType.APPLICATION_XML_VALUE));19 sendSoapFault(sendSoapFaultActionBuilder -> sendSoapFaultActionBuilder20 .faultCode("${faultCode}")21 .faultString("${faultString}")22 .faultActor("${faultActor}")23 .faultDetail("${faultDetail}")24 .faultDetailElement("${faultDetailElement}")25 .faultDetailElementName("${faultDetailElementName}")

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.ws.actions;2import com.consol.citrus.ws.message.SoapFault;3import org.springframework.ws.soap.SoapFaultDetail;4import org.testng.Assert;5import org.testng.annotations.Test;6public class SendSoapFaultActionTest {7 public void testGetFaultDetails() {8 SoapFault soapFault = new SoapFault("soap fault");9 soapFault.setFaultDetail("fault detail");10 SendSoapFaultAction sendSoapFaultAction = new SendSoapFaultAction();11 SoapFaultDetail soapFaultDetail = sendSoapFaultAction.getFaultDetails(soapFault);12 Assert.assertNotNull(soapFaultDetail);13 }14}15package com.consol.citrus.ws.actions;16import com.consol.citrus.ws.message.SoapFault;17import org.springframework.ws.soap.SoapFaultDetail;18import org.testng.Assert;19import org.testng.annotations.Test;20public class SendSoapFaultActionTest {21 public void testGetFaultDetails() {22 SoapFault soapFault = new SoapFault("soap fault");23 soapFault.setFaultDetail("fault detail");24 SendSoapFaultAction sendSoapFaultAction = new SendSoapFaultAction();25 SoapFaultDetail soapFaultDetail = sendSoapFaultAction.getFaultDetails(soapFault);26 Assert.assertNotNull(soapFaultDetail);27 }28}29package com.consol.citrus.ws.actions;30import com.consol.citrus.ws.message.SoapFault;31import org.springframework.ws.soap.SoapFaultDetail;32import org.testng.Assert;33import org.testng.annotations.Test;34public class SendSoapFaultActionTest {35 public void testGetFaultDetails() {36 SoapFault soapFault = new SoapFault("soap fault");37 soapFault.setFaultDetail("fault detail");38 SendSoapFaultAction sendSoapFaultAction = new SendSoapFaultAction();39 SoapFaultDetail soapFaultDetail = sendSoapFaultAction.getFaultDetails(soapFault);40 Assert.assertNotNull(soapFaultDetail);41 }42}

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1public class 3 {2public static void main(String[] args) {3SendSoapFaultAction sendSoapFaultAction = new SendSoapFaultAction();4sendSoapFaultAction.setFaultString("Test fault");5sendSoapFaultAction.setFaultDetail("<detail>Test fault detail</detail>");6System.out.println(sendSoapFaultAction.getFaultDetails());7}8}9Example 2: Using getFaultDetails() method10public class 4 {11public static void main(String[] args) {12SendSoapFaultAction sendSoapFaultAction = new SendSoapFaultAction();13sendSoapFaultAction.setFaultString("Test fault");14sendSoapFaultAction.setFaultDetail("<detail>Test fault detail</detail>");15System.out.println(sendSoapFaultAction.getFaultDetails());16}17}

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1import com.consol.citrus.annotations.CitrusTest;2import com.consol.citrus.dsl.testng.TestNGCitrusTestRunner;3import com.consol.citrus.ws.actions.SendSoapFaultAction;4import com.consol.citrus.ws.message.SoapFault;5import org.springframework.core.io.ClassPathResource;6import org.springframework.ws.soap.SoapFaultDetail;7import org.testng.annotations.Test;8import java.util.List;9public class GetFaultDetailsTest extends TestNGCitrusTestRunner {10 public void getFaultDetailsTest() {11 variable("faultCode", "SOAP-ENV:Client");12 variable("faultString", "Client Error");13 variable("faultDetail", "This is a fault detail");14 sendFault("sendFault")15 .faultCode("${faultCode}")16 .faultString("${faultString}")17 .faultActor("${faultActor}")18 .faultDetail("${faultDetail}");19 receiveFault("receiveFault")20 .faultCode("${faultCode}")21 .faultString("${faultString}")22 .faultActor("${faultActor}")23 .faultDetail("${faultDetail}");24 SendSoapFaultAction sendSoapFaultAction = (SendSoapFaultAction) getTestAction("sendFault");25 SoapFault soapFault = sendSoapFaultAction.getSoapFault();26 SoapFaultDetail faultDetail = soapFault.getFaultDetail();27 List<Object> faultDetailEntries = faultDetail.getDetailEntries();28 assert faultDetailEntries.size() == 1;29 assert faultDetailEntries.get(0).toString().equals(variable("faultDetail"));30 }31}32import com.consol.citrus.annotations.CitrusTest;33import com.consol.citrus.dsl.testng.TestNGCitrusTestRunner;34import com.consol.citrus.ws.actions.SendSoapFaultAction;35import com.consol.citrus.ws.message.SoapFault;36import org.springframework.core.io.ClassPathResource;37import org.springframework.ws.soap.SoapFaultDetail;38import org.testng.annotations.Test

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.samples;2import com.consol.citrus.context.TestContext;3import com.consol.citrus.dsl.testng.TestNGCitrusTestDesigner;4import com.consol.citrus.ws.actions.SendSoapFaultAction;5import org.springframework.beans.factory.annotation.Autowired;6import org.springframework.ws.soap.SoapFault;7import org.testng.annotations.Test;8public class GetFaultDetailsTest extends TestNGCitrusTestDesigner {9 private TestContext testContext;10 public void getFaultDetails() {11 variable("faultCode", "SOAP-ENV:Server");12 variable("faultString", "Server Error");13 soap().client("weatherClient")14 .sendFault()15 .soapFault(SoapFault.serverOrReceiverFault(variable("faultCode"), variable("faultString")));16 soap().client("weatherClient")17 .receiveFault()18 .faultCode("SOAP-ENV:Server")19 .faultString("Server Error");20 SendSoapFaultAction sendSoapFaultAction = new SendSoapFaultAction();21 sendSoapFaultAction.setSoapFault(SoapFault.serverOrReceiverFault(variable("faultCode"), variable("faultString")));22 sendSoapFaultAction.setFaultCode("SOAP-ENV:Server");23 sendSoapFaultAction.setFaultString("Server Error");24 sendSoapFaultAction.setFaultDetail("<faultDetail><detail>Server Error</detail></faultDetail>");25 sendSoapFaultAction.setFaultDetailExtractorData("Server Error");26 sendSoapFaultAction.setFaultDetailExtractorData(variable("faultDetail"));27 sendSoapFaultAction.setFaultDetailExtractorData(testContext.getVariable("faultDetail"));

Full Screen

Full Screen

getFaultDetails

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus;2import com.consol.citrus.annotations.CitrusTest;3import com.consol.citrus.dsl.testng.TestNGCitrusTestRunner;4import com.consol.citrus.ws.actions.SendSoapFaultAction;5import org.springframework.beans.factory.annotation.Autowired;6import org.springframework.core.io.ClassPathResource;7import org.springframework.ws.soap.SoapFault;8import org.springframework.ws.soap.SoapMessage;9import org.springframework.ws.soap.SoapVersion;10import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;11import org.springframework.ws.soap.soap11.Soap11Fault;12import org.springframework.ws.soap.soap12.Soap12Fault;13import org.springframework.ws.soap.soap12.Soap12FaultDetail;14import org.testng.annotations.Test;15public class 3 extends TestNGCitrusTestRunner {16 private SaajSoapMessageFactory messageFactory;17 public void 3() {18 variable("faultCode", "soap:Client");19 variable("faultString", "soap:Client");20 variable("faultActor", "soap:Client");21 variable("faultDetail", "soap:Client");22 variable("faultRole", "soap:Client");23 variable("faultNode", "soap:Client");24 variable("faultReasonText", "soap:Client");25 variable("faultReasonLang", "soap:Client");26 variable("faultDetailText", "soap:Client");27 variable("faultDetailLang", "soap:Client");28 send(new SendSoapFaultAction()29 .faultCode("${faultCode}")30 .faultString("${faultString}")31 .faultActor("${faultActor}")32 .faultDetail("${faultDetail}")33 .faultRole("${faultRole}")34 .faultNode("${faultNode}")35 .faultReasonText("${faultReasonText}")36 .faultReasonLang("${faultReasonLang}")37 .faultDetailText("${faultDetailText}")38 .faultDetailLang("${faultDetailLang}")39 .message(messageFactory.createWebServiceMessage())40 .soapVersion(SoapVersion.SOAP_12)41 .soapFaultBuilder(new SendSoapFaultAction.SoapFaultBuilder() {42 public SoapFault buildFault(SoapMessage soapMessage) {43 Soap12Fault fault = ((Soap

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Citrus automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful