Skip to content

Commit

Permalink
fix: correctly generate intersection tests (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 2, 2025
1 parent a7c996a commit 6bf75d8
Show file tree
Hide file tree
Showing 2 changed files with 334 additions and 251 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.onebusaway.errors.UnexpectedStatusCodeException
import org.onebusaway.errors.UnprocessableEntityException
import org.onebusaway.models.CurrentTimeRetrieveParams
import org.onebusaway.models.CurrentTimeRetrieveResponse
import org.onebusaway.models.References

@WireMockTest
class ErrorHandlingTest {
Expand All @@ -58,141 +59,182 @@ class ErrorHandlingTest {

val expected =
CurrentTimeRetrieveResponse.builder()
.putAdditionalProperty("code", JsonValue.from(0))
.putAdditionalProperty("currentTime", JsonValue.from(0))
.putAdditionalProperty("text", JsonValue.from("text"))
.putAdditionalProperty("version", JsonValue.from(0))
.putAdditionalProperty(
"data",
JsonValue.from(
mapOf(
"entry" to mapOf("readableTime" to "readableTime", "time" to 0),
"references" to
mapOf(
"agencies" to
listOf(
mapOf(
"id" to "id",
"name" to "name",
"timezone" to "timezone",
"url" to "url",
"disclaimer" to "disclaimer",
"email" to "email",
"fareUrl" to "fareUrl",
"lang" to "lang",
"phone" to "phone",
"privateService" to true,
.code(0L)
.currentTime(0L)
.text("text")
.version(0L)
.data(
CurrentTimeRetrieveResponse.Data.builder()
.entry(
CurrentTimeRetrieveResponse.Data.Entry.builder()
.readableTime("readableTime")
.time(0L)
.build()
)
.references(
References.builder()
.agencies(
listOf(
References.Agency.builder()
.id("id")
.name("name")
.timezone("timezone")
.url("url")
.disclaimer("disclaimer")
.email("email")
.fareUrl("fareUrl")
.lang("lang")
.phone("phone")
.privateService(true)
.build()
)
)
.routes(
listOf(
References.Route.builder()
.id("id")
.agencyId("agencyId")
.type(0L)
.color("color")
.description("description")
.longName("longName")
.nullSafeShortName("nullSafeShortName")
.shortName("shortName")
.textColor("textColor")
.url("url")
.build()
)
)
.situations(
listOf(
References.Situation.builder()
.id("id")
.creationTime(0L)
.activeWindows(
listOf(
References.Situation.ActiveWindow.builder()
.from(0L)
.to(0L)
.build()
)
)
),
"routes" to
listOf(
mapOf(
"id" to "id",
"agencyId" to "agencyId",
"type" to 0,
"color" to "color",
"description" to "description",
"longName" to "longName",
"nullSafeShortName" to "nullSafeShortName",
"shortName" to "shortName",
"textColor" to "textColor",
"url" to "url",
.allAffects(
listOf(
References.Situation.AllAffect.builder()
.agencyId("agencyId")
.applicationId("applicationId")
.directionId("directionId")
.routeId("routeId")
.stopId("stopId")
.tripId("tripId")
.build()
)
)
),
"situations" to
listOf(
mapOf(
"id" to "id",
"creationTime" to 0,
"activeWindows" to
listOf(mapOf("from" to 0, "to" to 0)),
"allAffects" to
listOf(
mapOf(
"agencyId" to "agencyId",
"applicationId" to "applicationId",
"directionId" to "directionId",
"routeId" to "routeId",
"stopId" to "stopId",
"tripId" to "tripId",
)
),
"consequenceMessage" to "consequenceMessage",
"consequences" to
listOf(
mapOf(
"condition" to "condition",
"conditionDetails" to
mapOf(
"diversionPath" to
mapOf(
"length" to 0,
"levels" to "levels",
"points" to "points",
),
"diversionStopIds" to
listOf("string")
.consequenceMessage("consequenceMessage")
.consequences(
listOf(
References.Situation.Consequence.builder()
.condition("condition")
.conditionDetails(
References.Situation.Consequence
.ConditionDetails
.builder()
.diversionPath(
References.Situation.Consequence
.ConditionDetails
.DiversionPath
.builder()
.length(0L)
.levels("levels")
.points("points")
.build()
)
.diversionStopIds(listOf("string"))
.build()
)
),
"description" to
mapOf("lang" to "lang", "value" to "value"),
"publicationWindows" to
listOf(mapOf("from" to 0, "to" to 0)),
"reason" to "equipmentReason",
"severity" to "severity",
"summary" to
mapOf("lang" to "lang", "value" to "value"),
"url" to
mapOf("lang" to "lang", "value" to "value"),
.build()
)
)
),
"stops" to
listOf(
mapOf(
"id" to "id",
"lat" to 0,
"lon" to 0,
"name" to "name",
"parent" to "parent",
"routeIds" to listOf("string"),
"staticRouteIds" to listOf("string"),
"code" to "code",
"direction" to "direction",
"locationType" to 0,
"wheelchairBoarding" to "wheelchairBoarding",
.description(
References.Situation.Description.builder()
.lang("lang")
.value("value")
.build()
)
),
"stopTimes" to
listOf(
mapOf(
"arrivalTime" to 0,
"departureTime" to 0,
"distanceAlongTrip" to 0,
"historicalOccupancy" to "historicalOccupancy",
"stopHeadsign" to "stopHeadsign",
"stopId" to "stopId",
.publicationWindows(
listOf(
References.Situation.PublicationWindow.builder()
.from(0L)
.to(0L)
.build()
)
)
),
"trips" to
listOf(
mapOf(
"id" to "id",
"routeId" to "routeId",
"serviceId" to "serviceId",
"blockId" to "blockId",
"directionId" to "directionId",
"peakOffpeak" to 0,
"routeShortName" to "routeShortName",
"shapeId" to "shapeId",
"timeZone" to "timeZone",
"tripHeadsign" to "tripHeadsign",
"tripShortName" to "tripShortName",
.reason(References.Situation.Reason.EQUIPMENT_REASON)
.severity("severity")
.summary(
References.Situation.Summary.builder()
.lang("lang")
.value("value")
.build()
)
),
.url(
References.Situation.Url.builder()
.lang("lang")
.value("value")
.build()
)
.build()
)
)
.stops(
listOf(
References.Stop.builder()
.id("id")
.lat(0.0)
.lon(0.0)
.name("name")
.parent("parent")
.routeIds(listOf("string"))
.staticRouteIds(listOf("string"))
.code("code")
.direction("direction")
.locationType(0L)
.wheelchairBoarding("wheelchairBoarding")
.build()
)
)
.stopTimes(
listOf(
References.StopTime.builder()
.arrivalTime(0L)
.departureTime(0L)
.distanceAlongTrip(0.0)
.historicalOccupancy("historicalOccupancy")
.stopHeadsign("stopHeadsign")
.stopId("stopId")
.build()
)
)
.trips(
listOf(
References.Trip.builder()
.id("id")
.routeId("routeId")
.serviceId("serviceId")
.blockId("blockId")
.directionId("directionId")
.peakOffpeak(0L)
.routeShortName("routeShortName")
.shapeId("shapeId")
.timeZone("timeZone")
.tripHeadsign("tripHeadsign")
.tripShortName("tripShortName")
.build()
)
)
.build()
)
)
.build()
)
.build()

Expand Down
Loading

0 comments on commit 6bf75d8

Please sign in to comment.