NAME
Finance::IG::REST::Client - Module to mock REST::Client when testing Finance::IG
DESCRIPTION
This module mocks REST::CLient. Rather than sending request via the internet a series of files with names derived from a hash of url and parameters are retrieved and contain the expected respons.
The module is intended to be used with use Package::Alias, see below.
The files can be generated with the module in Testing::Record::REST::Client, but you will need an IG account to run generate files as you will need to really access the IG site.
VERSION
Version 0.093
SYNOPSIS
use Package::Alias 'REST::Client'=>'Finance::IG::REST::Client' ;
use REST::Client;
Or use Package::Alias 'REST::Client'=>'Finance::IG::REST::Client' ; use Some::Other::Module::That::UsesREST::Client'
calls to Some::Other... # All use the mocked REST::Client;
SUBROUTINES/METHODS
This is a list of the implemented methods. We only implement those needed for testing Finance::IG
new
No parameters, returns a blessed reference to the item
whoami
This function is not implemented in the original REST::Client. It returns a string
This is Finance::IG::REST::Client
so that you may know you have succesfully instantiated the right module.
POST
Mocks the REST::CLient POST function
responseCode
returns the success response code (200)
responseContent
returns the mocked content of the response
XSECURITYTOKEN
responseHeader
returns the mocked response header.
CST
Dummy function.
GET
Dummy function, calls POST