Package com.hybris.cis.client.mock
Class AvsClientMock
- java.lang.Object
-
- com.hybris.cis.client.mock.SharedClientMock
-
- com.hybris.cis.client.mock.AvsClientMock
-
public class AvsClientMock extends SharedClientMock implements AvsClient
Mock implementation ofAvsClient
-
-
Field Summary
-
Fields inherited from class com.hybris.cis.client.mock.SharedClientMock
PING_FAIL
-
-
Constructor Summary
Constructors Constructor Description AvsClientMock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AvsResultverifyAddress(java.lang.String xCisClientRef, java.lang.String tenantId, CisAddress address)The mock implementation is used for testing purposes.-
Methods inherited from class com.hybris.cis.client.mock.SharedClientMock
createRawResponseWithStatus, doPing
-
-
-
-
Method Detail
-
verifyAddress
public AvsResult verifyAddress(java.lang.String xCisClientRef, java.lang.String tenantId, CisAddress address) throws AbstractCisServiceException
The mock implementation is used for testing purposes. In case either one of the following field is missing in the CisAddress object, anAvsResultwith REJECT is returned: - AddressLine1 - City - Zipcode - CountryIf the city is set to something else than "review" and the previously mentioned fields are set, an AvsResult with Accept is returned. Otherwise, an AvsResult with the decision type CisDecision.REVIEW is returned
If AddressLine4 is set with the value of 503, a ServiceNotAvailableException is thrown. If AddressLine4 is set with the value of 502, a ServiceErrorResponseException with UnknownServiceExceptionDetail is thrown. If AddressLine4 is set with the value of 504, a ServiceTimeoutException is thrown. If AddressLine4 is set with the value of 500, a IllegalStateException is thrown.
- Specified by:
verifyAddressin interfaceAvsClient- Parameters:
address- the test address.xCisClientRef- client ref to pass in the headertenantId- tenantId to pass in the header- Returns:
- AvsResult an result object containing the simulated decision.
- Throws:
AbstractCisServiceException
-
-