diff --git a/goofy-client/apps/goofy-e2e/docker-compose.yml b/goofy-client/apps/goofy-e2e/docker-compose.yml index 3b0a0ea591d1afed116ba0810a7b3cd6e49ecdc6..5fa3eaab37f2316198b0ab0dd4873a3b7ad087a0 100644 --- a/goofy-client/apps/goofy-e2e/docker-compose.yml +++ b/goofy-client/apps/goofy-e2e/docker-compose.yml @@ -124,4 +124,10 @@ services: ports: - 9092:8080 depends_on: - - ozg-mongodb \ No newline at end of file + - ozg-mongodb + + ozg-smocker: + image: thiht/smocker + ports: + - 7080:8080 + - 7081:8081 \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/smocker/mocks.yaml b/goofy-client/apps/goofy-e2e/src/fixtures/smocker/mocks.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1428d2acfd6e09738f0ef5a9da73dd3792574e22 --- /dev/null +++ b/goofy-client/apps/goofy-e2e/src/fixtures/smocker/mocks.yaml @@ -0,0 +1,23 @@ +- request: + method: POST + path: /externe-processor-success + response: + status: 200 + headers: + Content-Type: application/json + body: > + { + "action": "CREATE_AKTENNOTIZ", + "body": { + "headline": "Eine neue Notiz", + "severity": "INFO", + "text": "Alles fein" + } + } +- request: + method: POST + path: /externe-processor-failure + response: + status: 500 + headers: + body: "Da ist etwas schiefgelaufen" \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/start-e2e-environment.sh b/goofy-client/apps/goofy-e2e/start-e2e-environment.sh index 092840b925f24cb6d11854056d22903aeeaee27b..179aae3d06896c35c1287da0486af6755e04ecb8 100755 --- a/goofy-client/apps/goofy-e2e/start-e2e-environment.sh +++ b/goofy-client/apps/goofy-e2e/start-e2e-environment.sh @@ -40,7 +40,7 @@ then export DOCKER_GATEWAY_HOST=172.17.0.1 fi -docker compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-mongodb ozg-usermanager ozg-elastic --wait +docker compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-mongodb ozg-usermanager ozg-elastic ozg-smocker --wait echo echo "Starting Pluto to init search index." @@ -78,5 +78,14 @@ do done echo +echo +echo "Init smocker" +while [ $(curl -sw '%{http_code}' "http://localhost:7081/version" -o /dev/null) -ne 200 ]; do + echo -n "." + sleep 1 +done + +curl -X POST http://localhost:7081/mocks -H 'Content-Type: application/x-yaml' --data-binary @src/fixtures/smocker/mocks.yaml + echo echo "done." \ No newline at end of file