How to use ChannelSyncConsumer method of com.consol.citrus.channel.ChannelSyncConsumer class

Best Citrus code snippet using com.consol.citrus.channel.ChannelSyncConsumer.ChannelSyncConsumer

Source:ChannelEndpointSyncConsumerTest.java Github

copy

Full Screen

...59 .setReplyChannel(replyChannel)60 .build();61 reset(messagingTemplate, channel, replyChannel);62 when(messagingTemplate.receive(channel)).thenReturn(message);63 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();64 Message receivedMessage = channelSyncConsumer.receive(context);65 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());66 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.ID), message.getHeaders().getId());67 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL), message.getHeaders().getReplyChannel());68 MessageChannel savedReplyChannel = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),69 endpoint.getEndpointConfiguration().getTimeout());70 Assert.assertNotNull(savedReplyChannel);71 Assert.assertEquals(savedReplyChannel, replyChannel);72 verify(messagingTemplate).setReceiveTimeout(5000L);73 }74 75 @Test76 @SuppressWarnings({ "unchecked", "rawtypes" })77 public void testReceiveMessageChannelNameResolver() {78 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();79 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);80 endpoint.getEndpointConfiguration().setChannelName("testChannel");81 endpoint.getEndpointConfiguration().setChannelResolver(channelResolver);82 83 Map<String, Object> headers = new HashMap<String, Object>();84 final org.springframework.messaging.Message message = MessageBuilder.withPayload("<TestResponse>Hello World!</TestResponse>")85 .copyHeaders(headers)86 .setReplyChannel(replyChannel)87 .build();88 reset(messagingTemplate, channel, replyChannel, channelResolver);89 90 when(channelResolver.resolveDestination("testChannel")).thenReturn(channel);91 when(messagingTemplate.receive(channel)).thenReturn(message);92 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();93 Message receivedMessage = channelSyncConsumer.receive(context);94 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());95 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.ID), message.getHeaders().getId());96 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL), message.getHeaders().getReplyChannel());97 MessageChannel savedReplyChannel = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),98 endpoint.getEndpointConfiguration().getTimeout());99 Assert.assertNotNull(savedReplyChannel);100 Assert.assertEquals(savedReplyChannel, replyChannel);101 verify(messagingTemplate).setReceiveTimeout(5000L);102 }103 104 @Test105 @SuppressWarnings({ "unchecked", "rawtypes" })106 public void testReceiveMessageWithReplyChannelName() {107 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();108 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);109 endpoint.getEndpointConfiguration().setChannel(channel);110 111 BeanFactory factory = Mockito.mock(BeanFactory.class);112 endpoint.getEndpointConfiguration().setBeanFactory(factory);113 114 Map<String, Object> headers = new HashMap<String, Object>();115 final org.springframework.messaging.Message message = MessageBuilder.withPayload("<TestResponse>Hello World!</TestResponse>")116 .copyHeaders(headers)117 .setReplyChannelName("replyChannel")118 .build();119 reset(messagingTemplate, channel, replyChannel, factory);120 121 when(messagingTemplate.receive(channel)).thenReturn(message);122 when(factory.getBean("replyChannel", MessageChannel.class)).thenReturn(replyChannel);123 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();124 Message receivedMessage = channelSyncConsumer.receive(context);125 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());126 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.ID), message.getHeaders().getId());127 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL), "replyChannel");128 MessageChannel savedReplyChannel = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),129 endpoint.getEndpointConfiguration().getTimeout());130 Assert.assertNotNull(savedReplyChannel);131 Assert.assertEquals(savedReplyChannel, replyChannel);132 verify(messagingTemplate).setReceiveTimeout(5000L);133 }134 135 @Test136 @SuppressWarnings({ "unchecked", "rawtypes" })137 public void testReceiveMessageWithCustomTimeout() {138 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();139 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);140 endpoint.getEndpointConfiguration().setChannel(channel);141 endpoint.getEndpointConfiguration().setTimeout(10000L);142 143 Map<String, Object> headers = new HashMap<String, Object>();144 final org.springframework.messaging.Message message = MessageBuilder.withPayload("<TestResponse>Hello World!</TestResponse>")145 .copyHeaders(headers)146 .setReplyChannel(replyChannel)147 .build();148 reset(messagingTemplate, channel, replyChannel);149 when(messagingTemplate.receive(channel)).thenReturn(message);150 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();151 Message receivedMessage = channelSyncConsumer.receive(context);152 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());153 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.ID), message.getHeaders().getId());154 MessageChannel savedReplyChannel = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),155 endpoint.getEndpointConfiguration().getTimeout());156 Assert.assertNotNull(savedReplyChannel);157 Assert.assertEquals(savedReplyChannel, replyChannel);158 verify(messagingTemplate).setReceiveTimeout(10000L);159 }160 161 @Test162 @SuppressWarnings({ "unchecked", "rawtypes" })163 public void testReceiveMessageWithReplyMessageCorrelator() {164 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();165 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);166 endpoint.getEndpointConfiguration().setChannel(channel);167 endpoint.getEndpointConfiguration().setCorrelator(messageCorrelator);168 endpoint.getEndpointConfiguration().setTimeout(500L);169 endpoint.getEndpointConfiguration().setPollingInterval(100);170 171 Map<String, Object> headers = new HashMap<String, Object>();172 final org.springframework.messaging.Message message = MessageBuilder.withPayload("<TestResponse>Hello World!</TestResponse>")173 .copyHeaders(headers)174 .setReplyChannel(replyChannel)175 .build();176 reset(messagingTemplate, channel, replyChannel, messageCorrelator);177 178 when(messagingTemplate.receive(channel)).thenReturn(message);179 when(messageCorrelator.getCorrelationKey(any(Message.class))).thenReturn(MessageHeaders.ID + " = '123456789'");180 when(messageCorrelator.getCorrelationKeyName(any(String.class))).thenReturn("correlationKeyName");181 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();182 Message receivedMessage = channelSyncConsumer.receive(context);183 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());184 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.ID), message.getHeaders().getId());185 Assert.assertNull(channelSyncConsumer.getCorrelationManager().find("", endpoint.getEndpointConfiguration().getTimeout()));186 Assert.assertNull(channelSyncConsumer.getCorrelationManager().find(MessageHeaders.ID + " = 'totally_wrong'",187 endpoint.getEndpointConfiguration().getTimeout()));188 MessageChannel savedReplyChannel = channelSyncConsumer.getCorrelationManager().find(MessageHeaders.ID + " = '123456789'",189 endpoint.getEndpointConfiguration().getTimeout());190 Assert.assertNotNull(savedReplyChannel);191 Assert.assertEquals(savedReplyChannel, replyChannel);192 verify(messagingTemplate).setReceiveTimeout(500L);193 }194 195 @Test196 public void testReceiveNoMessage() {197 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();198 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);199 endpoint.getEndpointConfiguration().setChannel(channel);200 201 reset(messagingTemplate, channel, replyChannel);202 203 when(messagingTemplate.receive(channel)).thenReturn(null);204 try {205 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();206 channelSyncConsumer.receive(context);207 } catch(ActionTimeoutException e) {208 Assert.assertTrue(e.getLocalizedMessage().startsWith("Action timeout while receiving message from channel"));209 return;210 }211 Assert.fail("Missing " + ActionTimeoutException.class + " because no message was received");212 verify(messagingTemplate).setReceiveTimeout(5000L);213 }214 215 @Test216 @SuppressWarnings({ "unchecked", "rawtypes" })217 public void testReceiveMessageNoReplyChannel() {218 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();219 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);220 endpoint.getEndpointConfiguration().setChannel(channel);221 endpoint.getEndpointConfiguration().setTimeout(500L);222 endpoint.getEndpointConfiguration().setPollingInterval(150L);223 224 Map<String, Object> headers = new HashMap<String, Object>();225 final org.springframework.messaging.Message message = MessageBuilder.withPayload("<TestResponse>Hello World!</TestResponse>")226 .copyHeaders(headers)227 .build();228 reset(messagingTemplate, channel, replyChannel);229 when(messagingTemplate.receive(channel)).thenReturn(message);230 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();231 Message receivedMessage = channelSyncConsumer.receive(context);232 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());233 Assert.assertEquals(receivedMessage.getHeader(org.springframework.messaging.MessageHeaders.ID), message.getHeaders().getId());234 MessageChannel savedReplyChannel = channelSyncConsumer.getCorrelationManager().find("", endpoint.getEndpointConfiguration().getTimeout());235 Assert.assertNull(savedReplyChannel);236 verify(messagingTemplate).setReceiveTimeout(500L);237 }238 @Test239 public void testSendReplyMessage() {240 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();241 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);242 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");243 reset(messagingTemplate, replyChannel);244 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();245 channelSyncConsumer.saveReplyMessageChannel(new DefaultMessage("").setHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL, replyChannel), context);246 channelSyncConsumer.send(message, context);247 verify(messagingTemplate).send(eq(replyChannel), any(org.springframework.messaging.Message.class));248 }249 @Test250 public void testSendReplyMessageWithReplyMessageCorrelator() {251 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();252 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);253 MessageCorrelator correlator = new DefaultMessageCorrelator();254 endpoint.getEndpointConfiguration().setCorrelator(correlator);255 Message request = new DefaultMessage("").setHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL, replyChannel);256 ((ChannelSyncConsumer)endpoint.createConsumer()).getCorrelationManager().saveCorrelationKey(257 endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKeyName(endpoint.createConsumer().getName()),258 request.getId(), context);259 Map<String, Object> headers = new HashMap<String, Object>();260 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>", headers);261 reset(messagingTemplate, replyChannel);262 doAnswer(new Answer() {263 @Override264 public Object answer(InvocationOnMock invocation) throws Throwable {265 Assert.assertEquals(((GenericMessage)invocation.getArguments()[1]).getPayload(), message.getPayload());266 return null;267 }268 }).when(messagingTemplate).send(eq(replyChannel), any(org.springframework.messaging.Message.class));269 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();270 channelSyncConsumer.saveReplyMessageChannel(request, context);271 channelSyncConsumer.send(message, context);272 }273 @Test274 public void testSendReplyMessageWithMissingCorrelatorKey() {275 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();276 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);277 MessageCorrelator correlator = new DefaultMessageCorrelator();278 endpoint.getEndpointConfiguration().setCorrelator(correlator);279 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");280 try {281 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();282 channelSyncConsumer.send(message, context);283 } catch(CitrusRuntimeException e) {284 Assert.assertTrue(e.getMessage().startsWith("Failed to get correlation key for"), e.getMessage());285 return;286 }287 Assert.fail("Missing " + IllegalArgumentException.class + " because of missing correlation key");288 }289 @Test290 public void testNoCorrelationKeyFound() {291 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();292 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);293 MessageCorrelator correlator = new DefaultMessageCorrelator();294 endpoint.getEndpointConfiguration().setCorrelator(correlator);295 ChannelSyncEndpoint dummyEndpoint = new ChannelSyncEndpoint();296 dummyEndpoint.setName("dummyEndpoint");297 ((ChannelSyncConsumer)dummyEndpoint.createConsumer()).getCorrelationManager().saveCorrelationKey(298 dummyEndpoint.getEndpointConfiguration().getCorrelator().getCorrelationKeyName(dummyEndpoint.createConsumer().getName()),299 "123456789", context);300 Map<String, Object> headers = new HashMap<String, Object>();301 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>", headers);302 try {303 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();304 channelSyncConsumer.send(message, context);305 } catch(CitrusRuntimeException e) {306 Assert.assertTrue(e.getMessage().startsWith("Failed to get correlation key"));307 return;308 }309 Assert.fail("Missing " + IllegalArgumentException.class + " because no reply destination found");310 }311 @Test312 public void testNoReplyDestinationFound() {313 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();314 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);315 endpoint.getEndpointConfiguration().setTimeout(1000L);316 MessageCorrelator correlator = new DefaultMessageCorrelator();317 endpoint.getEndpointConfiguration().setCorrelator(correlator);318 ((ChannelSyncConsumer)endpoint.createConsumer()).getCorrelationManager().saveCorrelationKey(319 endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKeyName(endpoint.createConsumer().getName()),320 "123456789", context);321 Map<String, Object> headers = new HashMap<String, Object>();322 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>", headers);323 try {324 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();325 channelSyncConsumer.send(message, context);326 } catch(IllegalArgumentException e) {327 Assert.assertTrue(e.getMessage().startsWith("Failed to find reply channel"));328 return;329 }330 Assert.fail("Missing " + IllegalArgumentException.class + " because no reply destination found");331 }332 @Test333 public void testSendEmptyMessage() {334 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();335 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);336 try {337 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();338 channelSyncConsumer.send(null, context);339 } catch(IllegalArgumentException e) {340 Assert.assertEquals(e.getMessage(), "Can not send empty message");341 return;342 }343 Assert.fail("Missing " + IllegalArgumentException.class + " because of sending empty message");344 }345 @Test346 public void testSendReplyMessageFail() {347 ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint();348 endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate);349 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");350 reset(messagingTemplate, replyChannel);351 doThrow(new MessageDeliveryException("Internal error!")).when(messagingTemplate).send(eq(replyChannel), any(org.springframework.messaging.Message.class));352 try {353 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) endpoint.createConsumer();354 channelSyncConsumer.saveReplyMessageChannel(new DefaultMessage("").setHeader(org.springframework.messaging.MessageHeaders.REPLY_CHANNEL, replyChannel), context);355 channelSyncConsumer.send(message, context);356 } catch(CitrusRuntimeException e) {357 Assert.assertTrue(e.getMessage().startsWith("Failed to send message to channel: "));358 Assert.assertNotNull(e.getCause());359 Assert.assertEquals(e.getCause().getClass(), MessageDeliveryException.class);360 Assert.assertEquals(e.getCause().getLocalizedMessage(), "Internal error!");361 return;362 }363 Assert.fail("Missing " + CitrusRuntimeException.class + " because of message channel template returned false");364 }365}...

Full Screen

Full Screen

Source:DirectEndpointSyncConsumerTest.java Github

copy

Full Screen

1/*2 * Copyright 2006-2010 the original author or authors.3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16package com.consol.citrus.endpoint.direct;17import java.util.HashMap;18import java.util.Map;19import com.consol.citrus.spi.ReferenceResolver;20import com.consol.citrus.context.TestContext;21import com.consol.citrus.exceptions.ActionTimeoutException;22import com.consol.citrus.exceptions.CitrusRuntimeException;23import com.consol.citrus.message.DefaultMessage;24import com.consol.citrus.message.DefaultMessageCorrelator;25import com.consol.citrus.message.Message;26import com.consol.citrus.message.MessageCorrelator;27import com.consol.citrus.message.MessageHeaders;28import com.consol.citrus.message.MessageQueue;29import org.mockito.Mockito;30import org.testng.Assert;31import org.testng.annotations.BeforeMethod;32import org.testng.annotations.Test;33import static org.mockito.Mockito.any;34import static org.mockito.Mockito.doAnswer;35import static org.mockito.Mockito.doThrow;36import static org.mockito.Mockito.reset;37import static org.mockito.Mockito.verify;38import static org.mockito.Mockito.when;39/**40 * @author Christoph Deppisch41 */42public class DirectEndpointSyncConsumerTest {43 private MessageQueue queue = Mockito.mock(MessageQueue.class);44 private MessageQueue replyQueue = Mockito.mock(MessageQueue.class);45 private MessageCorrelator messageCorrelator = Mockito.mock(MessageCorrelator.class);46 private ReferenceResolver resolver = Mockito.mock(ReferenceResolver.class);47 private TestContext context;48 @BeforeMethod49 public void setupMocks() {50 context = new TestContext();51 }52 @Test53 public void testReceiveMessageWithReplyQueue() {54 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();55 endpoint.getEndpointConfiguration().setQueue(queue);56 Map<String, Object> headers = new HashMap<>();57 final Message message = new DefaultMessage("<TestResponse>Hello World!</TestResponse>", headers)58 .setHeader(DirectMessageHeaders.REPLY_QUEUE, replyQueue);59 reset(queue, replyQueue);60 when(queue.receive(5000L)).thenReturn(message);61 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();62 Message receivedMessage = channelSyncConsumer.receive(context);63 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());64 Assert.assertEquals(receivedMessage.getHeader(MessageHeaders.ID), message.getId());65 Assert.assertEquals(receivedMessage.getHeader(DirectMessageHeaders.REPLY_QUEUE), message.getHeader(DirectMessageHeaders.REPLY_QUEUE));66 MessageQueue savedReplyQueue = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),67 endpoint.getEndpointConfiguration().getTimeout());68 Assert.assertNotNull(savedReplyQueue);69 Assert.assertEquals(savedReplyQueue, replyQueue);70 }71 @Test72 public void testReceiveMessageQueueNameResolver() {73 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();74 endpoint.getEndpointConfiguration().setQueueName("testQueue");75 context.setReferenceResolver(resolver);76 Map<String, Object> headers = new HashMap<>();77 final Message message = new DefaultMessage("<TestResponse>Hello World!</TestResponse>", headers)78 .setHeader(DirectMessageHeaders.REPLY_QUEUE, replyQueue);79 reset(queue, replyQueue, resolver);80 when(resolver.resolve("testQueue", MessageQueue.class)).thenReturn(queue);81 when(queue.receive(5000L)).thenReturn(message);82 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();83 Message receivedMessage = channelSyncConsumer.receive(context);84 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());85 Assert.assertEquals(receivedMessage.getHeader(MessageHeaders.ID), message.getId());86 Assert.assertEquals(receivedMessage.getHeader(DirectMessageHeaders.REPLY_QUEUE), message.getHeader(DirectMessageHeaders.REPLY_QUEUE));87 MessageQueue savedReplyQueue = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),88 endpoint.getEndpointConfiguration().getTimeout());89 Assert.assertNotNull(savedReplyQueue);90 Assert.assertEquals(savedReplyQueue, replyQueue);91 }92 @Test93 public void testReceiveMessageWithReplyQueueName() {94 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();95 endpoint.getEndpointConfiguration().setQueue(queue);96 Map<String, Object> headers = new HashMap<>();97 final Message message = new DefaultMessage("<TestResponse>Hello World!</TestResponse>", headers)98 .setHeader(DirectMessageHeaders.REPLY_QUEUE, "replyQueue");99 context.setReferenceResolver(resolver);100 reset(queue, replyQueue, resolver);101 when(queue.receive(5000L)).thenReturn(message);102 when(resolver.resolve("replyQueue", MessageQueue.class)).thenReturn(replyQueue);103 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();104 Message receivedMessage = channelSyncConsumer.receive(context);105 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());106 Assert.assertEquals(receivedMessage.getHeader(MessageHeaders.ID), message.getId());107 Assert.assertEquals(receivedMessage.getHeader(DirectMessageHeaders.REPLY_QUEUE), "replyQueue");108 MessageQueue savedReplyQueue = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),109 endpoint.getEndpointConfiguration().getTimeout());110 Assert.assertNotNull(savedReplyQueue);111 Assert.assertEquals(savedReplyQueue, replyQueue);112 }113 @Test114 public void testReceiveMessageWithCustomTimeout() {115 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();116 endpoint.getEndpointConfiguration().setQueue(queue);117 endpoint.getEndpointConfiguration().setTimeout(10000L);118 Map<String, Object> headers = new HashMap<>();119 final Message message = new DefaultMessage("<TestResponse>Hello World!</TestResponse>", headers)120 .setHeader(DirectMessageHeaders.REPLY_QUEUE, replyQueue);121 reset(queue, replyQueue);122 when(queue.receive(10000L)).thenReturn(message);123 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();124 Message receivedMessage = channelSyncConsumer.receive(context);125 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());126 Assert.assertEquals(receivedMessage.getHeader(MessageHeaders.ID), message.getId());127 MessageQueue savedReplyQueue = channelSyncConsumer.getCorrelationManager().find(endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKey(receivedMessage),128 endpoint.getEndpointConfiguration().getTimeout());129 Assert.assertNotNull(savedReplyQueue);130 Assert.assertEquals(savedReplyQueue, replyQueue);131 }132 @Test133 public void testReceiveMessageWithReplyMessageCorrelator() {134 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();135 endpoint.getEndpointConfiguration().setQueue(queue);136 endpoint.getEndpointConfiguration().setCorrelator(messageCorrelator);137 endpoint.getEndpointConfiguration().setTimeout(500L);138 endpoint.getEndpointConfiguration().setPollingInterval(100);139 Map<String, Object> headers = new HashMap<>();140 final Message message = new DefaultMessage("<TestResponse>Hello World!</TestResponse>", headers)141 .setHeader(DirectMessageHeaders.REPLY_QUEUE, replyQueue);142 reset(queue, replyQueue, messageCorrelator);143 when(queue.receive(500L)).thenReturn(message);144 when(messageCorrelator.getCorrelationKey(any(Message.class))).thenReturn(MessageHeaders.ID + " = '123456789'");145 when(messageCorrelator.getCorrelationKeyName(any(String.class))).thenReturn("correlationKeyName");146 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();147 Message receivedMessage = channelSyncConsumer.receive(context);148 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());149 Assert.assertEquals(receivedMessage.getHeader(MessageHeaders.ID), message.getId());150 Assert.assertNull(channelSyncConsumer.getCorrelationManager().find("", endpoint.getEndpointConfiguration().getTimeout()));151 Assert.assertNull(channelSyncConsumer.getCorrelationManager().find(MessageHeaders.ID + " = 'totally_wrong'",152 endpoint.getEndpointConfiguration().getTimeout()));153 MessageQueue savedReplyQueue = channelSyncConsumer.getCorrelationManager().find(MessageHeaders.ID + " = '123456789'",154 endpoint.getEndpointConfiguration().getTimeout());155 Assert.assertNotNull(savedReplyQueue);156 Assert.assertEquals(savedReplyQueue, replyQueue);157 }158 @Test159 public void testReceiveNoMessage() {160 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();161 endpoint.getEndpointConfiguration().setQueue(queue);162 reset(queue, replyQueue);163 when(queue.receive(5000L)).thenReturn(null);164 try {165 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();166 channelSyncConsumer.receive(context);167 } catch(ActionTimeoutException e) {168 Assert.assertTrue(e.getLocalizedMessage().startsWith("Action timeout after 5000 milliseconds. Failed to receive message on endpoint"));169 return;170 }171 Assert.fail("Missing " + ActionTimeoutException.class + " because no message was received");172 }173 @Test174 public void testReceiveMessageNoReplyQueue() {175 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();176 endpoint.getEndpointConfiguration().setQueue(queue);177 endpoint.getEndpointConfiguration().setTimeout(500L);178 endpoint.getEndpointConfiguration().setPollingInterval(150L);179 Map<String, Object> headers = new HashMap<>();180 final Message message = new DefaultMessage("<TestResponse>Hello World!</TestResponse>", headers);181 reset(queue, replyQueue);182 when(queue.receive(500L)).thenReturn(message);183 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();184 Message receivedMessage = channelSyncConsumer.receive(context);185 Assert.assertEquals(receivedMessage.getPayload(), message.getPayload());186 Assert.assertEquals(receivedMessage.getHeader(MessageHeaders.ID), message.getId());187 MessageQueue savedReplyQueue = channelSyncConsumer.getCorrelationManager().find("", endpoint.getEndpointConfiguration().getTimeout());188 Assert.assertNull(savedReplyQueue);189 }190 @Test191 public void testSendReplyMessage() {192 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();193 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");194 reset(replyQueue);195 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();196 channelSyncConsumer.saveReplyMessageQueue(new DefaultMessage("").setHeader(DirectMessageHeaders.REPLY_QUEUE, replyQueue), context);197 channelSyncConsumer.send(message, context);198 verify(replyQueue).send(any(Message.class));199 }200 @Test201 public void testSendReplyMessageWithReplyMessageCorrelator() {202 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();203 MessageCorrelator correlator = new DefaultMessageCorrelator();204 endpoint.getEndpointConfiguration().setCorrelator(correlator);205 Message request = new DefaultMessage("").setHeader(DirectMessageHeaders.REPLY_QUEUE, replyQueue);206 ((DirectSyncConsumer)endpoint.createConsumer()).getCorrelationManager().saveCorrelationKey(207 endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKeyName(endpoint.createConsumer().getName()),208 request.getId(), context);209 Map<String, Object> headers = new HashMap<>();210 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>", headers);211 reset(replyQueue);212 doAnswer(invocation -> {213 Assert.assertEquals(((DefaultMessage)invocation.getArguments()[0]).getPayload(), message.getPayload());214 return null;215 }).when(replyQueue).send(any(Message.class));216 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();217 channelSyncConsumer.saveReplyMessageQueue(request, context);218 channelSyncConsumer.send(message, context);219 }220 @Test221 public void testSendReplyMessageWithMissingCorrelatorKey() {222 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();223 MessageCorrelator correlator = new DefaultMessageCorrelator();224 endpoint.getEndpointConfiguration().setCorrelator(correlator);225 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");226 try {227 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();228 channelSyncConsumer.send(message, context);229 } catch(CitrusRuntimeException e) {230 Assert.assertTrue(e.getMessage().startsWith("Failed to get correlation key for"), e.getMessage());231 return;232 }233 Assert.fail("Missing " + IllegalArgumentException.class + " because of missing correlation key");234 }235 @Test236 public void testNoCorrelationKeyFound() {237 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();238 MessageCorrelator correlator = new DefaultMessageCorrelator();239 endpoint.getEndpointConfiguration().setCorrelator(correlator);240 DirectSyncEndpoint dummyEndpoint = new DirectSyncEndpoint();241 dummyEndpoint.setName("dummyEndpoint");242 ((DirectSyncConsumer)dummyEndpoint.createConsumer()).getCorrelationManager().saveCorrelationKey(243 dummyEndpoint.getEndpointConfiguration().getCorrelator().getCorrelationKeyName(dummyEndpoint.createConsumer().getName()),244 "123456789", context);245 Map<String, Object> headers = new HashMap<>();246 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>", headers);247 try {248 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();249 channelSyncConsumer.send(message, context);250 } catch(CitrusRuntimeException e) {251 Assert.assertTrue(e.getMessage().startsWith("Failed to get correlation key"));252 return;253 }254 Assert.fail("Missing " + IllegalArgumentException.class + " because no reply destination found");255 }256 @Test257 public void testNoReplyDestinationFound() {258 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();259 endpoint.getEndpointConfiguration().setTimeout(1000L);260 MessageCorrelator correlator = new DefaultMessageCorrelator();261 endpoint.getEndpointConfiguration().setCorrelator(correlator);262 ((DirectSyncConsumer)endpoint.createConsumer()).getCorrelationManager().saveCorrelationKey(263 endpoint.getEndpointConfiguration().getCorrelator().getCorrelationKeyName(endpoint.createConsumer().getName()),264 "123456789", context);265 Map<String, Object> headers = new HashMap<>();266 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>", headers);267 try {268 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();269 channelSyncConsumer.send(message, context);270 } catch(IllegalArgumentException e) {271 Assert.assertTrue(e.getMessage().startsWith("Failed to find reply channel"));272 return;273 }274 Assert.fail("Missing " + IllegalArgumentException.class + " because no reply destination found");275 }276 @Test277 public void testSendEmptyMessage() {278 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();279 try {280 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();281 channelSyncConsumer.send(null, context);282 } catch(IllegalArgumentException e) {283 Assert.assertEquals(e.getMessage(), "Can not send empty message");284 return;285 }286 Assert.fail("Missing " + IllegalArgumentException.class + " because of sending empty message");287 }288 @Test289 public void testSendReplyMessageFail() {290 DirectSyncEndpoint endpoint = new DirectSyncEndpoint();291 final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");292 reset(replyQueue);293 doThrow(new CitrusRuntimeException("Internal error!")).when(replyQueue).send(any(Message.class));294 try {295 DirectSyncConsumer channelSyncConsumer = (DirectSyncConsumer) endpoint.createConsumer();296 channelSyncConsumer.saveReplyMessageQueue(new DefaultMessage("").setHeader(DirectMessageHeaders.REPLY_QUEUE, replyQueue), context);297 channelSyncConsumer.send(message, context);298 } catch(CitrusRuntimeException e) {299 Assert.assertEquals(e.getClass(), CitrusRuntimeException.class);300 Assert.assertEquals(e.getLocalizedMessage(), "Internal error!");301 return;302 }303 Assert.fail("Missing " + CitrusRuntimeException.class + " because of message channel template returned false");304 }305}...

Full Screen

Full Screen

ChannelSyncConsumer

Using AI Code Generation

copy

Full Screen

1package org.citrus;2import org.springframework.context.support.ClassPathXmlApplicationContext;3import com.consol.citrus.channel.ChannelSyncConsumer;4public class ChannelSyncConsumerTest {5public static void main(String[] args) {6ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:application-context.xml");7ChannelSyncConsumer consumer = context.getBean("channelSyncConsumer",ChannelSyncConsumer.class);8System.out.println("Message Received: "+consumer.receive(1000L));9}10}11package org.citrus;12import org.springframework.context.support.ClassPathXmlApplicationContext;13import com.consol.citrus.channel.ChannelSyncProducer;14public class ChannelSyncProducerTest {15public static void main(String[] args) {16ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:application-context.xml");17ChannelSyncProducer producer = context.getBean("channelSyncProducer",ChannelSyncProducer.class);18producer.send("Hello World");19}20}21package org.citrus;22import org.springframework.context.support.ClassPathXmlApplicationContext;23import com.consol.citrus.channel.ChannelSyncEndpoint;24public class ChannelSyncEndpointTest {25public static void main(String[] args) {26ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:application-context.xml");27ChannelSyncEndpoint endpoint = context.getBean("channelSyncEndpoint",ChannelSyncEndpoint.class);28endpoint.createConsumer().receive(1000L);29}30}31package org.citrus;32import org.springframework.context.support.ClassPathXmlApplicationContext;33import com.consol.citrus.channel.ChannelSyncEndpoint;34public class ChannelSyncEndpointTest {35public static void main(String[] args) {36ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:application-context.xml");37ChannelSyncEndpoint endpoint = context.getBean("channelSyncEndpoint",ChannelSyncEndpoint.class);38endpoint.createProducer().send("Hello World");39}40}41package org.citrus;42import org.springframework.context.support.ClassPathXmlApplicationContext;43import com.consol.cit

Full Screen

Full Screen

ChannelSyncConsumer

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.channel;2import org.springframework.context.support.ClassPathXmlApplicationContext;3import org.springframework.integration.Message;4import org.springframework.integration.support.MessageBuilder;5public class ChannelSyncConsumer4 {6 public static void main(String[] args) {7 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(8 "ChannelSyncConsumer4.xml");9 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) context10 .getBean("channelSyncConsumer");11 Message<?> message = MessageBuilder.withPayload("Hello World!")12 .setHeader("operation", "greet").build();13 Message<?> reply = channelSyncConsumer.receive(message);14 System.out.println(reply.getPayload());15 context.close();16 }17}18package com.consol.citrus.channel;19import org.springframework.context.support.ClassPathXmlApplicationContext;20import org.springframework.integration.Message;21import org.springframework.integration.support.MessageBuilder;22public class ChannelSyncConsumer5 {23 public static void main(String[] args) {24 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(25 "ChannelSyncConsumer5.xml");26 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) context27 .getBean("channelSyncConsumer");28 Message<?> message = MessageBuilder.withPayload("Hello World!")29 .setHeader("operation", "greet").build();

Full Screen

Full Screen

ChannelSyncConsumer

Using AI Code Generation

copy

Full Screen

1public class 4 {2 public static void main(String[] args) {3 ChannelSyncConsumer channelSyncConsumer = new ChannelSyncConsumer();4 channelSyncConsumer.setChannelName("testChannel");5 channelSyncConsumer.setApplicationContext(new ClassPathXmlApplicationContext("applicationContext.xml"));6 channelSyncConsumer.afterPropertiesSet();7 Message message = channelSyncConsumer.receive(10000);8 System.out.println(message.getPayload());9 }10}

Full Screen

Full Screen

ChannelSyncConsumer

Using AI Code Generation

copy

Full Screen

1public class 4 {2 public static void main(String[] args) {3 ChannelSyncConsumer channelSyncConsumer = new ChannelSyncConsumer();4 channelSyncConsumer.setChannelName("testChannel");5 channelSyncConsumer.setApplicationContext(new ClassPathXmlApplicationContext("applicationContext.xml"));6 channelSyncConsumer.afterPropertiesSet();7 Message message = channelSyncConsumer.receive(10000);8 System.out.println(message);9 }10}11public class 5 {12 public static void main(String[] args) {13 ChannelSyncConsumer channelSyncConsumer = new ChannelSyncConsumer();14 channelSyncConsumer.setChannelName("testChannel");15 channelSyncConsumer.setApplicationContext(new ClassPathXmlApplicationContext("applicationContext.xml"));16 channelSyncConsumer.afterPropertiesSet();17 Message message = channelSyncConsumer.receive(10000);18 System.out.println(message);19 }20}21public class 6 {22 public static void main(String[] args) {23 ChannelSyncConsumer channelSyncConsumer = new ChannelSyncConsumer();24 channelSyncConsumer.setChannelName("testChannel");25 channelSyncConsumer.setApplicationContext(new ClassPathXmlApplicationContext("applicationContext.xml"));26 channelSyncConsumer.afterPropertiesSet();27 Message message = channelSyncConsumer.receive(10000);28 System.out.println(message);29 }30}31public class 7 {32 public static void main(String[] args) {33 ChannelSyncConsumer channelSyncConsumer = new ChannelSyncConsumer();34 channelSyncConsumer.setChannelName("testChannel");35 channelSyncConsumer.setApplicationContext(new ClassPathXmlApplicationContext("applicationContext.xml"));36 channelSyncConsumer.afterPropertiesSet();37 Message message = channelSyncConsumer.receive(10000);38 System.out.println(message);39 }40}41public class 8 {42 public static void main(String[] args) {43 ChannelSyncConsumer channelSyncConsumer = new ChannelSyncConsumer();44 channelSyncConsumer.setChannelName("testChannel");45 channelSyncConsumer.setApplicationContext(new ClassPathXmlApplicationContext

Full Screen

Full Screen

ChannelSyncConsumer

Using AI Code Generation

copy

Full Screen

1public class ChannelSyncConsumer {2 public static void main(String[] args) {3 ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");4 ChannelSyncConsumer consumer = context.getBean("channelSyncConsumer", ChannelSyncConsumer.class);5 consumer.receiveMessage();6 }7 public void receiveMessage() {8 Message<?> message = channel.receive();9 System.out.println("Message received: " + message.getPayload());10 }11 private Channel channel;12}

Full Screen

Full Screen

ChannelSyncConsumer

Using AI Code Generation

copy

Full Screen

1package com.consol.citrus.channel;2import org.springframework.beans.factory.annotation.Autowired;3import org.springframework.context.annotation.Bean;4import org.springframework.context.annotation.Configuration;5import org.springframework.integration.channel.DirectChannel;6import org.springframework.integration.channel.QueueChannel;7import org.springframework.integration.core.MessagingTemplate;8import org.springframework.integration.dsl.IntegrationFlow;9import org.springframework.integration.dsl.IntegrationFlows;10import org.springframework.integration.dsl.MessageChannels;11import org.springframework.integration.dsl.context.IntegrationFlowContext;12import org.springframework.integration.dsl.support.GenericHandler;13import org.springframework.integration.handler.LoggingHandler;14import org.springframework.integration.handler.LoggingHandler.Level;15import org.springframework.messaging.Message;16import org.springframework.messaging.MessageChannel;17import org.springframework.messaging.MessageHandler;18import org.springframework.messaging.PollableChannel;19import com.consol.citrus.channel.ChannelSyncConsumer;20public class ChannelSyncConsumerConfig {21 private IntegrationFlowContext integrationFlowContext;22 public QueueChannel channel() {23 return MessageChannels.queue().get();24 }25 public DirectChannel replyChannel() {26 return MessageChannels.direct().get();27 }28 public IntegrationFlow flow() {29 return IntegrationFlows.from("channel")30 .handle(new LoggingHandler(Level.INFO))31 .handle(new GenericHandler<String>() {32 public Object handle(String payload, MessageHeaders headers) {33 return "Reply: " + payload;34 }35 })36 .channel("replyChannel")37 .get();38 }39 public MessageChannel channel2() {40 return MessageChannels.direct().get();41 }42 public MessageChannel channel3() {43 return MessageChannels.direct().get();44 }45 public void send(String message) {46 MessageChannel channel = channel();47 channel.send(MessageBuilder.withPayload(message).build());48 }49 public void send(String message, MessageChannel channel) {50 channel.send(MessageBuilder.withPayload(message).build());51 }52 public Message<?> receive() {53 PollableChannel channel = channel();54 return channel.receive();55 }56 public Message<?> receive(MessageChannel channel) {57 PollableChannel pollableChannel = (PollableChannel) channel;58 return pollableChannel.receive();59 }60 public Message<?> receiveFromReplyChannel() {61 PollableChannel channel = replyChannel();62 return channel.receive();63 }

Full Screen

Full Screen

ChannelSyncConsumer

Using AI Code Generation

copy

Full Screen

1public class 4 {2 public static void main(String[] args) {3 ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");4 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) context.getBean("channelSyncConsumer");5 Message message = channelSyncConsumer.receive("channel");6 System.out.println(message.getPayload());7 }8}9public class 5 {10 public static void main(String[] args) {11 ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");12 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) context.getBean("channelSyncConsumer");13 Message message = channelSyncConsumer.receive("channel", 10000);14 System.out.println(message.getPayload());15 }16}17public class 6 {18 public static void main(String[] args) {19 ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");20 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) context.getBean("channelSyncConsumer");21 Message message = channelSyncConsumer.receive("channel", 10000, new DefaultMessageSelector());22 System.out.println(message.getPayload());23 }24}25public class 7 {26 public static void main(String[] args) {27 ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");28 ChannelSyncConsumer channelSyncConsumer = (ChannelSyncConsumer) context.getBean("channelSyncConsumer");29 Message message = channelSyncConsumer.receive("channel", 10000, new DefaultMessageSelector(), new DefaultMessageConverter());30 System.out.println(message.getPayload());31 }32}

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