import { FtrProviderContext } from '../../../../common/ftr_provider_context' ; import { getExternalServiceSimulatorPath , ExternalServiceSimulator , } from '../../../../common/fixtures/plugins/actions_simulators/server/plugin' ; export default function servicenowTest ( { getService } ) { const supertest = getService ( 'supertest' ) ; const kibanaServer = getService ( 'kibanaServer' ) ; const mockServiceNow = { config : { apiUrl : 'www.servicenowisinkibanaactions.com' , } , secrets : { password : 'elastic' , username : 'changeme' , } , params : { incident : { short_description : 'a title' , description : 'a description' , severity : '1' , urgency : '2' , impact : '1' , } , comments : [ { commentId : '456' , comment : 'first comment' , } , ] , } , } ; describe ( 'servicenow' , ( ) => { let servicenowSimulatorURL = '<could not determine kibana url>' ; before ( ( ) => { servicenowSimulatorURL = kibanaServer . resolveUrl ( getExternalServiceSimulatorPath ( ExternalServiceSimulator . SERVICENOW ) ) ; } ) ; it ( 'should return 403 when creating a servicenow action' , async ( ) => { await supertest . post ( '/api/actions/action' ) . set ( 'kbn-xsrf' , 'foo' ) . send ( { name : 'A servicenow action' , actionTypeId : '.servicenow' , config : { apiUrl : servicenowSimulatorURL , } , secrets : mockServiceNow . secrets , } ) . expect ( 403 , { statusCode : 403 , error : 'Forbidden' , message : 'Action type .servicenow is disabled because your basic license does not support it. Please upgrade your license.' , } ) ; } ) ; } ) ; }