Class TaxClientMock

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PING_FAIL  
    • Constructor Summary

      Constructors 
      Constructor Description
      TaxClientMock()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CisTaxDoc adjust​(java.lang.String xClientRef, java.lang.String tenantId, java.lang.String taxDocId, CisOrder order)
      Simulates adjustment of a tax entry.
      com.hybris.charon.RawResponse<java.lang.String> cancel​(java.lang.String xClientRef, java.lang.String tenantId, java.lang.String taxDocId)
      Simulates cancellation of a tax entry.
      com.hybris.charon.RawResponse<java.lang.String> exists​(java.lang.String xClientRef, java.lang.String tenantId, java.lang.String taxDocId)
      Simulates check if the tax document exists
      protected java.util.Optional<java.net.URL> getLocation​(java.lang.String location)
      Transforms a URI into URL
      MockTaxUtils getTaxUtils()  
      CisTaxDoc invoice​(java.lang.String xClientRef, java.lang.String tenantId, CisOrder order)
      Simulates invoicing of taxes.
      CisTaxDoc post​(java.lang.String xClientRef, java.lang.String tenantId, CisOrder order)
      Simulates posting of taxes.
      CisTaxDoc quote​(java.lang.String xClientRef, java.lang.String tenantId, CisOrder order)
      Simulates quoting of taxes.
      void setTaxUtils​(MockTaxUtils taxUtils)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TaxClientMock

        public TaxClientMock()
    • Method Detail

      • quote

        public CisTaxDoc quote​(@HeaderParam("X-CIS-Client-ref")
                               java.lang.String xClientRef,
                               @HeaderParam("X-tenantId")
                               java.lang.String tenantId,
                               CisOrder order)
        Simulates quoting of taxes.
        Specified by:
        quote in interface TaxClient
        Parameters:
        order - an example order
        xClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
        Returns:
        a tax doc with set id and decision accept
      • post

        public CisTaxDoc post​(@HeaderParam("X-CIS-Client-ref")
                              java.lang.String xClientRef,
                              @HeaderParam("X-tenantId")
                              java.lang.String tenantId,
                              CisOrder order)
        Simulates posting of taxes.
        Specified by:
        post in interface TaxClient
        Parameters:
        order - an example order
        xClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
        Returns:
        an accepted tax doc with the document id equaling the cart id
      • invoice

        public CisTaxDoc invoice​(@HeaderParam("X-CIS-Client-ref")
                                 java.lang.String xClientRef,
                                 @HeaderParam("X-tenantId")
                                 java.lang.String tenantId,
                                 CisOrder order)
        Simulates invoicing of taxes.
        Specified by:
        invoice in interface TaxClient
        Parameters:
        order - an example order
        xClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
        Returns:
        an accepted tax document with document id equaling cart id
        Throws:
        ServiceErrorResponseException - with UnkownServiceExceptionDetail if the cart date is equals 1996\01\23
      • cancel

        public com.hybris.charon.RawResponse<java.lang.String> cancel​(@HeaderParam("X-CIS-Client-ref")
                                                                      java.lang.String xClientRef,
                                                                      @HeaderParam("X-tenantId")
                                                                      java.lang.String tenantId,
                                                                      java.lang.String taxDocId)
        Simulates cancellation of a tax entry.
        Specified by:
        cancel in interface TaxClient
        Parameters:
        taxDocId - the location URI of the document
        xClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
      • adjust

        public CisTaxDoc adjust​(@HeaderParam("X-CIS-Client-ref")
                                java.lang.String xClientRef,
                                @HeaderParam("X-tenantId")
                                java.lang.String tenantId,
                                java.lang.String taxDocId,
                                CisOrder order)
        Simulates adjustment of a tax entry.
        Specified by:
        adjust in interface TaxClient
        Parameters:
        order - example order to be adjusted
        xClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
        taxDocId - id of the tax document we want to adjust
        Returns:
        an accepted tax doc with doc id equaling cart id
      • exists

        public com.hybris.charon.RawResponse<java.lang.String> exists​(java.lang.String xClientRef,
                                                                      @HeaderParam("X-tenantId")
                                                                      java.lang.String tenantId,
                                                                      java.lang.String taxDocId)
        Simulates check if the tax document exists
        Specified by:
        exists in interface TaxClient
        Parameters:
        taxDocId - the location URI of the document
        xClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
      • getLocation

        protected java.util.Optional<java.net.URL> getLocation​(java.lang.String location)
        Transforms a URI into URL
        Parameters:
        location - the URI to be transformed
        Returns:
        the Optional
      • setTaxUtils

        public void setTaxUtils​(MockTaxUtils taxUtils)