summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java b/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java
index aae494f84..fd7033c6e 100644
--- a/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java
+++ b/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java
@@ -46,12 +46,18 @@ public class SimulatorApi {
com.fasterxml.jackson.databind.JsonMappingException: Can not find a (Map) Key deserializer for type
[simple type, class org.mockserver.model.NottableString]
*/
- public static class Path {
+ public static class StringWrapper {
public String value;
}
+ public static class RecordedHeaders {
+ public StringWrapper name;
+ public List<StringWrapper> values;
+ }
+
public static class HttpRequest{
- public Path path;
+ public StringWrapper path;
+ public List<RecordedHeaders> headers;
}
private static final URI uri; //uri for registration
@@ -146,12 +152,16 @@ public class SimulatorApi {
The key of the map is a path, and the value is counter
*/
public static Map<String, Long> retrieveRecordedRequestsPathCounter() {
- Response response = client.target(uri).path("retrieveRecordedRequests").request().get();
- List<HttpRequest> httpRequests = response.readEntity(new GenericType<List<HttpRequest>>(){});
+ List<HttpRequest> httpRequests = retrieveRecordedRequests();
return httpRequests.stream().map(x->x.path.value).collect(
Collectors.groupingBy(Function.identity(), Collectors.counting()));
}
+ public static List<HttpRequest> retrieveRecordedRequests() {
+ Response response = client.target(uri).path("retrieveRecordedRequests").request().get();
+ return response.readEntity(new GenericType<List<HttpRequest>>(){});
+ }
+
private static void registerToSimulatorAndAssertSuccess(String name, Object content, RegistrationStrategy registrationStrategy) {
if (registrationStrategy == RegistrationStrategy.CLEAR_THEN_SET) {
clearRegistrations();