23 private $messageController;
32 $this->lockFactory = $this->getMockBuilder(\
Magento\Framework\MessageQueue\LockInterfaceFactory::class)
33 ->disableOriginalConstructor()->setMethods([
'create'])->getMock();
35 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
37 \
Magento\Framework\MessageQueue\MessageController::class,
39 'lockFactory' => $this->lockFactory
53 $this->expectException(\
Magento\Framework\Exception\NotFoundException::class);
54 $this->expectExceptionMessage(
"Property 'message_id' not found in properties.");
55 $this->lockFactory->expects($this->once())->method(
'create');
56 $envelope = $this->getMockBuilder(\
Magento\Framework\MessageQueue\EnvelopeInterface::class)
57 ->disableArgumentCloning()->getMock();
58 $envelope->expects($this->once())->method(
'getProperties')->willReturn(
$properties);
60 $this->messageController->lock($envelope, $consumerName);
testLockWithNotFoundException()