function it_normalizes_job_instance(JobInstance $jobinstance)
 {
     $jobinstance->getCode()->willReturn('product_export');
     $jobinstance->getLabel()->willReturn('Product export');
     $jobinstance->getConnector()->willReturn('myconnector');
     $jobinstance->getType()->willReturn('EXPORT');
     $jobinstance->getRawConfiguration()->willReturn(['delimiter' => ';']);
     $this->normalize($jobinstance)->shouldReturn(['code' => 'product_export', 'label' => 'Product export', 'connector' => 'myconnector', 'type' => 'EXPORT', 'configuration' => ['delimiter' => ';']]);
 }
 /**
  * Get a registered job definition from a JobInstance
  *
  * @param JobInstance $jobInstance
  *
  * @return JobInterface
  * @throws \LogicException
  */
 public function getJob(JobInstance $jobInstance)
 {
     if ($connector = $this->getConnector($jobInstance->getConnector(), $jobInstance->getType())) {
         if ($job = $this->getConnectorJob($connector, $jobInstance->getAlias())) {
             $job->setConfiguration($jobInstance->getRawConfiguration());
             $jobInstance->setJob($job);
             return $job;
         }
     }
     return null;
 }
 /**
  * @param JobInstance $job
  *
  * @Given /^I should be on the ("([^"]*)" (import|export) job) page$/
  */
 public function iShouldBeOnTheJobPage(JobInstance $job)
 {
     $jobPage = sprintf('%s show', ucfirst($job->getType()));
     $expectedAddress = $this->getPage($jobPage)->getUrl(array('id' => $job->getId()));
     $this->assertAddress($expectedAddress);
 }
 /**
  * {@inheritDoc}
  */
 public function getType()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getType', array());
     return parent::getType();
 }