Skip to content

Commit

Permalink
fix(tests): added wiremock states for standalone e2e tests
Browse files Browse the repository at this point in the history
Co-authored-by: Torsten Will <[email protected]>
  • Loading branch information
insomnick and towi committed Nov 13, 2024
1 parent bbdec00 commit 8c87709
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docker/network-element/mappings/state_DestinationAdded.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
"bodyFileName": "fixtures/DestinationAdded/ModifyDestinationResponse_positive.xml"
}
},
{
"scenarioName": "all",
"requiredScenarioState": "DestinationAdded",
"request": {
"method": "POST",
"url": "/X1/NE",
"bodyPatterns": [{ "contains": "ModifyDestinationRequest" }, { "contains": "special snowflake" }]
},
"response": {
"bodyFileName": "fixtures/DestinationAdded/ModifyDestinationResponse_positive.xml"
}
},
{
"scenarioName": "all",
"requiredScenarioState": "DestinationAdded",
Expand Down
12 changes: 12 additions & 0 deletions docker/network-element/mappings/state_TaskAdded.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
"response": {
"bodyFileName": "fixtures/TaskAdded/ListAllDetailsResponse_positive.xml"
}
},
{
"scenarioName": "all",
"requiredScenarioState": "TaskAdded",
"request": {
"method": "POST",
"url": "/X1/NE",
"bodyPatterns": [{ "contains": "ModifyDestinationRequest" }, { "contains": "special snowflake" }]
},
"response": {
"bodyFileName": "fixtures/DestinationAdded/ModifyDestinationResponse_positive.xml"
}
}
]
}
2 changes: 2 additions & 0 deletions src/test/java/com/sipgate/li/simulator/e2e/E2ETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ void it_fails_to_activate_task_with_mismatching_delivery_type() throws IOExcepti
//GIVEN: Modify Destination to mismatch new tasks delivery type
final Map<String, String> DESTINATION_DETAILS_X2_ONLY = new HashMap<>(DESTINATION_DETAILS);
DESTINATION_DETAILS_X2_ONLY.put("deliveryType", X_2_ONLY.name());
DESTINATION_DETAILS_X2_ONLY.put("friendlyName", "special snowflake"); //Used in wiremock for special cases
client.post("/destination/" + D_ID, DESTINATION_DETAILS_X2_ONLY, ModifyDestinationResponse.class, 200);
//WHEN
final var mismatchingDeliveryType = X_3_ONLY;
Expand Down Expand Up @@ -345,6 +346,7 @@ void it_fails_to_modify_task_with_mismatching_delivery_type() throws IOException
//GIVEN: Modify Destination to mismatch new tasks delivery type
final Map<String, String> DESTINATION_DETAILS_X2_ONLY = new HashMap<>(DESTINATION_DETAILS);
DESTINATION_DETAILS_X2_ONLY.put("deliveryType", X_2_ONLY.name());
DESTINATION_DETAILS_X2_ONLY.put("friendlyName", "special snowflake"); //Used in wiremock for special matching
client.post("/destination/" + D_ID, DESTINATION_DETAILS_X2_ONLY, ModifyDestinationResponse.class, 200);
//WHEN
final var mismatchingDeliveryType = X_3_ONLY;
Expand Down

0 comments on commit 8c87709

Please sign in to comment.