Class TestOutboundFacade

    • Constructor Detail

      • TestOutboundFacade

        public TestOutboundFacade()
    • Method Detail

      • respondWithCreated

        public TestOutboundFacade respondWithCreated()
        Specifies to respond with HTTP 201 Created to all requests it receives, unless this spec is overridden then by a subsequent call to a respondWith... or throwException method
        Returns:
        test facade instance stubbed for CREATED response.
      • respondWithNotFound

        public TestOutboundFacade respondWithNotFound()
        Specifies to respond with HTTP 404 Not Found to all requests it receives, unless this spec is not overridden then by a subsequent call to a respondWith... or throwException method.
        Returns:
        facade with the response specification applied.
      • respondWithBadRequest

        public TestOutboundFacade respondWithBadRequest()
        Specifies to respond with HTTP 400 Bad Request to all requests it receives, unless this spec is not overridden then by a subsequent call to a respondWith... or throwException method.
        Returns:
        facade with the response specification applied.
      • respondWithServerError

        public TestOutboundFacade respondWithServerError()
        Specifies to respond with HTTP 500 Internal Server Error to all requests it receives, unless this spec is not overridden then by a subsequent call to a respondWith... or throwException method.
        Returns:
        facade with the response specification applied.
      • doAndRespondWith

        public TestOutboundFacade doAndRespondWith​(org.springframework.http.ResponseEntity.HeadersBuilder builder,
                                                   java.lang.Runnable act)
        Specifies to perform an action before return the specified response from the send(ItemModel, String, String) method.
        Parameters:
        builder - a builder for the response to return.
        act - an action to perform before the response is returned. This allows to inject time-sensitive behavior to the test to call certain code when a desired item is being processed instead of relying on guessing the right time to execute that code in parallel.
        Returns:
        a facade with the response specified.
      • send

        public rx.Observable<org.springframework.http.ResponseEntity<java.util.Map>> send​(ItemModel itemModel,
                                                                                          java.lang.String integrationObjectCode,
                                                                                          java.lang.String destination)
        Description copied from interface: OutboundServiceFacade
        Method orchestrates the services to build the payload and to integrate with restful endpoint.
        Specified by:
        send in interface OutboundServiceFacade
        Parameters:
        itemModel - the model to be converted
        integrationObjectCode - the name of the integration object to convert this model as payload
        destination - endpoint destination information
        Returns:
        rx.Observable which allows the caller to subscribe the callback method
      • send

        public rx.Observable<org.springframework.http.ResponseEntity<java.util.Map>> send​(SyncParameters parameters)
        Description copied from interface: OutboundServiceFacade
        Method orchestrates the services to build the payload and to integrate with restful endpoint.
        Specified by:
        send in interface OutboundServiceFacade
        Parameters:
        parameters - a parameter object holding data about the item synchronization request
        Returns:
        rx.Observable which allows the caller to subscribe the callback method that provides result of the item sending.