Class AvsClientMock

    • Constructor Detail

      • AvsClientMock

        public AvsClientMock()
    • 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, an AvsResult with REJECT is returned: - AddressLine1 - City - Zipcode - Country

        If 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:
        verifyAddress in interface AvsClient
        Parameters:
        address - the test address.
        xCisClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
        Returns:
        AvsResult an result object containing the simulated decision.
        Throws:
        AbstractCisServiceException