public function testConsumeJob()
 {
     $type = 'JobType';
     $ticket = 'JobTicket';
     $producerMessage = new DefaultMessage('ConsumeJob', ['type' => $type, 'ticket' => $ticket]);
     $this->manager->expects($this->once())->method('onMessage')->with(new Message($type, $ticket));
     $this->subject->consumeJob($producerMessage);
 }
 public function testRestartAction()
 {
     $job = new Job();
     $job->setTicket('12345');
     $client = static::createClient();
     $this->mockServices(['abc.job.manager' => $this->manager]);
     $this->manager->expects($this->once())->method('restart')->willThrowException(new TicketNotFoundException($job->getTicket()));
     $client->request('POST', '/api/jobs/12345/restart');
     $this->assertEquals(404, $client->getResponse()->getStatusCode());
 }
 /**
  * @param ConsumerEvent $event
  * @dataProvider getInvalidEvent
  * @expectedException \InvalidArgumentException
  */
 public function testProcessThrowsInvalidArgumentException(ConsumerEvent $event)
 {
     $this->manager->expects($this->never())->method('onMessage');
     $this->subject->process($event);
 }