1414use Magento \Framework \MessageQueue \Consumer ;
1515use Magento \Framework \MessageQueue \Consumer \ConfigInterface ;
1616use Magento \Framework \MessageQueue \ConsumerConfigurationInterface ;
17- use Magento \Framework \MessageQueue \DefaultValueProvider ;
1817use Magento \Framework \MessageQueue \EnvelopeInterface ;
1918use Magento \Framework \MessageQueue \MessageController ;
2019use Magento \Framework \MessageQueue \MessageEncoder ;
@@ -100,11 +99,6 @@ class ConsumerTest extends TestCase
10099 */
101100 private $ deploymentConfig ;
102101
103- /**
104- * @var DefaultValueProvider|MockObject
105- */
106- private $ defaultValueProvider ;
107-
108102 /**
109103 * Set up.
110104 *
@@ -129,7 +123,6 @@ protected function setUp(): void
129123 ->disableOriginalConstructor ()
130124 ->getMockForAbstractClass ();
131125 $ this ->deploymentConfig = $ this ->createMock (DeploymentConfig::class);
132- $ this ->defaultValueProvider = $ this ->createMock (DefaultValueProvider::class);
133126
134127 $ objectManager = new ObjectManager ($ this );
135128 $ this ->poisonPillCompare = $ this ->getMockBuilder (PoisonPillCompareInterface::class)
@@ -142,18 +135,17 @@ protected function setUp(): void
142135 $ this ->callbackInvoker = new CallbackInvoker (
143136 $ this ->poisonPillRead ,
144137 $ this ->poisonPillCompare ,
145- $ this ->deploymentConfig ,
146- $ this ->defaultValueProvider
138+ $ this ->deploymentConfig
147139 );
148140 $ this ->consumer = $ objectManager ->getObject (
149141 Consumer::class,
150142 [
151- 'configuration ' => $ this ->configuration ,
152- 'messageEncoder ' => $ this ->messageEncoder ,
153- 'queueRepository ' => $ this ->queueRepository ,
154143 'invoker ' => $ this ->callbackInvoker ,
144+ 'messageEncoder ' => $ this ->messageEncoder ,
155145 'resource ' => $ this ->resource ,
156- 'logger ' => $ this ->logger
146+ 'configuration ' => $ this ->configuration ,
147+ 'logger ' => $ this ->logger ,
148+ 'queueRepository ' => $ this ->queueRepository
157149 ]
158150 );
159151
@@ -196,7 +188,6 @@ public function testProcessWithNotFoundException()
196188 $ exceptionPhrase = new Phrase ('Exception successfully thrown ' );
197189 $ this ->poisonPillRead ->expects ($ this ->atLeastOnce ())->method ('getLatestVersion ' )->willReturn ('version-1 ' );
198190 $ this ->poisonPillCompare ->expects ($ this ->atLeastOnce ())->method ('isLatestVersion ' )->willReturn (true );
199- $ this ->defaultValueProvider ->expects ($ this ->once ())->method ('getConnection ' )->willReturn ('db ' );
200191 $ this ->deploymentConfig ->expects ($ this ->any ())->method ('get ' )
201192 ->with ('queue/consumers_wait_for_messages ' , 1 )->willReturn (1 );
202193 $ queue = $ this ->getMockBuilder (QueueInterface::class)
@@ -233,7 +224,6 @@ public function testProcessWithGetMaxIdleTimeAndGetSleepConsumerConfigurations()
233224 $ numberOfMessages = 1 ;
234225 $ this ->poisonPillRead ->expects ($ this ->atLeastOnce ())->method ('getLatestVersion ' )->willReturn ('version-1 ' );
235226 $ this ->poisonPillCompare ->expects ($ this ->any ())->method ('isLatestVersion ' )->willReturn (true );
236- $ this ->defaultValueProvider ->expects ($ this ->once ())->method ('getConnection ' )->willReturn ('db ' );
237227 $ this ->deploymentConfig ->expects ($ this ->any ())->method ('get ' )
238228 ->with ('queue/consumers_wait_for_messages ' , 1 )->willReturn (1 );
239229 $ queue = $ this ->getMockBuilder (\Magento \Framework \MessageQueue \QueueInterface::class)
0 commit comments