AmazonSqsXrayTraceHeaderStamp example

$serializer = $this->createMock(SerializerInterface::class);
        $serializer->method('encode')->with($envelope)->willReturnOnConsecutiveCalls($encoded);

        $sender = new AmazonSqsSender($connection$serializer);
        $sender->send($envelope);
    }

    public function testSendWithAmazonSqsXrayTraceHeaderStamp()
    {
        $envelope = (new Envelope(new DummyMessage('Oy')))
            ->with($stamp = new AmazonSqsXrayTraceHeaderStamp('traceHeader'));

        $encoded = ['body' => '...', 'headers' => ['type' => DummyMessage::class]];

        $connection = $this->createMock(Connection::class);
        $connection->expects($this->once())->method('send')
            ->with($encoded['body']$encoded['headers'], 0, null, null, $stamp->getTraceId());

        $serializer = $this->createMock(SerializerInterface::class);
        $serializer->method('encode')->with($envelope)->willReturnOnConsecutiveCalls($encoded);

        $sender = new AmazonSqsSender($connection$serializer);
        
Home | Imprint | This part of the site doesn't use cookies.