citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
445 stars 135 forks source link

HttpServer in kubernetes #1140

Open hmmlopez opened 2 months ago

hmmlopez commented 2 months ago

Citrus Version Latest

Question We have an application (SUT) running in Kubernetes (OpenShift) that is calling some backends using http. How can we setup some test that are sending (httpClient) messages to the SUT deployed in OpenShift, and mock the backend endpoints with HttpServer in CitrusFramework?

What I've tried so far When starting the application locally I can easily test it just pointing the backend endpoints to the localhost httpserver port of citrusframework. But how can I achieve the same when deployed in Openshift?

Additional information We are running our pipeline in Jenkins, which deploys our application (SUT) with AWX and then should be able to run the integration test (inside or outside kubernetes). Now it’s running the integration test (not citrusframework) outside kubernetes by checking out some code and run it. As httpserver we are using a deployed wiremock server in kubernetes for the backend mocking.

bbortt commented 2 months ago

you're looking for the https://github.com/citrusframework/citrus-simulator. you'd have to start the simulator in a second container, side by side with your SUT. there, I think it lacks the following features (which I planned to implement for quit a while):

or wiremock, which offers a container image as well.

a "back-link" into the pipeline is not possible - not due to constraints from citrusframework/citrus, but simply because of the nature of build systems. generally speaking. of course, in some setups, exposing build pipelines might be possible.

bbortt commented 1 month ago

any news @hmmlopez? did you find what you're looking fore?

hmmlopez commented 1 month ago

I went ahead with wiremock, but it would be nice if citrus-simulator has that functionality.