private function _genDiagnosisNotification($transactionId) { $res = new \Application\Proto\SupDiagnosisAsync\DiagnosisNotification(); $result = new \Application\Proto\Result(); $result->setCode('OK'); $result->setReason('Operation successful'); $res->setResult($result); $simId = new \Application\Proto\SupProvision\Sim\SimId(); $simId->setImsi('1288228282'); $res->setSimId($simId); $res->setTaskId('taskId'); $res->setType(\Application\Proto\SupDiagnosis\Diagnosis\DiagnosisType::TYPE_2); $res->setResult(\Application\Proto\SupDiagnosisAsync\DiagnosisNotification\DiagnosisResult::GSM_UP); $dateInterval = new \Application\Proto\DateInterval(); $dateInterval->setStartDate('2011-11-11'); $dateInterval->setEndDate('2011-12-11'); $res->setTime($dateInterval); $req = new \Application\Proto\AsyncNotification\Service\Request(); $req->setToken($transactionId); $req->setProto('business.service.supdiagnosisasync.diagnosisasync'); $req->message = $res; return $req; }
public function testNotifyBusinessAction() { $orgId = \App_Test_PHPUnit_Framework_TestCase::CUSTOMER_ORG_ID; $proto = new \Application\Proto\AsyncNotification\Service\BusinessRuleResponse(); $proto->setAlarmRuleCondition(\Application\Proto\AlarmRuleCondition::CONSUMPTION_D_DATA_THR_1); $proto->setAlarmRuleId('alarmRuleId1'); $proto->setAlarmRuleName('pepito'); $businessRule = new \Application\Proto\BusinessRule(); $businessRule->setBusinessRuleType(\Application\Proto\BusinessRuleType::DISABLE_DATA); $proto->setBusinessRule($businessRule); $subscription = new \Application\Proto\SubscriptionId(); $subscription->setType(\Application\Proto\SubscriptionId\IdType::ID); $subscription->setId('1'); $failed = new \Application\Proto\FailedSubscription(); $failed->setSubscription($subscription); $failed->setReason('Reason in da mix'); $proto->setFailed(array($failed)); $proto->setOrganizationId(\Application\Model\Mapper\OrganizationMapper::cleanOrgId($orgId)); $result = new \Application\Proto\Result(); $result->setCode(0); $proto->setResult($result); $proto->setTotalSubscriptions(1); return $this->_testNotify($proto, 'business.service.asyncnotification.BusinessRuleResponse'); }