Skip to content

Commit

Permalink
Regenerate APIs, update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Sep 26, 2024
1 parent bb83e0c commit a09793b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5073,51 +5073,51 @@ public enum GraphQLVertexType {
TRANSIT,
}

public static class GraphQLViaElementInput {
public static class GraphQLViaLocationInput {

private List<String> placeIds;
private List<String> locationIds;

public GraphQLViaElementInput(Map<String, Object> args) {
public GraphQLViaLocationInput(Map<String, Object> args) {
if (args != null) {
this.placeIds = (List<String>) args.get("placeIds");
this.locationIds = (List<String>) args.get("locationIds");
}
}

public List<String> getGraphQLPlaceIds() {
return this.placeIds;
public List<String> getGraphQLLocationIds() {
return this.locationIds;
}

public void setGraphQLPlaceIds(List<String> placeIds) {
this.placeIds = placeIds;
public void setGraphQLLocationIds(List<String> locationIds) {
this.locationIds = locationIds;
}
}

public static class GraphQLViaPointInput {

private GraphQLViaElementInput element;
private String name;
private String label;
private GraphQLViaLocationInput place;

public GraphQLViaPointInput(Map<String, Object> args) {
if (args != null) {
this.element = new GraphQLViaElementInput((Map<String, Object>) args.get("element"));
this.name = (String) args.get("name");
this.label = (String) args.get("label");
this.place = new GraphQLViaLocationInput((Map<String, Object>) args.get("place"));
}
}

public GraphQLViaElementInput getGraphQLElement() {
return this.element;
public String getGraphQLLabel() {
return this.label;
}

public String getGraphQLName() {
return this.name;
public GraphQLViaLocationInput getGraphQLPlace() {
return this.place;
}

public void setGraphQLElement(GraphQLViaElementInput element) {
this.element = element;
public void setGraphQLLabel(String label) {
this.label = label;
}

public void setGraphQLName(String name) {
this.name = name;
public void setGraphQLPlace(GraphQLViaLocationInput place) {
this.place = place;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ private static PassThroughPoint handlePoint(
final TransitService transitService,
Map<String, Object> map
) {
Map<String, Object> element = (Map<String, Object>) map.get("element");
List<String> stops = (List<String>) element.get("placeIds");
Map<String, Object> element = (Map<String, Object>) map.get("place");
List<String> stops = (List<String>) element.get("locationIds");

final String name = (String) element.get("name");
if (stops == null || stops.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void transferSlack() {
void passThroughPoints() {
Map<String, Object> arguments = Map.of(
"viaPoints",
List.of(Map.of("element", Map.of("placeIds", List.of("F:stop1"))))
List.of(Map.of("place", Map.of("locationIds", List.of("F:stop1"))))
);

var routeRequest = LegacyRouteRequestMapper.toRouteRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class PassThroughLocationMapperTest {

public static List<List<Map<?, ?>>> failureCases() {
return List.of(
List.of(Map.of("element", Map.of("placeIds", List.of("fantasy:id")))),
List.of(Map.of("element", Map.of("placeIds", List.of()))),
List.of(Map.of("place", Map.of("locationIds", List.of("fantasy:id")))),
List.of(Map.of("place", Map.of("locationIds", List.of()))),
List.of(
Map.of("element", Map.of("placeIds", List.of())),
Map.of("element", Map.of("placeIds", List.of()))
Map.of("place", Map.of("locationIds", List.of())),
Map.of("place", Map.of("locationIds", List.of()))
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
filters: [{ select: [{ tags: ["e"] }] }]
}
transportModes: [{ mode: CAR, qualifier: HAIL }]
viaPoints: [{ name: "Flower shop", element: { placeIds: ["F:A", "F:B"] } }]
viaPoints: [
{ label: "Flower shop", place: { locationIds: ["F:A", "F:B"] } }
]
) {
itineraries {
start
Expand Down

0 comments on commit a09793b

Please sign in to comment.