CyberSource / cybersource-sdk-java

Java SDK for CyberSource Simple Order API
Other
51 stars 84 forks source link

Provide an environment value to implement BDD test with a mocked cybersource service #133

Open sporniket opened 4 years ago

sporniket commented 4 years ago

I want to implement BDD test on my implementation of Psp Integration.

Usually, I have a mean to tell that the PSP API url point to a Wiremock managed url to send back to my code a controlled answer.

I cannot do that with cybersource SDK and ends up having to really use the test environnement ('CAS'). It means that my test MUST use keys and certificates that will expire, and that they will break at a later time. And it also means that my test are flawed, as I cannot control for sure the content of the answers from cybersource.

⇒ I would like another environment, e.g. called 'MOCK', that would allow a configuration value to store the effective url to use, e.g. 'https://localost:4000/mock/cybs', to be able to implement correctly BDD tests.

mahendya1002 commented 4 years ago

you can set mock url in serverUrl property in cybs.properties file or in Properties object before invoking Client.runTransaction