Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APCV-1367 and APCV-1268 - CS conformance issue fix #161

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,18 @@ public static LinkedHashMap<String, CsScenarioListBuilder> createModuleScenarioL
}

private static CsScenarioListBuilder scenarioWithParametersPtpForPagination(
CsScenarioListBuilder thenWhat, CsFilterParameter... csFilterParameters) {
return supplyScenarioParameters(csFilterParameters).then(getPtpRoutings().then(thenWhat));
CsScenarioListBuilder nextRoutingsAction, CsFilterParameter... csFilterParameters) {
return supplyScenarioParameters(csFilterParameters).then(getPtpRoutings().then(nextRoutingsAction));
}

private static CsScenarioListBuilder scenarioWithParametersPsForPagination(
CsScenarioListBuilder thenWhat, CsFilterParameter... csFilterParameters) {
return supplyScenarioParameters(csFilterParameters).then(getPortSchedules().then(thenWhat));
CsScenarioListBuilder nextPortSchedulesAction, CsFilterParameter... csFilterParameters) {
return supplyScenarioParameters(csFilterParameters).then(getPortSchedules().then(nextPortSchedulesAction));
}

private static CsScenarioListBuilder scenarioWithParametersVsForPagination(
CsScenarioListBuilder thenWhat, CsFilterParameter... csFilterParameters) {
return supplyScenarioParameters(csFilterParameters).then(getVesselSchedules().then(thenWhat));
CsScenarioListBuilder nextVesselSchedulesAction, CsFilterParameter... csFilterParameters) {
return supplyScenarioParameters(csFilterParameters).then(getVesselSchedules().then(nextVesselSchedulesAction));
}

private static CsScenarioListBuilder scenarioWithParametersPtp(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ public CsGetPortSchedulesAction(
String publisherPartyName,
CsAction previousAction,
JsonSchemaValidator responseSchemaValidator) {
super(subscriberPartyName, publisherPartyName, previousAction, "GetPortSchedules", 200);
super(
subscriberPartyName,
publisherPartyName,
previousAction,
(previousAction instanceof CsGetPortSchedulesAction)
? "GetPortSchedules (second page)"
: "GetPortSchedules",
200);
this.responseSchemaValidator = responseSchemaValidator;
}

@Override
public String getHumanReadablePrompt() {
return "Send a GET port schedules request with the following parameters: "
+ sspSupplier.get().toJson().toPrettyString();
return previousAction instanceof CsGetPortSchedulesAction
? "Send a GET port schedules request to fetch the second results page, using the cursor retrieved from the headers of the response of the first GET request."
: "Send a GET port schedules request with the following parameters: "
+ sspSupplier.get().toJson().toPrettyString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ public CsGetRoutingsAction(
String publisherPartyName,
CsAction previousAction,
JsonSchemaValidator responseSchemaValidator1) {
super(subscriberPartyName, publisherPartyName, previousAction, "GetRoutings", 200);

super(
subscriberPartyName,
publisherPartyName,
previousAction,
(previousAction instanceof CsGetRoutingsAction) ? "GetRoutings (second page)" : "GetRoutings",
200);
this.responseSchemaValidator = responseSchemaValidator1;
}

Expand All @@ -35,8 +39,10 @@ public ObjectNode asJsonNode() {

@Override
public String getHumanReadablePrompt() {
return "Send a GET point to point routings request with the following parameters: "
+ sspSupplier.get().toJson().toPrettyString();
return previousAction instanceof CsGetRoutingsAction
? "Send a GET point to point routings request to fetch the second results page, using the cursor retrieved from the headers of the response of the first GET request."
: "Send a GET point to point routings request with the following parameters: "
+ sspSupplier.get().toJson().toPrettyString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@ public CsGetVesselSchedulesAction(
String publisherPartyName,
CsAction previousAction,
JsonSchemaValidator responseSchemaValidator) {
super(subscriberPartyName, publisherPartyName, previousAction, "GetVesselSchedules", 200);
super(
subscriberPartyName,
publisherPartyName,
previousAction,
(previousAction instanceof CsGetVesselSchedulesAction)
? "GetVesselSchedules (second page)"
: "GetVesselSchedules",
200);
this.responseSchemaValidator = responseSchemaValidator;
}


@Override
public String getHumanReadablePrompt() {
return "Send a GET vessel schedules request with the following parameters: "
+ sspSupplier.get().toJson().toPrettyString();
return previousAction instanceof CsGetVesselSchedulesAction
? "Send a GET vessel schedules request to fetch the second results page, using the cursor retrieved from the headers of the response of the first GET request."
: "Send a GET vessel schedules request with the following parameters: "
+ sspSupplier.get().toJson().toPrettyString();
}

@Override
Expand Down