<commit_before>const routeHelper = require('../../helpers/routes/route-helper')
const supertest = require('supertest')
const proxyquire = require('proxyquire')
const sinon = require('sinon')
const config = require('../../../config')
require('sinon-bluebird')

const ADMIN_URL = '/admin/'
const ADMIN_USER_URL = '/admin/user'
const ADMIN_USER_RIGHT_URL = '/admin/user-rights'

const USERNAME = {
  username: 'john.smith@' + config.ACTIVE_DIRECTORY_DOMAIN
}

const INVALID_USERNAME = {
  username: 'john.smith'
}

const ROLE = {
  role: 'Manager'
}

const ADMIN_USER_RIGHT_ROLES_URL = '/admin/user-rights/'

var app
var route
var userRoleService
var authorisationService
var hasRoleResult = true

var initaliseApp = function () {
  userRoleService = sinon.stub()
  authorisationService = {
    hasRole: sinon.stub().returns(hasRoleResult),
    isAuthenticationEnabled: sinon.stub().returns(config.AUTHENTICATION_ENABLED)
  }
  route = proxyquire('../../../app/routes/admin', {
    '../services/user-role-service': userRoleService,
    '../authorisation': authorisationService
  })
  app = routeHelper.buildApp(route)<commit_msg>Fix config value<commit_after>const routeHelper = require('../../helpers/routes/route-helper')
const supertest = require('supertest')
const proxyquire = require('proxyquire')
const sinon = require('sinon')
const config = require('../../../config')
require('sinon-bluebird')

const ADMIN_URL = '/admin/'
const ADMIN_USER_URL = '/admin/user'
const ADMIN_USER_RIGHT_URL = '/admin/user-rights'

const USERNAME = {
  username: 'john.smith@' + config.ACTIVE_DIRECTORY_DOMAIN
}

const INVALID_USERNAME = {
  username: 'john.smith'
}

const ROLE = {
  role: 'Manager'
}

const ADMIN_USER_RIGHT_ROLES_URL = '/admin/user-rights/'

var app
var route
var userRoleService
var authorisationService
var hasRoleResult = true
var mockConfig = {
  AUTHENTICATION_ENABLED: false
}
var initaliseApp = function () {
  userRoleService = sinon.stub()
  authorisationService = {
    hasRole: sinon.stub().returns(hasRoleResult),
    isAuthenticationEnabled: sinon.stub().returns(mockConfig)
  }
  route = proxyquire('../../../app/routes/admin', {
    '../services/user-role-service': userRoleService,
    '../authorisation': authorisationService
  })
  app = routeHelper.buildApp(route)
{'fraction_non_alphanumeric': 0.14466783216783216, 'fraction_numerical': 0.0, 'mean_word_length': 4.555825242718447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4016009', 'n_tokens_mistral': 734, 'n_tokens_neox': 740, 'n_words': 145}