My feature files are structured like this
As you can see, each module has a common, mock and test feature files.
for eg: category-common.feature
, category-mock.feature
and category-test.feature
. These contain all common definitions, mock API definitions and tests respectively related to category APIs.
We are using the java -jar karate.jar -m <feature_file>
command to run the mock server.
This approach is good when we are testing the APIs module wise. The question is how can we deploy all mocks together in a single port?
As per this answer, it is not possible to do it. If not, what are some other approaches we can follow?