14
14
use Magento \Framework \MessageQueue \Consumer ;
15
15
use Magento \Framework \MessageQueue \Consumer \ConfigInterface ;
16
16
use Magento \Framework \MessageQueue \ConsumerConfigurationInterface ;
17
- use Magento \Framework \MessageQueue \DefaultValueProvider ;
18
17
use Magento \Framework \MessageQueue \EnvelopeInterface ;
19
18
use Magento \Framework \MessageQueue \MessageController ;
20
19
use Magento \Framework \MessageQueue \MessageEncoder ;
@@ -100,11 +99,6 @@ class ConsumerTest extends TestCase
100
99
*/
101
100
private $ deploymentConfig ;
102
101
103
- /**
104
- * @var DefaultValueProvider|MockObject
105
- */
106
- private $ defaultValueProvider ;
107
-
108
102
/**
109
103
* Set up.
110
104
*
@@ -129,7 +123,6 @@ protected function setUp(): void
129
123
->disableOriginalConstructor ()
130
124
->getMockForAbstractClass ();
131
125
$ this ->deploymentConfig = $ this ->createMock (DeploymentConfig::class);
132
- $ this ->defaultValueProvider = $ this ->createMock (DefaultValueProvider::class);
133
126
134
127
$ objectManager = new ObjectManager ($ this );
135
128
$ this ->poisonPillCompare = $ this ->getMockBuilder (PoisonPillCompareInterface::class)
@@ -142,18 +135,17 @@ protected function setUp(): void
142
135
$ this ->callbackInvoker = new CallbackInvoker (
143
136
$ this ->poisonPillRead ,
144
137
$ this ->poisonPillCompare ,
145
- $ this ->deploymentConfig ,
146
- $ this ->defaultValueProvider
138
+ $ this ->deploymentConfig
147
139
);
148
140
$ this ->consumer = $ objectManager ->getObject (
149
141
Consumer::class,
150
142
[
151
- 'configuration ' => $ this ->configuration ,
152
- 'messageEncoder ' => $ this ->messageEncoder ,
153
- 'queueRepository ' => $ this ->queueRepository ,
154
143
'invoker ' => $ this ->callbackInvoker ,
144
+ 'messageEncoder ' => $ this ->messageEncoder ,
155
145
'resource ' => $ this ->resource ,
156
- 'logger ' => $ this ->logger
146
+ 'configuration ' => $ this ->configuration ,
147
+ 'logger ' => $ this ->logger ,
148
+ 'queueRepository ' => $ this ->queueRepository
157
149
]
158
150
);
159
151
@@ -196,7 +188,6 @@ public function testProcessWithNotFoundException()
196
188
$ exceptionPhrase = new Phrase ('Exception successfully thrown ' );
197
189
$ this ->poisonPillRead ->expects ($ this ->atLeastOnce ())->method ('getLatestVersion ' )->willReturn ('version-1 ' );
198
190
$ this ->poisonPillCompare ->expects ($ this ->atLeastOnce ())->method ('isLatestVersion ' )->willReturn (true );
199
- $ this ->defaultValueProvider ->expects ($ this ->once ())->method ('getConnection ' )->willReturn ('db ' );
200
191
$ this ->deploymentConfig ->expects ($ this ->any ())->method ('get ' )
201
192
->with ('queue/consumers_wait_for_messages ' , 1 )->willReturn (1 );
202
193
$ queue = $ this ->getMockBuilder (QueueInterface::class)
@@ -233,7 +224,6 @@ public function testProcessWithGetMaxIdleTimeAndGetSleepConsumerConfigurations()
233
224
$ numberOfMessages = 1 ;
234
225
$ this ->poisonPillRead ->expects ($ this ->atLeastOnce ())->method ('getLatestVersion ' )->willReturn ('version-1 ' );
235
226
$ this ->poisonPillCompare ->expects ($ this ->any ())->method ('isLatestVersion ' )->willReturn (true );
236
- $ this ->defaultValueProvider ->expects ($ this ->once ())->method ('getConnection ' )->willReturn ('db ' );
237
227
$ this ->deploymentConfig ->expects ($ this ->any ())->method ('get ' )
238
228
->with ('queue/consumers_wait_for_messages ' , 1 )->willReturn (1 );
239
229
$ queue = $ this ->getMockBuilder (\Magento \Framework \MessageQueue \QueueInterface::class)
0 commit comments