public function setUp()
 {
     $this->tariffplanLifecycleMapper = TariffPlanLifeCycleMapper::getInstance();
     $this->_user = $this->_createAuthUser(array('userName' => 'TariffPlanUserTest', 'organizationId' => self::PROVIDER_COMMERCIAL_ORG_ID));
     $this->testArray1 = array('states' => array(array('state' => 'INACTIVE_NEW', 'cost' => 5, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'TEST', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'ACTIVATION_READY', 'cost' => 15, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'ACTIVATION_PENDANT', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'ACTIVE', 'cost' => 1, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'DEACTIVATED', 'cost' => 10, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'SUSPENDED', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'RETIRED', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'transitions' => array(array('stateStart' => 'INACTIVE_NEW', 'stateFinal' => 'TEST', 'cost' => 15, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'INACTIVE_NEW', 'stateFinal' => 'ACTIVATION_READY', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'INACTIVE_NEW', 'stateFinal' => 'ACTIVATION_PENDANT', 'cost' => 1, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'TEST', 'stateFinal' => 'ACTIVATION_READY', 'cost' => 5, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'TEST', 'stateFinal' => 'ACTIVATION_PENDANT', 'cost' => 10, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'ACTIVATION_READY', 'stateFinal' => 'ACTIVE', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'ACTIVATION_PENDANT', 'stateFinal' => 'ACTIVE', 'cost' => 15, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'ACTIVE', 'stateFinal' => 'DEACTIVATED', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)));
     $this->testArray2 = array('states' => array(array('state' => 'INACTIVE_NEW', 'cost' => 1, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'TEST', 'cost' => 2, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'ACTIVATION_READY', 'cost' => 13, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'ACTIVATION_PENDANT', 'cost' => 20, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'ACTIVE', 'cost' => 1, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'DEACTIVATED', 'cost' => 6, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'SUSPENDED', 'cost' => 20, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('state' => 'RETIRED', 'cost' => 0, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'transitions' => array(array('stateStart' => 'INACTIVE_NEW', 'stateFinal' => 'TEST', 'cost' => 2, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'INACTIVE_NEW', 'stateFinal' => 'ACTIVATION_READY', 'cost' => 1, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'INACTIVE_NEW', 'stateFinal' => 'ACTIVATION_PENDANT', 'cost' => 3, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'TEST', 'stateFinal' => 'ACTIVATION_READY', 'cost' => 6, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'TEST', 'stateFinal' => 'ACTIVATION_PENDANT', 'cost' => 7, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'ACTIVATION_READY', 'stateFinal' => 'ACTIVE', 'cost' => 10, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'ACTIVATION_PENDANT', 'stateFinal' => 'ACTIVE', 'cost' => 20, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), array('stateStart' => 'ACTIVE', 'stateFinal' => 'DEACTIVATED', 'cost' => 9, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)));
 }
 protected function _createTariffPlanLifeCycle()
 {
     $tariffPlanLifeCycle = new Model\TariffPlanLifeCycleModel($this->_lifeCycleTariffPlanData);
     $this->_tflcMapper->insert($tariffPlanLifeCycle);
     $this->assertNotNull($tariffPlanLifeCycle->getId());
     $newTariffPlanLifeCycle = $this->_tflcMapper->findOneById($tariffPlanLifeCycle->getId());
     $this->assertNotNull($newTariffPlanLifeCycle, "TariffPlan LifeCycle does not exist");
     //         $this->_checkSavedData($this->_lifeCycleTariffPlanData, $newTariffPlanLifeCycle, "TariffPlanLifeCycle");
     return $tariffPlanLifeCycle->getId();
 }
 /**
  * Get mapper instance
  *
  * @return ProtoAbstractMapper|MongoAbstractMapper
  */
 public function getMapper($type = null)
 {
     if (!$type) {
         return parent::getMapper();
     }
     // Call mapper static method
     switch (strtolower($type)) {
         case self::TYPE_LIFECYCLE:
             return \Application\Model\Mapper\TariffPlanLifeCycleMapper::getInstance();
             break;
         case self::TYPE_SERVICES:
             return \Application\Model\Mapper\TariffPlanServicesMapper::getInstance();
             break;
         default:
             throw new AppEx\InvalidArgumentException("Invalid Type given");
     }
 }
 protected function setUp()
 {
     parent::setUp();
     $this->_mapper = \Application\Model\Mapper\TariffPlanLifeCycleMapper::getInstance();
 }