<fim-prefix>/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/

'use strict';

const angular = require('angular-js');
// BUG: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
// 
// FIXED:
c<fim-middle>onst _ = require('underscore-js');
require('angular-mocks');
require('../../../../../src/main/assets/js/apps/onms-requisitions/requisitions');

var controllerFactory, scope, $q, mockModal = {}, mockGro<fix-suffix>wl = {}, mockRequisitionsService = {}, foreignSource = 'test-requisition';

function createController() {
  return controllerFactory('ForeignSourceController', {
    $scope: scope,
    $routeParams: { 'foreignSource': foreignSource },
    $modal: mockModal,
    RequisitionsService: mockRequisitionsService,
    growl: mockGrowl
  });
}

beforeEach(angular.mock.module('onms-requisitions', function($provide) {
  $provide.value('$log', console);
}));

beforeEach(angular.mock.inject(function($rootScope, $controller, _$q_) {
  scope = $rootScope.$new();
  $q = _$q_;
  controllerFactory = $controller;
}));

beforeEach(function() {
  mockModal = {};

  mockRequisitionsService.getForeignSourceDefinition = jasmine.createSpy('getForeignSourceDefinition');
  mockRequisitionsService.getTiming = jasmine.createSpy('getTiming');
  var requisitionDefer = $q.defer();
  requisitionDefer.resolve({ detectors: [{'name':'ICMP'},{'name':'SNMP'}], policies: [{'name':'Foo'},{'name':'Bar'}] });
  mockRequisition<|endoftext|>