Best Citrus code snippet using com.consol.citrus.ws.server.WebServiceServer.getMessage
Source:ReceiveSoapMessageTestDesignerTest.java
...81 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);82 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), ReceiveSoapMessageAction.class);83 ReceiveSoapMessageAction action = (ReceiveSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();84 Assert.assertEquals(action.getName(), "receive");85 Assert.assertEquals(action.getMessageType(), MessageType.XML.name());86 Assert.assertEquals(action.getEndpoint(), server);87 Assert.assertEquals(action.getValidationContexts().size(), 3);88 Assert.assertEquals(action.getValidationContexts().get(0).getClass(), HeaderValidationContext.class);89 Assert.assertEquals(action.getValidationContexts().get(1).getClass(), XmlMessageValidationContext.class);90 Assert.assertEquals(action.getValidationContexts().get(2).getClass(), JsonMessageValidationContext.class);91 Assert.assertTrue(action.getMessageBuilder() instanceof StaticMessageContentBuilder);92 Assert.assertEquals(((StaticMessageContentBuilder)action.getMessageBuilder()).getMessage().getPayload(), "Foo");93 Assert.assertNotNull(((StaticMessageContentBuilder)action.getMessageBuilder()).getMessage().getHeader("operation"));94 Assert.assertEquals(action.getAttachments().size(), 1L);95 Assert.assertNull(action.getAttachments().get(0).getContentResourcePath());96 Assert.assertEquals(action.getAttachments().get(0).getContent(), testAttachment.getContent());97 Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId());98 Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());99 Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());100 }101 @Test102 public void testSoapAttachment() {103 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {104 @Override105 public void configure() {106 soap().server(server)107 .receive()108 .message(new DefaultMessage("Foo").setHeader("operation", "foo"))109 .attachment(testAttachment);110 }111 };112 builder.configure();113 TestCase test = builder.getTestCase();114 Assert.assertEquals(test.getActionCount(), 1);115 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);116 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), ReceiveSoapMessageAction.class);117 ReceiveSoapMessageAction action = (ReceiveSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();118 Assert.assertEquals(action.getName(), "receive");119 Assert.assertEquals(action.getMessageType(), MessageType.XML.name());120 Assert.assertEquals(action.getEndpoint(), server);121 Assert.assertEquals(action.getValidationContexts().size(), 3);122 Assert.assertEquals(action.getValidationContexts().get(0).getClass(), HeaderValidationContext.class);123 Assert.assertEquals(action.getValidationContexts().get(1).getClass(), XmlMessageValidationContext.class);124 Assert.assertEquals(action.getValidationContexts().get(2).getClass(), JsonMessageValidationContext.class);125 Assert.assertTrue(action.getMessageBuilder() instanceof StaticMessageContentBuilder);126 Assert.assertEquals(((StaticMessageContentBuilder)action.getMessageBuilder()).getMessage().getPayload(), "Foo");127 Assert.assertNotNull(((StaticMessageContentBuilder)action.getMessageBuilder()).getMessage().getHeader("operation"));128 Assert.assertEquals(action.getAttachments().size(), 1L);129 Assert.assertNull(action.getAttachments().get(0).getContentResourcePath());130 Assert.assertEquals(action.getAttachments().get(0).getContent(), testAttachment.getContent());131 Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId());132 Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());133 Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());134 }135 136 @Test137 public void testSoapAttachmentData() {138 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {139 @Override140 public void configure() {141 soap().server(server)142 .receive()143 .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")144 .attachment(testAttachment.getContentId(), testAttachment.getContentType(), testAttachment.getContent());145 }146 };147 builder.configure();148 TestCase test = builder.getTestCase();149 Assert.assertEquals(test.getActionCount(), 1);150 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);151 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), ReceiveSoapMessageAction.class);152 153 ReceiveSoapMessageAction action = (ReceiveSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();154 Assert.assertEquals(action.getName(), "receive");155 156 Assert.assertEquals(action.getMessageType(), MessageType.XML.name());157 Assert.assertEquals(action.getEndpoint(), server);158 Assert.assertEquals(action.getValidationContexts().size(), 3);159 Assert.assertEquals(action.getValidationContexts().get(0).getClass(), HeaderValidationContext.class);160 Assert.assertEquals(action.getValidationContexts().get(1).getClass(), XmlMessageValidationContext.class);161 Assert.assertEquals(action.getValidationContexts().get(2).getClass(), JsonMessageValidationContext.class);162 163 Assert.assertTrue(action.getMessageBuilder() instanceof StaticMessageContentBuilder);164 Assert.assertEquals(((StaticMessageContentBuilder)action.getMessageBuilder()).getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");165 Assert.assertEquals(action.getAttachments().size(), 1L);166 Assert.assertNull(action.getAttachments().get(0).getContentResourcePath());167 Assert.assertEquals(action.getAttachments().get(0).getContent(), testAttachment.getContent());168 Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId());169 Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());170 Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());171 }172 @Test173 public void testSoapAttachmentResource() throws IOException {174 final Resource attachmentResource = Mockito.mock(Resource.class);175 176 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {177 @Override178 public void configure() {179 soap().server(server)180 .receive()181 .payload(resource)182 .attachment(testAttachment.getContentId(), testAttachment.getContentType(), attachmentResource);183 }184 };185 186 reset(resource, attachmentResource);187 when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("somePayloadData".getBytes()));188 when(attachmentResource.getInputStream()).thenReturn(new ByteArrayInputStream("someAttachmentData".getBytes()));189 builder.configure();190 TestCase test = builder.getTestCase();191 Assert.assertEquals(test.getActionCount(), 1);192 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);193 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), ReceiveSoapMessageAction.class);194 195 ReceiveSoapMessageAction action = (ReceiveSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();196 Assert.assertEquals(action.getName(), "receive");197 198 Assert.assertEquals(action.getMessageType(), MessageType.XML.name());199 Assert.assertEquals(action.getEndpoint(), server);200 Assert.assertEquals(action.getValidationContexts().size(), 3);201 Assert.assertEquals(action.getValidationContexts().get(0).getClass(), HeaderValidationContext.class);202 Assert.assertEquals(action.getValidationContexts().get(1).getClass(), XmlMessageValidationContext.class);203 Assert.assertEquals(action.getValidationContexts().get(2).getClass(), JsonMessageValidationContext.class);204 205 Assert.assertTrue(action.getMessageBuilder() instanceof StaticMessageContentBuilder);206 Assert.assertEquals(((StaticMessageContentBuilder)action.getMessageBuilder()).getMessage().getPayload(), "somePayloadData");207 208 Assert.assertEquals(action.getAttachments().get(0).getContent(), "someAttachmentData");209 Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId());210 Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());211 Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());212 }213 @Test214 public void testMultipleSoapAttachmentData() {215 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {216 @Override217 public void configure() {218 soap().server(server)219 .receive()220 .payload("<TestRequest><Message>Hello World!</Message></TestRequest>")221 .attachment(testAttachment.getContentId() + 1, testAttachment.getContentType(), testAttachment.getContent() + 1)222 .attachment(testAttachment.getContentId() + 2, testAttachment.getContentType(), testAttachment.getContent() + 2);223 }224 };225 builder.configure();226 TestCase test = builder.getTestCase();227 Assert.assertEquals(test.getActionCount(), 1);228 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);229 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), ReceiveSoapMessageAction.class);230 ReceiveSoapMessageAction action = (ReceiveSoapMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();231 Assert.assertEquals(action.getName(), "receive");232 Assert.assertEquals(action.getMessageType(), MessageType.XML.name());233 Assert.assertEquals(action.getEndpoint(), server);234 Assert.assertEquals(action.getValidationContexts().size(), 3);235 Assert.assertEquals(action.getValidationContexts().get(0).getClass(), HeaderValidationContext.class);236 Assert.assertEquals(action.getValidationContexts().get(1).getClass(), XmlMessageValidationContext.class);237 Assert.assertEquals(action.getValidationContexts().get(2).getClass(), JsonMessageValidationContext.class);238 Assert.assertTrue(action.getMessageBuilder() instanceof StaticMessageContentBuilder);239 Assert.assertEquals(((StaticMessageContentBuilder)action.getMessageBuilder()).getMessage().getPayload(), "<TestRequest><Message>Hello World!</Message></TestRequest>");240 Assert.assertEquals(action.getAttachments().size(), 2L);241 Assert.assertNull(action.getAttachments().get(0).getContentResourcePath());242 Assert.assertEquals(action.getAttachments().get(0).getContent(), testAttachment.getContent() + 1);243 Assert.assertEquals(action.getAttachments().get(0).getContentId(), testAttachment.getContentId() + 1);244 Assert.assertEquals(action.getAttachments().get(0).getContentType(), testAttachment.getContentType());245 Assert.assertEquals(action.getAttachments().get(0).getCharsetName(), testAttachment.getCharsetName());246 Assert.assertNull(action.getAttachments().get(1).getContentResourcePath());247 Assert.assertEquals(action.getAttachments().get(1).getContent(), testAttachment.getContent() + 2);248 Assert.assertEquals(action.getAttachments().get(1).getContentId(), testAttachment.getContentId() + 2);249 Assert.assertEquals(action.getAttachments().get(1).getContentType(), testAttachment.getContentType());250 Assert.assertEquals(action.getAttachments().get(1).getCharsetName(), testAttachment.getCharsetName());251 }252 @Test253 public void testReceiveBuilderWithEndpointName() {254 reset(applicationContextMock);255 when(applicationContextMock.getBean(TestActionListeners.class)).thenReturn(new TestActionListeners());256 when(applicationContextMock.getBeansOfType(SequenceBeforeTest.class)).thenReturn(new HashMap<String, SequenceBeforeTest>());257 when(applicationContextMock.getBeansOfType(SequenceAfterTest.class)).thenReturn(new HashMap<String, SequenceAfterTest>());258 MockTestDesigner builder = new MockTestDesigner(applicationContextMock, context) {259 @Override260 public void configure() {261 receive("replyMessageEndpoint")262 .payload("<TestRequest><Message>Hello World!</Message></TestRequest>");263 receive("fooMessageEndpoint")264 .payload("<TestRequest><Message>Hello World!</Message></TestRequest>");265 }266 };267 builder.configure();268 TestCase test = builder.getTestCase();269 Assert.assertEquals(test.getActionCount(), 2);270 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);271 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), ReceiveMessageAction.class);272 Assert.assertEquals(test.getActions().get(1).getClass(), DelegatingTestAction.class);273 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(1)).getDelegate().getClass(), ReceiveMessageAction.class);274 275 ReceiveMessageAction action = (ReceiveMessageAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();276 Assert.assertEquals(action.getName(), "receive");277 Assert.assertEquals(action.getEndpointUri(), "replyMessageEndpoint");278 Assert.assertEquals(action.getMessageType(), MessageType.XML.name());279 280 action = (ReceiveMessageAction) ((DelegatingTestAction)test.getActions().get(1)).getDelegate();281 Assert.assertEquals(action.getName(), "receive");282 Assert.assertEquals(action.getEndpointUri(), "fooMessageEndpoint");283 Assert.assertEquals(action.getMessageType(), MessageType.XML.name());284 }285}...
Source:SendSoapFaultTestRunnerTest.java
...79 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);80 SendSoapFaultAction action = (SendSoapFaultAction)((DelegatingTestAction)test.getActions().get(0)).getDelegate();81 Assert.assertEquals(action.getName(), "send");82 Assert.assertEquals(action.getEndpoint(), soapServer);83 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);84 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();85 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");86 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);87 Assert.assertEquals(action.getFaultActor(), "faultActor");88 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);89 Assert.assertEquals(action.getFaultString(), FAULT_STRING);90 }91 @Test92 public void testSendSoapFaultByEndpointName() {93 TestContext context = applicationContext.getBean(TestContext.class);94 context.setApplicationContext(applicationContextMock);95 reset(applicationContextMock, soapServer, messageProducer);96 when(soapServer.createProducer()).thenReturn(messageProducer);97 when(soapServer.getActor()).thenReturn(null);98 doAnswer(invocation -> {99 SoapFault message = (SoapFault) invocation.getArguments()[0];100 Assert.assertEquals(message.getFaultCode(), FAULT_CODE);101 Assert.assertEquals(message.getFaultString(), FAULT_STRING);102 return null;103 }).when(messageProducer).send(any(Message.class), any(TestContext.class));104 when(applicationContextMock.getBean(TestContext.class)).thenReturn(context);105 when(applicationContextMock.getBean("soapServer", Endpoint.class)).thenReturn(soapServer);106 when(applicationContextMock.getBean(TestActionListeners.class)).thenReturn(new TestActionListeners());107 when(applicationContextMock.getBeansOfType(SequenceBeforeTest.class)).thenReturn(new HashMap<String, SequenceBeforeTest>());108 when(applicationContextMock.getBeansOfType(SequenceAfterTest.class)).thenReturn(new HashMap<String, SequenceAfterTest>());109 MockTestRunner builder = new MockTestRunner(getClass().getSimpleName(), applicationContextMock, context) {110 @Override111 public void execute() {112 soap(builder -> builder.server("soapServer")113 .sendFault()114 .faultCode(FAULT_CODE)115 .faultString(FAULT_STRING));116 }117 };118 TestCase test = builder.getTestCase();119 Assert.assertEquals(test.getActionCount(), 1);120 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);121 SendSoapFaultAction action = (SendSoapFaultAction)((DelegatingTestAction)test.getActions().get(0)).getDelegate();122 Assert.assertEquals(action.getName(), "send");123 Assert.assertEquals(action.getEndpoint(), soapServer);124 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);125 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();126 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");127 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);128 Assert.assertNull(action.getFaultActor());129 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);130 Assert.assertEquals(action.getFaultString(), FAULT_STRING);131 }132 @Test133 public void testSendSoapFaultWithDetailResource() throws IOException {134 reset(resource, soapServer, messageProducer);135 when(soapServer.createProducer()).thenReturn(messageProducer);136 when(soapServer.getActor()).thenReturn(null);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}...
Source:SendSoapFaultTestDesignerTest.java
...62 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapFaultAction.class);63 SendSoapFaultAction action = (SendSoapFaultAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();64 Assert.assertEquals(action.getName(), "send");65 Assert.assertEquals(action.getEndpoint(), soapServer);66 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);67 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();68 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");69 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);70 Assert.assertEquals(action.getFaultActor(), "faultActor");71 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);72 Assert.assertEquals(action.getFaultString(), FAULT_STRING);73 }74 @Test75 public void testSendSoapFaultByEndpointName() {76 reset(applicationContextMock);77 when(applicationContextMock.getBean(TestActionListeners.class)).thenReturn(new TestActionListeners());78 when(applicationContextMock.getBean("soapServer", Endpoint.class)).thenReturn(soapServer);79 when(applicationContextMock.getBeansOfType(SequenceBeforeTest.class)).thenReturn(new HashMap<String, SequenceBeforeTest>());80 when(applicationContextMock.getBeansOfType(SequenceAfterTest.class)).thenReturn(new HashMap<String, SequenceAfterTest>());81 MockTestDesigner builder = new MockTestDesigner(applicationContextMock, context) {82 @Override83 public void configure() {84 soap().server("soapServer")85 .sendFault()86 .faultCode(FAULT_CODE)87 .faultString(FAULT_STRING);88 }89 };90 builder.configure();91 TestCase test = builder.getTestCase();92 Assert.assertEquals(test.getActionCount(), 1);93 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);94 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapFaultAction.class);95 SendSoapFaultAction action = (SendSoapFaultAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();96 Assert.assertEquals(action.getName(), "send");97 Assert.assertEquals(action.getEndpoint(), soapServer);98 Assert.assertEquals(action.getMessageBuilder().getClass(), StaticMessageContentBuilder.class);99 StaticMessageContentBuilder messageBuilder = (StaticMessageContentBuilder) action.getMessageBuilder();100 Assert.assertEquals(messageBuilder.getMessage().getPayload(), "");101 Assert.assertEquals(messageBuilder.getMessageHeaders().size(), 0L);102 Assert.assertNull(action.getFaultActor());103 Assert.assertEquals(action.getFaultCode(), FAULT_CODE);104 Assert.assertEquals(action.getFaultString(), FAULT_STRING);105 }106 @Test107 public void testSendSoapFaultWithDetailResource() throws IOException {108 MockTestDesigner builder = new MockTestDesigner(applicationContext, context) {109 @Override110 public void configure() {111 soap().server(soapServer)112 .sendFault()113 .faultCode(FAULT_CODE)114 .faultDetailResource(resource)115 .faultString(FAULT_STRING);116 }117 };118 reset(resource);119 when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("someDetailData".getBytes()));120 builder.configure();121 TestCase test = builder.getTestCase();122 Assert.assertEquals(test.getActionCount(), 1);123 Assert.assertEquals(test.getActions().get(0).getClass(), DelegatingTestAction.class);124 Assert.assertEquals(((DelegatingTestAction)test.getActions().get(0)).getDelegate().getClass(), SendSoapFaultAction.class);125 SendSoapFaultAction action = (SendSoapFaultAction) ((DelegatingTestAction)test.getActions().get(0)).getDelegate();126 Assert.assertEquals(action.getName(), "send");127 Assert.assertEquals(action.getEndpoint(), soapServer);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}...
getMessage
Using AI Code Generation
1package com.consol.citrus.samples;2import com.consol.citrus.annotations.CitrusTest;3import com.consol.citrus.dsl.junit.JUnit4CitrusTestRunner;4import com.consol.citrus.ws.client.WebServiceClient;5import com.consol.citrus.ws.message.SoapMessage;6import org.springframework.beans.factory.annotation.Autowired;7import org.springframework.core.io.ClassPathResource;8import org.testng.annotations.Test;9public class 3 extends JUnit4CitrusTestRunner {10 private WebServiceClient webServiceClient;11 public void 3() {12 variable("message", "Hello Citrus!");13 send(webServiceClient)14 .soap()15 .payload(new ClassPathResource("request-payload.xml"));16 receive(webServiceClient)17 send(webServiceClient)18 .payload(new ClassPathResource("request-payload.xml"));19 receive(webServiceClient)20 }21}22package com.consol.citrus.samples;23import com.consol.citrus.annotations.CitrusTest;24import com.consol.citrus.dsl.junit.JUnit4CitrusTestRunner;25import com.consol.citrus.ws.client.WebServiceClient;26import com.consol.citrus.ws.message.SoapMessage;27import org.springframework.beans.factory.annotation.Autowired;28import org.springframework.core.io.ClassPathResource;29import org.testng.annotations.Test;30public class 4 extends JUnit4CitrusTestRunner {31 private WebServiceClient webServiceClient;32 public void 4() {33 variable("message", "Hello Citrus!");34 send(webServiceClient)35 .soap()36 .payload(new ClassPathResource("request-payload.xml"));
getMessage
Using AI Code Generation
1import com.consol.citrus.ws.server.WebServiceServer;2import com.consol.citrus.ws.server.WebServiceServerBuilder;3import com.consol.citrus.ws.server.WebServiceServerBuilder.WebServiceServerBuilderImpl;4import com.consol.citrus.ws.server.WebServiceServerConfiguration;5import com.consol.citrus.ws.server.WebServiceServerConfiguration.WebServiceServerConfigurationBuilder;6import org.springframework.ws.WebServiceMessage;7import org.springframework.ws.soap.SoapMessage;8import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;9import org.springframework.ws.soap.saaj.SaajSoapMessageUtils;10import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilder;11import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl;12import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilder;13import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImpl;14import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImplBuilder;15import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImplBuilderImpl;16import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImplBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImplBuilderImplImpl;17import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImplBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImplBuilderImplImpl.SaajSoapMessageUtilsBuilderImplBuilderImplBuilderImplImplBuilder;18import org.springframework.ws.soap.saaj.SaajSoapMessageUtils.SaajSoapMessageUtilsBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImpl.SaajSoapMessageUtilsBuilderImplBuilderImpl
getMessage
Using AI Code Generation
1package com.consol.citrus.ws.server;2import java.util.ArrayList;3import java.util.List;4import org.apache.commons.logging.Log;5import org.apache.commons.logging.LogFactory;6import org.springframework.beans.factory.annotation.Autowired;7import org.springframework.beans.factory.annotation.Qualifier;8import org.springframework.context.annotation.Bean;9import org.springframework.context.annotation.Configuration;10import org.springframework.context.annotation.Import;11import org.springframework.context.annotation.PropertySource;12import org.springframework.core.io.ClassPathResource;13import org.springframework.integration.annotation.IntegrationComponentScan;14import org.springframework.integration.annotation.MessageEndpoint;15import org.springframework.integration.annotation.ServiceActivator;16import org.springframework.integration.channel.DirectChannel;17import org.springframework.integration.config.EnableIntegration;18import org.springframework.integration.config.EnableIntegrationManagement;19import org.springframework.integration.dsl.IntegrationFlow;20import org.springframework.integration.dsl.IntegrationFlows;21import org.springframework.integration.dsl.MessageChannels;22import org.springframework.integration.dsl.Pollers;23import org.springframework.integration.dsl.StandardIntegrationFlow;24import org.springframework.integration.dsl.channel.MessageChannelsConfigurer;25import org.springframework.integration.dsl.core.PollersConfigurer;26import org.springframework.integration.dsl.http.Http;27import org.springframework.integration.dsl.support.Consumer;28import org.springframework.integration.http.config.EnableIntegrationGraphController;29import org.springframework.integration.http.dsl.HttpInboundChannelAdapterSpec;30import org.springframework.integration.http.dsl.HttpMessageHandlerSpec;31import org.springframework.integration.http.dsl.HttpRequestHandlerEndpointSpec;32import org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway;33import org.springframework.integration.http.inbound.RequestMapping;34import org.springframework.integration.http.inbound.RequestMappingHandlerMapping;35import org.springframework.integration.http.inbound.RequestMappingInfo;36import org.springframework.integration.http.inbound.ServletRegistrationBean;37import org.springframework.integration.http.inbound.ServletWebServerApplicationContext;38import org.springframework.integration.http.support.DefaultHttpHeaderMapper;39import org.springframework.integration.http.support.HttpHeaderMapper;40import org.springframework.integration.http.support.NullHttpHeaderMapper;41import org.springframework.integration.http.support.PollableChannelInterceptor;42import org.springframework.integration.mapping.HeaderMapper;43import org.springframework.integration.mapping.support.DefaultHeaderMapper;44import org.springframework.integration.support.MessageBuilder;45import org.springframework.integration.support.MutableMessageBuilder;46import org.springframework.integration.support.json.Jackson2JsonObjectMapper;47import org.springframework.integration.support.json.JsonObjectMapper;48import org.springframework.integration.transformer.GenericTransformer;49import org.springframework.integration.transformer.MessageTransformingHandler;50import org.springframework.integration.transformer.support.ExpressionEvaluatingHeaderValueMessageProcessor;51import org.springframework.integration.transformer.support.HeaderValueMessageProcessor;52import org.springframework.integration.transformer.support.StaticHeaderValueMessageProcessor;53import
getMessage
Using AI Code Generation
1public class 3 extends AbstractTestNGCitrusTest {2 private TestRunner runner;3 public void 3() {4 runner.ws(action -> action.server(new WebServiceServer())5 .receive()6 .payload("<testRequestMessage><text>Hello Citrus!</text></testRequestMessage>")7 );8 runner.ws(action -> action.server(new WebServiceServer())9 .send()10 .payload("<testResponseMessage><text>Hello Citrus!</text></testResponseMessage>")11 );12 }13}14public class 4 extends AbstractTestNGCitrusTest {15 private TestRunner runner;16 public void 4() {17 runner.ws(action -> action.server(new WebServiceServer())18 .receive()19 .payload("<testRequestMessage><text>Hello Citrus!</text></testRequestMessage>")20 );21 runner.ws(action -> action.server(new WebServiceServer())22 .send()23 .payload("<testResponseMessage><text>Hello Citrus!</text></testResponseMessage>")24 );25 }26}27public class 5 extends AbstractTestNGCitrusTest {28 private TestRunner runner;29 public void 5() {30 runner.ws(action -> action.server(new WebServiceServer())31 .receive()32 .payload("<testRequestMessage><text>Hello Citrus!</text></testRequestMessage>")33 );34 runner.ws(action -> action.server(new WebServiceServer())35 .send()36 .payload("<testResponseMessage><text>Hello Citrus!</text></testResponseMessage>")37 );38 }39}40public class 6 extends AbstractTestNGCitrusTest {41 private TestRunner runner;42 public void 6() {43 runner.ws(action -> action.server(new WebServiceServer())44 .receive()45 .payload("<testRequestMessage><text>Hello Citrus!</text></testRequestMessage>")
getMessage
Using AI Code Generation
1public class TestWebServiceServer {2 public String getMessage() {3 return "Hello World!";4 }5}6public class TestWebServiceServer {7 public String getMessage() {8 return "Hello World!";9 }10 public void setMessage(String message) {11 this.message = message;12 }13}14public class TestWebServiceServer {15 public String getMessage() {16 return "Hello World!";17 }18 public void setMessage(String message) {19 this.message = message;20 }21}22public class TestWebServiceServer {23 public String getMessage() {24 return "Hello World!";25 }26 public void setMessage(String message) {27 this.message = message;28 }29}30public class TestWebServiceServer {31 public String getMessage() {32 return "Hello World!";33 }34 public void setMessage(String message) {35 this.message = message;36 }37}38public class TestWebServiceServer {39 public String getMessage() {40 return "Hello World!";41 }42 public void setMessage(String message) {43 this.message = message;44 }45}46public class TestWebServiceServer {47 public String getMessage() {48 return "Hello World!";49 }50 public void setMessage(String message) {51 this.message = message;52 }53}
getMessage
Using AI Code Generation
1package com.consol.citrus.ws.server;2import org.testng.Assert;3import org.testng.annotations.Test;4import org.springframework.context.support.ClassPathXmlApplicationContext;5import org.springframework.context.ApplicationContext;6import org.springframework.beans.factory.annotation.Autowired;7import org.springframework.beans.factory.annotation.Qualifier;8import com.consol.citrus.annotations.CitrusXmlTest;9import com.consol.citrus.testng.CitrusParameters;10import com.consol.citrus.ws.client.WebServiceClient;11import com.consol.citrus.ws.server.WebServiceServer;12import com.consol.citrus.ws.message.SoapMessage;13import com.consol.citrus.context.TestContext;14import com.consol.citrus.dsl.testng.TestNGCitrusTestRunner;15import com.consol.citrus.message.Message;16import com.consol.citrus.message.MessageType;17import com.consol.citrus.ws.message.converter.SoapMessageConverter;18import com.consol.citrus.ws.message.converter.SoapAttachmentMessageConverter;19import com.consol.citrus.ws.message.converter.SoapHeaderMessageConverter;20import com.consol.citrus.ws.message.converter.SoapFaultMessageConverter;21import com.consol.citrus.ws.message.converter.SoapAttachmentMessageConverter;22import com.consol.citrus.ws.message.converter.SoapHeaderMessageConverter;23import com.consol.citrus.ws.message.converter.SoapFaultMessageConverter;24import com.consol.citrus.ws.message.converter.SoapAttachmentMessageConverter;25import com.consol.citrus.ws.message.converter.SoapHeaderMessageConverter;26import com.consol.citrus.ws.message.converter.SoapFaultMessageConverter;27import com.consol.citrus.ws.message.converter.SoapAttachmentMessageConverter;28import com.consol.citrus.ws.message.converter.SoapHeaderMessageConverter;29import com.consol.citrus.ws.message.converter.SoapFaultMessageConverter;30import com.consol.citrus.ws.message.converter.SoapAttachmentMessageConverter;31import com.consol.citrus.ws.message.converter.SoapHeaderMessageConverter;32import com.consol.citrus.ws.message.converter.SoapFaultMessageConverter;33import com.consol.citrus.ws.message.converter.SoapAttachmentMessageConverter;34import com.consol.citrus.ws.message.converter.SoapHeaderMessageConverter;35import com.consol.citrus.ws.message.converter.SoapFaultMessageConverter;36import com.consol.citrus.ws.message.converter.SoapAttachmentMessageConverter37 runner.ws(action -> action.server(new WebServiceServer())38 .send()39 .payload("<testResponseMessage><text>Hello Citrus!</text></testResponseMessage>")40 );41 }42}43public class 5 extends AbstractTestNGCitrusTest {44 private TestRunner runner;45 public void 5() {46 runner.ws(action -> action.server(new WebServiceServer())47 .receive()48 .payload("<testRequestMessage><text>Hello Citrus!</text></testRequestMessage>")49 );50 runner.ws(action -> action.server(new WebServiceServer())51 .send()52 .payload("<testResponseMessage><text>Hello Citrus!</text></testResponseMessage>")53 );54 }55}56public class 6 extends AbstractTestNGCitrusTest {57 private TestRunner runner;58 public void 6() {59 runner.ws(action -> action.server(new WebServiceServer())60 .receive()61 .payload("<testRequestMessage><text>Hello Citrus!</text></testRequestMessage>")
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!