How to use SoapClientRequestActionBuilder method of com.consol.citrus.dsl.builder.SoapClientRequestActionBuilder class

Best Citrus code snippet using com.consol.citrus.dsl.builder.SoapClientRequestActionBuilder.SoapClientRequestActionBuilder

Source:SoapClientRequestActionBuilder.java Github

copy

Full Screen

...29/**30 * @author Christoph Deppisch31 * @since 2.632 */33public class SoapClientRequestActionBuilder extends SendMessageBuilder<SendSoapMessageAction, SoapClientRequestActionBuilder> {34 /** Soap message to send or receive */35 private SoapMessage soapMessage = new SoapMessage();36 /**37 * Default constructor using soap client endpoint.38 * @param delegate39 * @param soapClient40 */41 public SoapClientRequestActionBuilder(DelegatingTestAction<TestAction> delegate, Endpoint soapClient) {42 super(delegate);43 delegate.setDelegate(new SendSoapMessageAction());44 getAction().setEndpoint(soapClient);45 getAction().setMessageBuilder(new StaticMessageContentBuilder(soapMessage));46 }47 /**48 * Default constructor using soap client uri.49 * @param delegate50 * @param soapClientUri51 */52 public SoapClientRequestActionBuilder(DelegatingTestAction<TestAction> delegate, String soapClientUri) {53 super(delegate);54 delegate.setDelegate(new SendSoapMessageAction());55 getAction().setEndpointUri(soapClientUri);56 getAction().setMessageBuilder(new StaticMessageContentBuilder(soapMessage));57 }58 @Override59 protected void setPayload(String payload) {60 soapMessage.setPayload(payload);61 }62 /**63 * Sets special SOAP action message header.64 * @param soapAction65 * @return66 */67 public SoapClientRequestActionBuilder soapAction(String soapAction) {68 soapMessage.header(SoapMessageHeaders.SOAP_ACTION, soapAction);69 return this;70 }71 /**72 * Sets the attachment with string content.73 * @param contentId74 * @param contentType75 * @param content76 * @return77 */78 public SoapClientRequestActionBuilder attachment(String contentId, String contentType, String content) {79 SoapAttachment attachment = new SoapAttachment();80 attachment.setContentId(contentId);81 attachment.setContentType(contentType);82 attachment.setContent(content);83 getAction().getAttachments().add(attachment);84 return this;85 }86 /**87 * Sets the attachment with content resource.88 * @param contentId89 * @param contentType90 * @param contentResource91 * @return92 */93 public SoapClientRequestActionBuilder attachment(String contentId, String contentType, Resource contentResource) {94 return attachment(contentId, contentType, contentResource, FileUtils.getDefaultCharset());95 }96 /**97 * Sets the attachment with content resource.98 * @param contentId99 * @param contentType100 * @param contentResource101 * @param charset102 * @return103 */104 public SoapClientRequestActionBuilder attachment(String contentId, String contentType, Resource contentResource, Charset charset) {105 SoapAttachment attachment = new SoapAttachment();106 attachment.setContentId(contentId);107 attachment.setContentType(contentType);108 try {109 attachment.setContent(FileUtils.readToString(contentResource, charset));110 } catch (IOException e) {111 throw new CitrusRuntimeException("Failed to read attachment resource", e);112 }113 getAction().getAttachments().add(attachment);114 return this;115 }116 /**117 * Sets the charset name for this send action builder's attachment.118 * @param charsetName119 * @return120 */121 public SoapClientRequestActionBuilder charset(String charsetName) {122 if (!getAction().getAttachments().isEmpty()) {123 getAction().getAttachments().get(getAction().getAttachments().size() - 1).setCharsetName(charsetName);124 }125 return this;126 }127 /**128 * Sets the attachment from Java object instance.129 * @param attachment130 * @return131 */132 public SoapClientRequestActionBuilder attachment(SoapAttachment attachment) {133 getAction().getAttachments().add(attachment);134 return this;135 }136 /**137 * Set the endpoint URI for the request. This works only if the HTTP endpoint used138 * doesn't provide an own endpoint URI resolver.139 *140 * @param uri absolute URI to use for the endpoint141 * @return self142 */143 public SoapClientRequestActionBuilder uri(String uri) {144 soapMessage.header(DynamicEndpointUriResolver.ENDPOINT_URI_HEADER_NAME, uri);145 return this;146 }147 /**148 * Sets the request content type header.149 * @param contentType150 * @return151 */152 public SoapClientRequestActionBuilder contentType(String contentType) {153 soapMessage.header(SoapMessageHeaders.HTTP_CONTENT_TYPE, contentType);154 return this;155 }156 /**157 * Sets the request accept header.158 * @param accept159 * @return160 */161 public SoapClientRequestActionBuilder accept(String accept) {162 soapMessage.header(SoapMessageHeaders.HTTP_ACCEPT, accept);163 return this;164 }165 166 public SoapClientRequestActionBuilder mtomEnabled(boolean mtomEnabled) {167 soapMessage.mtomEnabled(mtomEnabled);168 getAction().setMtomEnabled(mtomEnabled);169 return this;170 }171 @Override172 protected SendSoapMessageAction getAction() {173 return (SendSoapMessageAction) super.getAction();174 }175}...

Full Screen

Full Screen

Source:SoapClientActionBuilder.java Github

copy

Full Screen

...61 /**62 * Generic request builder with request method and path.63 * @return64 */65 public SoapClientRequestActionBuilder send() {66 SoapClientRequestActionBuilder soapClientRequestActionBuilder;67 if (soapClient != null) {68 soapClientRequestActionBuilder = new SoapClientRequestActionBuilder(action, soapClient);69 } else {70 soapClientRequestActionBuilder = new SoapClientRequestActionBuilder(action, soapClientUri);71 }72 soapClientRequestActionBuilder.withApplicationContext(applicationContext);73 return soapClientRequestActionBuilder;74 }75 /**76 * Sets the Spring bean application context.77 * @param applicationContext78 */79 public SoapClientActionBuilder withApplicationContext(ApplicationContext applicationContext) {80 this.applicationContext = applicationContext;81 return this;82 }83}...

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl;2import com.consol.citrus.dsl.builder.SoapClientRequestActionBuilder;3import com.consol.citrus.dsl.builder.SoapClientResponseActionBuilder;4import com.consol.citrus.dsl.builder.SendActionBuilder;5import com.consol.citrus.dsl.builder.ReceiveActionBuilder;6import com.consol.citrus.dsl.builder.BuilderSupport;7import com.consol.citrus.dsl.builder.AbstractTestBuilder;8import com.consol.citrus.dsl.builder.HttpClientRequestActionBuilder;9import com.consol.citrus.dsl.builder.HttpClientResponseActionBuilder;10import com.consol.citrus.dsl.builder.HttpServerRequestActionBuilder;11import com.consol.citrus.dsl.builder.HttpServerResponseActionBuilder;12import com.consol.citrus.dsl.builder.HttpActionBuilder;13import com.consol.citrus.dsl.builder.EchoActionBuilder;14import com.consol.citrus.dsl.builder.FailActionBuilder;15import com.consol.citrus.dsl.builder.PurgeEndpointActionBuilder;16import com.consol.citrus.dsl.builder.PurgeJmsQueuesActionBuilder;17import com.consol.citrus.dsl.builder.PurgeMessageChannelActionBuilder;18import com.consol.citrus.dsl.builder.PurgeMessageStoreActionBuilder;19import com.consol.citrus.dsl.builder.PurgeMongoDbCollectionsActionBuilder;20import com.consol.citrus.dsl.builder.PurgeNeo4jDatabaseActionBuilder;21import com.consol.citrus.dsl.builder.PurgeRedisDatabaseActionBuilder;22import com.consol.citrus.dsl.builder.PurgeSqlDatabaseActionBuilder;23import com.consol.citrus.dsl.builder.PurgeTableActionBuilder;24import com.consol.citrus.dsl.builder.PurgeWaitActionBuilder;25import com.consol.citrus.dsl.builder.PurgeWaitActionBuilder.WaitTimeUnit;26import com.consol.citrus.dsl.builder.StopTimeActionBuilder;27import com.consol.citrus.dsl.builder.StopWatchActionBuilder;28import com.consol.citrus.dsl.builder.StopTimeActionBuilder.TimeUnit;29import com.consol.citrus.dsl.builder.StopWatchActionBuilder.StopWatchActionBuilderMode;30import com.consol.citrus.dsl.builder.CreateVariablesActionBuilder;31import com.consol.citrus.dsl.builder.DeleteVariablesActionBuilder;32import com.consol.citrus.dsl.builder.GenerateVariablesActionBuilder;33import com.consol.citrus.dsl.builder.SetVariablesActionBuilder;34import com.consol.citrus

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl.builder;2import java.util.HashMap;3import java.util.Map;4import com.consol.citrus.actions.SoapAction;5import com.consol.citrus.context.TestContext;6import com.consol.citrus.dsl.builder.SoapClientRequestActionBuilder.SoapClientRequestActionBuilderSupport;7import com.consol.citrus.message.MessageType;8import com.consol.citrus.soap.client.SoapClient;9import com.consol.citrus.ws.message.SoapMessageHeaders;10import com.consol.citrus.ws.message.SoapMessageValidationContext;11import com.consol.citrus.xml.XsdSchemaRepository;12public class SoapClientRequestActionBuilder extends AbstractTestActionBuilder<SoapClientRequestAction, SoapClientRequestActionBuilderSupport> {13 public SoapClientRequestActionBuilder(SoapClientRequestAction action) {14 super(action);15 }16 protected SoapClientRequestActionBuilderSupport getBuilderSupport() {17 return new SoapClientRequestActionBuilderSupport();18 }19 public static final class SoapClientRequestAction extends AbstractTestAction implements SoapAction {20 private final SoapClient soapClient;21 private final String endpointUri;22 private final String soapAction;23 private final String messagePayload;24 private final Map<String, Object> messageHeaders = new HashMap<>();25 private final Map<String, Object> messageValidationContext = new HashMap<>();26 private final XsdSchemaRepository schemaRepository;27 private final TestContext context;28 private final String endpointName;29 private final String endpointPath;30 private final String endpointOperation;31 private final String soapVersion;32 private final MessageType messageType;33 private final String messageName;34 public SoapClientRequestAction(Builder builder) {35 super("soap-client", builder);36 this.soapClient = builder.soapClient;37 this.endpointUri = builder.endpointUri;38 this.soapAction = builder.soapAction;39 this.messagePayload = builder.messagePayload;40 this.messageHeaders.putAll(builder.messageHeaders);41 this.messageValidationContext.putAll(builder.messageValidationContext);42 this.schemaRepository = builder.schemaRepository;43 this.context = builder.context;44 this.endpointName = builder.endpointName;45 this.endpointPath = builder.endpointPath;

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl.builder;2public class SoapClientRequestActionBuilder extends AbstractSoapClientActionBuilder<SoapClientRequestActionBuilder> {3 public SoapClientRequestActionBuilder(SoapClientRequestAction action) {4 super(action);5 }6 public SoapClientRequestActionBuilder payload(String payloadData) {7 action.setPayloadData(payloadData);8 return this;9 }10 public SoapClientRequestActionBuilder payload(Resource payloadResource) {11 action.setPayloadResource(payloadResource);12 return this;13 }14 public SoapClientRequestActionBuilder payload(String payloadData, String charsetName) {15 action.setPayloadData(payloadData);16 action.setPayloadCharset(charsetName);17 return this;18 }19 public SoapClientRequestActionBuilder payload(Resource payloadResource, String charsetName) {20 action.setPayloadResource(payloadResource);21 action.setPayloadCharset(charsetName);22 return this;23 }24 public SoapClientRequestActionBuilder soapAction(String soapAction) {25 action.setSoapAction(soapAction);26 return this;27 }28 public SoapClientRequestActionBuilder header(String headerData) {29 action.setHeaderData(headerData);30 return this;31 }32 public SoapClientRequestActionBuilder header(Resource headerResource) {33 action.setHeaderResource(headerResource);34 return this;35 }36 public SoapClientRequestActionBuilder header(String headerData, String charsetName

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl.builder;2import com.consol.citrus.message.MessageType;3import com.consol.citrus.ws.actions.SoapClientRequestAction;4public class SoapClientRequestActionBuilder extends AbstractSoapClientActionBuilder<SoapClientRequestAction, SoapClientRequestActionBuilder> {5 public SoapClientRequestActionBuilder(SoapClientRequestAction action) {6 super(action);7 }8 public static SoapClientRequestActionBuilder soap() {9 return new SoapClientRequestActionBuilder(new SoapClientRequestAction());10 }11 public SoapClientRequestActionBuilder soapAction(String soapAction) {12 action.setSoapAction(soapAction);13 return this;14 }15 public SoapClientRequestActionBuilder soapAction(StringBuilder soapAction) {16 action.setSoapAction(soapAction.toString());17 return this;18 }19 public SoapClientRequestActionBuilder soapAction(StringBuffer soapAction) {20 action.setSoapAction(soapAction.toString());21 return this;22 }23 public SoapClientRequestActionBuilder soapAction(MessageType soapAction) {24 action.setSoapAction(soapAction.toString());25 return this;26 }27 public SoapClientRequestActionBuilder soapAction(Enum<?> soapAction) {28 action.setSoapAction(soapAction.toString());29 return this;30 }31 public SoapClientRequestActionBuilder soapAction(Object soapAction) {32 action.setSoapAction(soapAction.toString());33 return this;34 }

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl.builder;2import com.consol.citrus.actions.SoapAction;3import com.consol.citrus.dsl.builder.AbstractTestBuilder;4import com.consol.citrus.dsl.builder.BuilderSupport;5import com.consol.citrus.dsl.builder.HttpClientRequestActionBuilder;6import com.consol.citrus.dsl.builder.SoapClientRequestActionBuilder;7import com.consol.citrus.dsl.builder.SoapServerResponseActionBuilder;8import com.consol.citrus.dsl.builder.SoapServerResponseBuilder;9import com.consol.citrus.message.MessageType;10import com.consol.citrus.server.Server;11import com.consol.citrus.soap.client.SoapClient;12import com.consol.citrus.soap.message.SoapMessage;13import com.consol.citrus.ws.server.WebServiceServer;14import com.consol.citrus.ws.server.WebServiceServerBuilder;15import com.consol.citrus.ws.validation.SoapAttachmentValidator;16import com.consol.citrus.ws.validation.SoapFaultDetailValidator;17import com.consol.citrus.ws.validation.SoapFaultValidator;18import com.consol.citrus.ws.validation.SoapHeaderValidator;19import com.consol.citrus.ws.validation.SoapMessageValidator;20import com.consol.citrus.ws.validation.SoapPayloadElementValidator;21import com.consol.citrus.ws.validation.SoapSchemaValidationContext;22import com.consol.citrus.ws.validation.SoapSchemaValidator;23import com.consol.citrus.ws.validation.SoapValidationContext;24import com.consol.citrus.ws.validation.SoapValidator;25import com.consol.citrus.ws.validation.SoapXpathMessageValidator;26import org.springframework.util.StringUtils;27import org.springframework.ws.soap.SoapVersion;28import java.util.ArrayList;29import java.util.List;30import java.util.Map;31import java.util.function.Function;32import java.util.function.Supplier;33import static com.consol.citrus.actions.AbstractTestAction.Builder;34import static com.consol.citrus.actions.ReceiveMessageAction.Builder.receive;35import static com.consol.citrus.actions.SendMessageAction.Builder.send;36import static com.consol.citrus.dsl.builder.BuilderSupport.builderSupport;37import static com.consol.citrus.dsl.builder.BuilderSupport.data;38import static com.consol.citrus.dsl.builder.BuilderSupport.variable;39import static com.consol.citrus.dsl.builder.BuilderSupport.variables;40import static com.consol.citrus.dsl.builder.Builder

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl.builder;2import com.consol.citrus.dsl.runner.TestRunner;3import com.consol.citrus.message.MessageType;4public class SoapClientRequestActionBuilder implements TestActionBuilder<SoapClientRequestActionBuilder> {5 private TestRunner runner;6 private String endpoint;7 private String soapAction;8 private String messagePayload;9 private String messageName;10 private MessageType messageType;11 private String soapVersion;12 private String messageHeaderData;13 private String messageHeaderResource;14 private String messageHeaderResourcePath;15 private String messageHeaderResourceCharset;16 private String messageHeaderResourceData;17 public SoapClientRequestActionBuilder(TestRunner runner) {18 this.runner = runner;19 }20 public SoapClientRequestActionBuilder endpoint(String endpoint) {21 this.endpoint = endpoint;22 return this;23 }24 public SoapClientRequestActionBuilder soapAction(String soapAction) {25 this.soapAction = soapAction;26 return this;27 }28 public SoapClientRequestActionBuilder payload(String messagePayload) {29 this.messagePayload = messagePayload;30 return this;31 }32 public SoapClientRequestActionBuilder messageName(String messageName) {33 this.messageName = messageName;34 return this;35 }36 public SoapClientRequestActionBuilder messageType(MessageType messageType) {37 this.messageType = messageType;38 return this;39 }40 public SoapClientRequestActionBuilder soapVersion(String soapVersion) {41 this.soapVersion = soapVersion;42 return this;43 }44 public SoapClientRequestActionBuilder headerData(String message

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl.builder;2import com.consol.citrus.dsl.runner.TestRunner;3import com.consol.citrus.message.MessageType;4import org.springframework.ws.soap.SoapVersion;5public interface SoapClientRequestActionBuilder {6 SoapClientRequestActionBuilder soapAction(String soapAction);7 SoapClientRequestActionBuilder soapAction(String soapAction, boolean isExpression);8 SoapClientRequestActionBuilder soapVersion(SoapVersion soapVersion);9 SoapClientRequestActionBuilder soapVersion(SoapVersion soapVersion, boolean isExpression);10 SoapClientRequestActionBuilder messageType(MessageType messageType);11 SoapClientRequestActionBuilder messageType(MessageType messageType, boolean isExpression);12 SoapClientRequestActionBuilder messageName(String messageName);13 SoapClientRequestActionBuilder messageName(String messageName, boolean isExpression);14 SoapClientRequestActionBuilder endpoint(String endpointUri);15 SoapClientRequestActionBuilder endpoint(String endpointUri, boolean isExpression);16 SoapClientRequestActionBuilder endpoint(String endpointUri, boolean isExpression, boolean isStatic);

Full Screen

Full Screen

SoapClientRequestActionBuilder

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.dsl.builder;2public class SoapClientRequestActionBuilder extends AbstractSoapClientActionBuilder<SoapClientRequestActionBuilder> {3public SoapClientRequestActionBuilder soapAction(String soapAction) {4this.action.setSoapAction(soapAction);5return this;6}7public SoapClientRequestActionBuilder soapActionExpression(String soapActionExpression) {8this.action.setSoapActionExpression(soapActionExpression);9return this;10}11public SoapClientRequestActionBuilder soapActionExpression(Expression soapActionExpression) {12this.action.setSoapActionExpression(soapActionExpression);13return this;14}15public SoapClientRequestActionBuilder message(Message message) {16this.action.setMessage(message);17return this;18}19public SoapClientRequestActionBuilder message(String message) {20this.action.setMessage(message);21return this;22}23public SoapClientRequestActionBuilder message(MessageType messageType, String message) {24this.action.setMessage(messageType, message);25return this;26}27public SoapClientRequestActionBuilder message(MessageType messageType, String message, Map<String, Object> headers) {28this.action.setMessage(messageType, message, headers);29return this;30}31public SoapClientRequestActionBuilder message(MessageType messageType, String message, Map<String, Object> headers, Map<String, Object> messageHeaders) {32this.action.setMessage(messageType, message, headers, messageHeaders);33return this;34}35public SoapClientRequestActionBuilder message(MessageType messageType, String message, Map<String, Object> headers, Map<String, Object> messageHeaders, Map<String, Object> messagePayloadHeaders) {36this.action.setMessage(messageType, message, headers, messageHeaders, messagePayloadHeaders);37return this;38}39public SoapClientRequestActionBuilder header(String name, String value) {40this.action.addMessageHeader(name, value);41return this;42}43public SoapClientRequestActionBuilder header(String name, Object value) {44this.action.addMessageHeader(name, value);45return this;46}47public SoapClientRequestActionBuilder header(String name, Expression value) {48this.action.addMessageHeader(name, value);49return this;50}51public SoapClientRequestActionBuilder headers(Map<String, Object> headers) {52this.action.setMessageHeaders(headers);53return this;54}55public SoapClientRequestActionBuilder payload(String payload) {56this.action.setPayload(payload);57return this;58}59public SoapClientRequestActionBuilder payload(String payload, Map<String, Object> headers) {60this.action.setPayload(payload, headers);61return this;62}63public SoapClientRequestActionBuilder payload(String payload, Map<String, Object

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