Skip to content

Commit

Permalink
http-File PostWahlen setzt das gleiche Datum in Wahlen wie im Wahltag…
Browse files Browse the repository at this point in the history
… der wahltagID1 aus DummyClient
  • Loading branch information
Nic12345678 committed Sep 27, 2024
1 parent 71415e2 commit fe5e5da
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions wls-basisdaten-service/src/test/resources/wahlen.http
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ GET {{ SSO_URL }}/auth/realms/wls_realm/protocol/openid-connect/userinfo
Authorization: {{ token_type }} {{ auth_token }}

### POST Wahlen
## If you want to POST Wahlen to override existing Wahlen with the intention to find them later with getWahlen
## please take account of the value of posted properties "wahltag", because getWahlen is searching by wahltagID and
## the date of the wahltag corresponding to this wahltagID is the search parameter for the Wahl in Repo. If there is no
## Wahl with this "wahltag", then you will recive the response from remote client, so you could think that the old Wahl
## could have not been overwritten in the step before. Actualy they were replaced, but if they do not have the date of
## the Wahltag, than indeed is the expected response, the response from remote client.
## Hier wird das Datum des Wahltages mit der wahltagID1 gesetzt (today - 2 months) - siehe DummyClient
< {%
const today = new Date();
let dd = today.getDate();
const mm = today.getMonth();
let yyyy_2MonthsBefore = (mm < 2) ? new Date().getFullYear() - 1 : new Date().getFullYear();
let mm_2MonthsBefore = (mm % 12) - 1;
if (dd < 10) dd = '0' + dd;
if (mm_2MonthsBefore < 10) mm_2MonthsBefore = '0' + mm_2MonthsBefore;
const dateOfWahltagID1 = ('"' + yyyy_2MonthsBefore + '-' + mm_2MonthsBefore + '-' + dd + '"');
request.variables.set("dateOfWahltagID1", dateOfWahltagID1);
%}
POST {{ WLS_BASISDATEN_SERVICE_URL }}//businessActions/wahlen/wahltagID1
Authorization: {{ token_type }} {{ auth_token }}
Content-Type: application/json
Expand All @@ -34,7 +40,7 @@ Content-Type: application/json
"name": "aName_1",
"reihenfolge": 1,
"waehlerverzeichnisnummer": 1,
"wahltag": "2024-07-20",
"wahltag": {{ dateOfWahltagID1 }},
"wahlart": "BTW",
"farbe": {
"r": 0,
Expand All @@ -48,7 +54,7 @@ Content-Type: application/json
"name": "1",
"reihenfolge": 2,
"waehlerverzeichnisnummer": 1,
"wahltag": "2024-06-06",
"wahltag": {{ dateOfWahltagID1 }},
"wahlart": "EUW",
"farbe": {
"r": 3,
Expand All @@ -62,7 +68,7 @@ Content-Type: application/json
"name": "2-",
"reihenfolge": 3,
"waehlerverzeichnisnummer": 1,
"wahltag": "2024-06-06",
"wahltag": {{ dateOfWahltagID1 }},
"wahlart": "LTW",
"farbe": {
"r": 6,
Expand Down

0 comments on commit fe5e5da

Please sign in to comment.