chore: initial import for test contour
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: sova-mocks
|
||||
description: WireMock and Mailpit for test contour
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0.0"
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/lead-service/v1/api/request/create"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": {
|
||||
"leadId": "mock-lead-456"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/validate"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"status": "ok",
|
||||
"message": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/api/reservation/anonymous-reserve"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"status": "ok",
|
||||
"data": {
|
||||
"reservationId": "mock-reservation-123",
|
||||
"message": "Mock reservation created"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/filials/list"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Test Filial",
|
||||
"address": "г. Саратов, ул. Тестовая, д. 1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/api/reservation/intervals"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"workdates": [
|
||||
{
|
||||
"2026-05-28": [
|
||||
{
|
||||
"depnum": 10,
|
||||
"intervals": [
|
||||
{ "isFree": true, "time": "10:00", "duration": 30 },
|
||||
{ "isFree": false, "time": "10:30", "duration": 30 }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/pricelist/departments"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"id": 10,
|
||||
"name": "Test Department",
|
||||
"viewInWeb": 1,
|
||||
"schCount": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/pricelist/list"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"kodoper": "1001",
|
||||
"schname": "Test service",
|
||||
"specname": "Test specialist",
|
||||
"speccode": 101,
|
||||
"priceInfo": 1500,
|
||||
"discpercent": 0,
|
||||
"discprice": 1500,
|
||||
"structname": "Test dept",
|
||||
"fname": "Test Filial",
|
||||
"filial": 1,
|
||||
"comment": "",
|
||||
"mediaId": null
|
||||
}
|
||||
],
|
||||
"total": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: wiremock-mappings
|
||||
namespace: {{ .Values.namespace }}
|
||||
data:
|
||||
{{- range $path, $_ := .Files.Glob "mappings/*.json" }}
|
||||
{{ base $path }}: |
|
||||
{{ $.Files.Get $path | indent 4 }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mis-mock
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mis-mock
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mis-mock
|
||||
spec:
|
||||
containers:
|
||||
- name: wiremock
|
||||
image: {{ .Values.wiremock.image }}
|
||||
args: ["--global-response-templating"]
|
||||
ports:
|
||||
- containerPort: {{ .Values.wiremock.port }}
|
||||
volumeMounts:
|
||||
- name: mappings
|
||||
mountPath: /home/wiremock/mappings
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
volumes:
|
||||
- name: mappings
|
||||
configMap:
|
||||
name: wiremock-mappings
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mis-mock
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: mis-mock
|
||||
ports:
|
||||
- port: {{ .Values.wiremock.port }}
|
||||
targetPort: {{ .Values.wiremock.port }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mailpit
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mailpit
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mailpit
|
||||
spec:
|
||||
containers:
|
||||
- name: mailpit
|
||||
image: {{ .Values.mailpit.image }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.mailpit.smtpPort }}
|
||||
name: smtp
|
||||
- containerPort: {{ .Values.mailpit.uiPort }}
|
||||
name: ui
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 128Mi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mailpit
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: mailpit
|
||||
ports:
|
||||
- name: smtp
|
||||
port: {{ .Values.mailpit.smtpPort }}
|
||||
targetPort: smtp
|
||||
- name: ui
|
||||
port: {{ .Values.mailpit.uiPort }}
|
||||
targetPort: ui
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace: sova-mocks
|
||||
|
||||
wiremock:
|
||||
image: wiremock/wiremock:3.9.1
|
||||
port: 8080
|
||||
|
||||
mailpit:
|
||||
image: axllent/mailpit:v1.21
|
||||
smtpPort: 1025
|
||||
uiPort: 8025
|
||||
@@ -0,0 +1,14 @@
|
||||
services:
|
||||
wiremock:
|
||||
image: wiremock/wiremock:3.9.1
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- ./wiremock/mappings:/home/wiremock/mappings:ro
|
||||
command: ["--global-response-templating", "--verbose"]
|
||||
|
||||
mailpit:
|
||||
image: axllent/mailpit:v1.21
|
||||
ports:
|
||||
- "1025:1025"
|
||||
- "8025:8025"
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
docker compose up -d --wait 2>/dev/null || docker-compose up -d
|
||||
|
||||
sleep 2
|
||||
curl -sf "http://localhost:8080/api/reservation/intervals?doctor=1" | grep -q workdates && echo "OK mis-intervals"
|
||||
curl -sf -X POST "http://localhost:8080/api/reservation/anonymous-reserve" \
|
||||
-H "Content-Type: application/json" -d '{"test":true}' | grep -q reservationId && echo "OK anonymous-reserve"
|
||||
curl -sf -X POST "http://localhost:8080/validate" | grep -q '"status"' && echo "OK captcha"
|
||||
|
||||
echo "Mock smoke passed."
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/lead-service/v1/api/request/create"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": {
|
||||
"leadId": "mock-lead-456"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/validate"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"status": "ok",
|
||||
"message": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/api/reservation/anonymous-reserve"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"status": "ok",
|
||||
"data": {
|
||||
"reservationId": "mock-reservation-123",
|
||||
"message": "Mock reservation created"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/filials/list"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Test Filial",
|
||||
"address": "г. Саратов, ул. Тестовая, д. 1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/api/reservation/intervals"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"workdates": [
|
||||
{
|
||||
"2026-05-28": [
|
||||
{
|
||||
"depnum": 10,
|
||||
"intervals": [
|
||||
{ "isFree": true, "time": "10:00", "duration": 30 },
|
||||
{ "isFree": false, "time": "10:30", "duration": 30 }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/pricelist/departments"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"id": 10,
|
||||
"name": "Test Department",
|
||||
"viewInWeb": 1,
|
||||
"schCount": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"urlPath": "/pricelist/list"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"jsonBody": {
|
||||
"data": [
|
||||
{
|
||||
"kodoper": "1001",
|
||||
"schname": "Test service",
|
||||
"specname": "Test specialist",
|
||||
"speccode": 101,
|
||||
"priceInfo": 1500,
|
||||
"discpercent": 0,
|
||||
"discprice": 1500,
|
||||
"structname": "Test dept",
|
||||
"fname": "Test Filial",
|
||||
"filial": 1,
|
||||
"comment": "",
|
||||
"mediaId": null
|
||||
}
|
||||
],
|
||||
"total": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user