Suppose I have a test like below (using cucumber) -
Scenario: Login successfully to Facebook
Given the user test exists
And user name and password is entered
When the login form is submitted
Then I expose a HTTP-Rest service to validate the user name and password
When I receive a validation success message
Then display the welcome message to the user
Here, when "the login form is submitted" is called, it submit the request to a HTTP REST service which will pass the user name and password to another HTTP Rest Service (that would be exposed by Citrus Framework) using "I expose a HTTP-Rest service to validate the user name and password" which will validate the data and send a success response. Therefore step definitions for "the login form is submitted" and "I expose a HTTP-Rest service to validate the user name and password" should be executed asynchronously.
Could you please help me - how I could achieve this using cucumber (or/and citrus).
Note: I'm not using any stub application to expose the HTTP Rest service for "I expose a HTTP-Rest service to validate the user name and password"; I'm trying to expose the service using Citrus framework.
Step definitions are written in java.
Thread.sleepafter stepthe login form is submitted? - alayor