use of com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedTrace in project pinpoint by naver.
the class SpringAmqpRabbit_1_7_0_to_1_7_7_IT method testPullWithTimeout.
@Test
public void testPullWithTimeout() throws Exception {
final String remoteAddress = testRunner.getRemoteAddress();
Class<?> rabbitTemplateClass = Class.forName("org.springframework.amqp.rabbit.core.RabbitTemplate");
// verify queue-initiated traces
Method rabbitTemplateConvertAndSend = rabbitTemplateClass.getDeclaredMethod("convertAndSend", String.class, String.class, Object.class);
ExpectedTrace rabbitTemplateConvertAndSendTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateConvertAndSend);
// automatic recovery deliberately disabled as Spring has it's own recovery mechanism
Class<?> channelNClass = Class.forName("com.rabbitmq.client.impl.ChannelN");
Method channelNBasicPublish = channelNClass.getDeclaredMethod("basicPublish", String.class, String.class, boolean.class, boolean.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace channelNBasicPublishTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
channelNBasicPublish, // rpc
null, // endPoint
remoteAddress, // destinationId
"exchange-" + RabbitMQTestConstants.EXCHANGE, Expectations.annotation("rabbitmq.exchange", RabbitMQTestConstants.EXCHANGE), Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
ExpectedTrace rabbitMqConsumerInvocationTrace = Expectations.root(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
"RabbitMQ Consumer Invocation", // rpc
"rabbitmq://exchange=" + RabbitMQTestConstants.EXCHANGE, // endPoint (collected but API to retrieve local address is not available in all versions, so skip)
null, // remoteAddress
remoteAddress, Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
Class<?> consumerDispatcherClass = Class.forName("com.rabbitmq.client.impl.ConsumerDispatcher");
Method consumerDispatcherHandleDelivery = consumerDispatcherClass.getDeclaredMethod("handleDelivery", Consumer.class, String.class, Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace consumerDispatcherHandleDeliveryTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
consumerDispatcherHandleDelivery);
ExpectedTrace asynchronousInvocationTrace = Expectations.event(ServiceType.ASYNC.getName(), "Asynchronous Invocation");
Class<?> queueingConsumerClass = Class.forName("com.rabbitmq.client.QueueingConsumer");
Method queueingConsumerHandleDelivery = queueingConsumerClass.getDeclaredMethod("handleDelivery", String.class, Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace queueingConsumerHandleDeliveryTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, queueingConsumerHandleDelivery);
Class<?> queueingConsumerDeliveryClass = Class.forName("com.rabbitmq.client.QueueingConsumer$Delivery");
Constructor queueingConsumerDeliveryConstructor = queueingConsumerDeliveryClass.getDeclaredConstructor(Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace queueingConsumerDeliveryConstructorTrace = Expectations.event(RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, queueingConsumerDeliveryConstructor);
ExpectedTrace[] producerTraces = { rabbitTemplateConvertAndSendTrace, channelNBasicPublishTrace };
ExpectedTrace[] consumerTraces = { rabbitMqConsumerInvocationTrace, consumerDispatcherHandleDeliveryTrace, asynchronousInvocationTrace, queueingConsumerHandleDeliveryTrace, queueingConsumerDeliveryConstructorTrace };
// verify client-initiated traces
Method rabbitTemplateReceive = rabbitTemplateClass.getDeclaredMethod("receive", String.class, long.class);
ExpectedTrace rabbitTemplateReceiveTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateReceive);
Method queueingConsumerNextDelivery = queueingConsumerClass.getDeclaredMethod("nextDelivery", long.class);
ExpectedTrace queueingConsumerNextDeliveryTrace = Expectations.event(RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, queueingConsumerNextDelivery);
Class<?> propagationMarkerClass = PropagationMarker.class;
Method propagationMarkerMark = propagationMarkerClass.getDeclaredMethod("mark");
ExpectedTrace markTrace = Expectations.event(ServiceType.INTERNAL_METHOD.getName(), propagationMarkerMark);
ExpectedTrace[] clientInitiatedTraces = { rabbitTemplateReceiveTrace, queueingConsumerNextDeliveryTrace, markTrace };
final int expectedTraceCount = producerTraces.length + consumerTraces.length + clientInitiatedTraces.length;
final PluginTestVerifier verifier = testRunner.runPull(expectedTraceCount, 5000L);
verifier.verifyDiscreteTrace(producerTraces);
verifier.verifyDiscreteTrace(consumerTraces);
verifier.verifyDiscreteTrace(clientInitiatedTraces);
verifier.verifyTraceCount(0);
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedTrace in project pinpoint by naver.
the class SpringAmqpRabbit_2_0_0_to_2_0_3_IT method testPullWithTimeout.
@Test
public void testPullWithTimeout() throws Exception {
final String remoteAddress = testRunner.getRemoteAddress();
Class<?> rabbitTemplateClass = Class.forName("org.springframework.amqp.rabbit.core.RabbitTemplate");
// verify queue-initiated traces
Method rabbitTemplateConvertAndSend = rabbitTemplateClass.getDeclaredMethod("convertAndSend", String.class, String.class, Object.class);
ExpectedTrace rabbitTemplateConvertAndSendTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateConvertAndSend);
// automatic recovery deliberately disabled as Spring has it's own recovery mechanism
Class<?> channelNClass = Class.forName("com.rabbitmq.client.impl.ChannelN");
Method channelNBasicPublish = channelNClass.getDeclaredMethod("basicPublish", String.class, String.class, boolean.class, boolean.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace channelNBasicPublishTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
channelNBasicPublish, // rpc
null, // endPoint
remoteAddress, // destinationId
"exchange-" + RabbitMQTestConstants.EXCHANGE, Expectations.annotation("rabbitmq.exchange", RabbitMQTestConstants.EXCHANGE), Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
ExpectedTrace rabbitMqConsumerInvocationTrace = Expectations.root(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
"RabbitMQ Consumer Invocation", // rpc
"rabbitmq://exchange=" + RabbitMQTestConstants.EXCHANGE, // endPoint (collected but API to retrieve local address is not available in all versions, so skip)
null, // remoteAddress
remoteAddress, Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
Class<?> consumerDispatcherClass = Class.forName("com.rabbitmq.client.impl.ConsumerDispatcher");
Method consumerDispatcherHandleDelivery = consumerDispatcherClass.getDeclaredMethod("handleDelivery", Consumer.class, String.class, Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace consumerDispatcherHandleDeliveryTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
consumerDispatcherHandleDelivery);
ExpectedTrace asynchronousInvocationTrace = Expectations.event(ServiceType.ASYNC.getName(), "Asynchronous Invocation");
// RabbitTemplate internal consumer implementation - may change in future versions which will cause tests to
// fail, in which case the integration test needs to be updated to match code changes
Class<?> rabbitTemplateInternalConsumerClass = Class.forName("org.springframework.amqp.rabbit.core.RabbitTemplate$2");
Method rabbitTemplateInternalConsumerHandleDelivery = rabbitTemplateInternalConsumerClass.getDeclaredMethod("handleDelivery", String.class, Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace rabbitTemplateInternalConsumerHandleDeliveryTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateInternalConsumerHandleDelivery);
Class<?> deliveryClass = Class.forName("org.springframework.amqp.rabbit.support.Delivery");
Constructor<?> deliveryConstructor = deliveryClass.getDeclaredConstructor(String.class, Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace deliveryConstructorTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, deliveryConstructor);
ExpectedTrace[] producerTraces = { rabbitTemplateConvertAndSendTrace, channelNBasicPublishTrace };
ExpectedTrace[] consumerTraces = { rabbitMqConsumerInvocationTrace, consumerDispatcherHandleDeliveryTrace, asynchronousInvocationTrace, rabbitTemplateInternalConsumerHandleDeliveryTrace, deliveryConstructorTrace };
// verify client-initiated traces
Method rabbitTemplateReceive = rabbitTemplateClass.getDeclaredMethod("receive", String.class, long.class);
ExpectedTrace rabbitTemplateReceiveTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateReceive);
Class<?> propagationMarkerClass = PropagationMarker.class;
Method propagationMarkerMark = propagationMarkerClass.getDeclaredMethod("mark");
ExpectedTrace markTrace = Expectations.event(ServiceType.INTERNAL_METHOD.getName(), propagationMarkerMark);
ExpectedTrace[] clientInitiatedTraces = { rabbitTemplateReceiveTrace, markTrace };
final int expectedTraceCount = producerTraces.length + consumerTraces.length + clientInitiatedTraces.length;
final PluginTestVerifier verifier = testRunner.runPull(expectedTraceCount, 5000L);
verifier.verifyDiscreteTrace(producerTraces);
verifier.verifyDiscreteTrace(consumerTraces);
verifier.verifyDiscreteTrace(clientInitiatedTraces);
verifier.verifyTraceCount(0);
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedTrace in project pinpoint by naver.
the class SpringAmqpRabbit_2_0_0_to_2_0_3_IT method testPull.
@Test
public void testPull() throws Exception {
final String remoteAddress = testRunner.getRemoteAddress();
Class<?> rabbitTemplateClass = Class.forName("org.springframework.amqp.rabbit.core.RabbitTemplate");
// verify queue-initiated traces
Method rabbitTemplateConvertAndSend = rabbitTemplateClass.getDeclaredMethod("convertAndSend", String.class, String.class, Object.class);
ExpectedTrace rabbitTemplateConvertAndSendTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateConvertAndSend);
// automatic recovery deliberately disabled as Spring has it's own recovery mechanism
Class<?> channelNClass = Class.forName("com.rabbitmq.client.impl.ChannelN");
Method channelNBasicPublish = channelNClass.getDeclaredMethod("basicPublish", String.class, String.class, boolean.class, boolean.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace channelNBasicPublishTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
channelNBasicPublish, // rpc
null, // endPoint
remoteAddress, // destinationId
"exchange-" + RabbitMQTestConstants.EXCHANGE, Expectations.annotation("rabbitmq.exchange", RabbitMQTestConstants.EXCHANGE), Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
ExpectedTrace rabbitMqConsumerInvocationTrace = Expectations.root(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
"RabbitMQ Consumer Invocation", // rpc
"rabbitmq://exchange=" + RabbitMQTestConstants.EXCHANGE, // endPoint (collected but API to retrieve local address is not available in all versions, so skip)
null, // remoteAddress
remoteAddress, Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
Class<?> amqChannelClass = Class.forName("com.rabbitmq.client.impl.AMQChannel");
Method amqChannelHandleCompleteInboundCommand = amqChannelClass.getDeclaredMethod("handleCompleteInboundCommand", AMQCommand.class);
ExpectedTrace amqChannelHandleCompleteInboundCommandTrace = Expectations.event(// method
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, amqChannelHandleCompleteInboundCommand);
ExpectedTrace[] producerTraces = { rabbitTemplateConvertAndSendTrace, channelNBasicPublishTrace };
ExpectedTrace[] consumerTraces = { rabbitMqConsumerInvocationTrace, amqChannelHandleCompleteInboundCommandTrace };
// verify client-initiated traces
Method rabbitTemplateReceive = rabbitTemplateClass.getDeclaredMethod("receive", String.class);
ExpectedTrace rabbitTemplateReceiveTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateReceive);
Method channelNBasicGet = channelNClass.getDeclaredMethod("basicGet", String.class, boolean.class);
ExpectedTrace channelNBasicGetTrace = Expectations.event(RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, channelNBasicGet);
Class<?> propagationMarkerClass = PropagationMarker.class;
Method propagationMarkerMark = propagationMarkerClass.getDeclaredMethod("mark");
ExpectedTrace markTrace = Expectations.event(ServiceType.INTERNAL_METHOD.getName(), propagationMarkerMark);
ExpectedTrace[] clientInitiatedTraces = { rabbitTemplateReceiveTrace, channelNBasicGetTrace, markTrace };
final int expectedTraceCount = producerTraces.length + consumerTraces.length + clientInitiatedTraces.length;
final PluginTestVerifier verifier = testRunner.runPull(expectedTraceCount);
verifier.verifyDiscreteTrace(producerTraces);
verifier.verifyDiscreteTrace(consumerTraces);
verifier.verifyDiscreteTrace(clientInitiatedTraces);
verifier.verifyTraceCount(0);
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedTrace in project pinpoint by naver.
the class SpringAmqpRabbit_1_7_7_to_2_0_0_IT method testPullWithTimeout.
@Test
public void testPullWithTimeout() throws Exception {
final String remoteAddress = testRunner.getRemoteAddress();
Class<?> rabbitTemplateClass = Class.forName("org.springframework.amqp.rabbit.core.RabbitTemplate");
// verify queue-initiated traces
Method rabbitTemplateConvertAndSend = rabbitTemplateClass.getDeclaredMethod("convertAndSend", String.class, String.class, Object.class);
ExpectedTrace rabbitTemplateConvertAndSendTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateConvertAndSend);
// automatic recovery deliberately disabled as Spring has it's own recovery mechanism
Class<?> channelNClass = Class.forName("com.rabbitmq.client.impl.ChannelN");
Method channelNBasicPublish = channelNClass.getDeclaredMethod("basicPublish", String.class, String.class, boolean.class, boolean.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace channelNBasicPublishTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
channelNBasicPublish, // rpc
null, // endPoint
remoteAddress, // destinationId
"exchange-" + RabbitMQTestConstants.EXCHANGE, Expectations.annotation("rabbitmq.exchange", RabbitMQTestConstants.EXCHANGE), Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
ExpectedTrace rabbitMqConsumerInvocationTrace = Expectations.root(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
"RabbitMQ Consumer Invocation", // rpc
"rabbitmq://exchange=" + RabbitMQTestConstants.EXCHANGE, // endPoint (collected but API to retrieve local address is not available in all versions, so skip)
null, // remoteAddress
remoteAddress, Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
Class<?> consumerDispatcherClass = Class.forName("com.rabbitmq.client.impl.ConsumerDispatcher");
Method consumerDispatcherHandleDelivery = consumerDispatcherClass.getDeclaredMethod("handleDelivery", Consumer.class, String.class, Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace consumerDispatcherHandleDeliveryTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
consumerDispatcherHandleDelivery);
ExpectedTrace asynchronousInvocationTrace = Expectations.event(ServiceType.ASYNC.getName(), "Asynchronous Invocation");
Class<?> queueingConsumerClass = Class.forName("com.rabbitmq.client.QueueingConsumer");
Method queueingConsumerHandleDelivery = queueingConsumerClass.getDeclaredMethod("handleDelivery", String.class, Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace queueingConsumerHandleDeliveryTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, queueingConsumerHandleDelivery);
Class<?> queueingConsumerDeliveryClass = Class.forName("com.rabbitmq.client.QueueingConsumer$Delivery");
Constructor queueingConsumerDeliveryConstructor = queueingConsumerDeliveryClass.getDeclaredConstructor(Envelope.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace queueingConsumerDeliveryConstructorTrace = Expectations.event(RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, queueingConsumerDeliveryConstructor);
ExpectedTrace[] producerTraces = { rabbitTemplateConvertAndSendTrace, channelNBasicPublishTrace };
ExpectedTrace[] consumerTraces = { rabbitMqConsumerInvocationTrace, consumerDispatcherHandleDeliveryTrace, asynchronousInvocationTrace, queueingConsumerHandleDeliveryTrace, queueingConsumerDeliveryConstructorTrace };
// verify client-initiated traces
Method rabbitTemplateReceive = rabbitTemplateClass.getDeclaredMethod("receive", String.class, long.class);
ExpectedTrace rabbitTemplateReceiveTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateReceive);
Method queueingConsumerNextDelivery = queueingConsumerClass.getDeclaredMethod("nextDelivery", long.class);
ExpectedTrace queueingConsumerNextDeliveryTrace = Expectations.event(RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, queueingConsumerNextDelivery);
Class<?> propagationMarkerClass = PropagationMarker.class;
Method propagationMarkerMark = propagationMarkerClass.getDeclaredMethod("mark");
ExpectedTrace markTrace = Expectations.event(ServiceType.INTERNAL_METHOD.getName(), propagationMarkerMark);
ExpectedTrace[] clientInitiatedTraces = { rabbitTemplateReceiveTrace, queueingConsumerNextDeliveryTrace, markTrace };
final int expectedTraceCount = producerTraces.length + consumerTraces.length + clientInitiatedTraces.length;
final PluginTestVerifier verifier = testRunner.runPull(expectedTraceCount, 5000L);
verifier.verifyDiscreteTrace(producerTraces);
verifier.verifyDiscreteTrace(consumerTraces);
verifier.verifyDiscreteTrace(clientInitiatedTraces);
verifier.verifyTraceCount(0);
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedTrace in project pinpoint by naver.
the class SpringAmqpRabbit_1_7_7_to_2_0_0_IT method testPull.
@Test
public void testPull() throws Exception {
final String remoteAddress = testRunner.getRemoteAddress();
Class<?> rabbitTemplateClass = Class.forName("org.springframework.amqp.rabbit.core.RabbitTemplate");
// verify queue-initiated traces
Method rabbitTemplateConvertAndSend = rabbitTemplateClass.getDeclaredMethod("convertAndSend", String.class, String.class, Object.class);
ExpectedTrace rabbitTemplateConvertAndSendTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateConvertAndSend);
// automatic recovery deliberately disabled as Spring has it's own recovery mechanism
Class<?> channelNClass = Class.forName("com.rabbitmq.client.impl.ChannelN");
Method channelNBasicPublish = channelNClass.getDeclaredMethod("basicPublish", String.class, String.class, boolean.class, boolean.class, AMQP.BasicProperties.class, byte[].class);
ExpectedTrace channelNBasicPublishTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
channelNBasicPublish, // rpc
null, // endPoint
remoteAddress, // destinationId
"exchange-" + RabbitMQTestConstants.EXCHANGE, Expectations.annotation("rabbitmq.exchange", RabbitMQTestConstants.EXCHANGE), Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
ExpectedTrace rabbitMqConsumerInvocationTrace = Expectations.root(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT, // method
"RabbitMQ Consumer Invocation", // rpc
"rabbitmq://exchange=" + RabbitMQTestConstants.EXCHANGE, // endPoint (collected but API to retrieve local address is not available in all versions, so skip)
null, // remoteAddress
remoteAddress, Expectations.annotation("rabbitmq.routingkey", RabbitMQTestConstants.ROUTING_KEY_PULL));
Class<?> amqChannelClass = Class.forName("com.rabbitmq.client.impl.AMQChannel");
Method amqChannelHandleCompleteInboundCommand = amqChannelClass.getDeclaredMethod("handleCompleteInboundCommand", AMQCommand.class);
ExpectedTrace amqChannelHandleCompleteInboundCommandTrace = Expectations.event(// method
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, amqChannelHandleCompleteInboundCommand);
ExpectedTrace[] producerTraces = { rabbitTemplateConvertAndSendTrace, channelNBasicPublishTrace };
ExpectedTrace[] consumerTraces = { rabbitMqConsumerInvocationTrace, amqChannelHandleCompleteInboundCommandTrace };
// verify client-initiated traces
Method rabbitTemplateReceive = rabbitTemplateClass.getDeclaredMethod("receive", String.class);
ExpectedTrace rabbitTemplateReceiveTrace = Expectations.event(// serviceType
RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, // method
rabbitTemplateReceive);
Method channelNBasicGet = channelNClass.getDeclaredMethod("basicGet", String.class, boolean.class);
ExpectedTrace channelNBasicGetTrace = Expectations.event(RabbitMQTestConstants.RABBITMQ_CLIENT_INTERNAL, channelNBasicGet);
Class<?> propagationMarkerClass = PropagationMarker.class;
Method propagationMarkerMark = propagationMarkerClass.getDeclaredMethod("mark");
ExpectedTrace markTrace = Expectations.event(ServiceType.INTERNAL_METHOD.getName(), propagationMarkerMark);
ExpectedTrace[] clientInitiatedTraces = { rabbitTemplateReceiveTrace, channelNBasicGetTrace, markTrace };
final int expectedTraceCount = producerTraces.length + consumerTraces.length + clientInitiatedTraces.length;
final PluginTestVerifier verifier = testRunner.runPull(expectedTraceCount);
verifier.verifyDiscreteTrace(producerTraces);
verifier.verifyDiscreteTrace(consumerTraces);
verifier.verifyDiscreteTrace(clientInitiatedTraces);
verifier.verifyTraceCount(0);
}
Aggregations