Skip to content

Commit

Permalink
refactor(JDBCTableWriterTest.java): Added required pattern id to patt…
Browse files Browse the repository at this point in the history
…ern stop data
  • Loading branch information
br648 committed Sep 9, 2024
1 parent 16fecc1 commit abd7b9d
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions src/test/java/com/conveyal/gtfs/loader/JDBCTableWriterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,20 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
saveRecord(Table.STOPS, StopDTO.create(stopId, stopId, FIRST_STOP_LAT, FIRST_STOP_LON), StopDTO.class);
}
saveRecord(Table.LOCATIONS, LocationDTO.create("radius_1207_s_2322275_s_759180"), LocationDTO.class);
saveRecord(Table.TRIPS, TripDTO.create("111111", "1116"), TripDTO.class);
saveRecord(Table.TRIPS, TripDTO.create("pattern-id-123", "1116"), TripDTO.class);

String patternOne = "{\n" +
" \"id\":1,\n" +
" \"shape_id\":\"raxl\",\n" +
" \"pattern_id\":\"111111\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"route_id\":\"1116\",\n" +
" \"direction_id\":0,\n" +
" \"use_frequency\":1,\n" +
" \"name\":\"14 stops from Sandy Transit Operations Center to Timberline (7 trips)\",\n" +
" \"pattern_stops\":[\n" +
" {\n" +
" \"id\":\"23209670\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"2320967\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -337,6 +338,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591951\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759195\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -355,6 +357,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"135282\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"13528\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -373,6 +376,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"296733\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"29673\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -391,6 +395,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591804\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759180\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -409,6 +414,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591815\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759181\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -427,6 +433,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591826\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759182\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -445,6 +452,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591887\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759188\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -463,6 +471,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591838\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759183\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -481,6 +490,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591899\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759189\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -499,6 +509,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"232096911\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"2320969\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -517,6 +528,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"75919012\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759190\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -535,6 +547,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"232607913\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"2326079\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -553,6 +566,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"75919314\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759193\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -576,14 +590,15 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
String patternTwo = "{\n" +
" \"id\":1,\n" +
" \"shape_id\":\"raxl\",\n" +
" \"pattern_id\":\"111111\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"route_id\":\"1116\",\n" +
" \"direction_id\":0,\n" +
" \"use_frequency\":1,\n" +
" \"name\":\"14 stops from Sandy Transit Operations Center to Timberline (7 trips)\",\n" +
" \"pattern_stops\":[\n" +
" {\n" +
" \"id\":\"23209670\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"2320967\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -602,6 +617,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591951\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759195\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -620,6 +636,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"135282\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"13528\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -638,6 +655,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"296733\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"29673\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -656,6 +674,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591804\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759180\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -674,6 +693,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591815\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759181\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -692,6 +712,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591826\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759182\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -710,6 +731,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591887\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759188\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -728,6 +750,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591838\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759183\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -746,6 +769,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"7591899\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759189\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -763,6 +787,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" \"stop_headsign\":null\n" +
" },\n" +
" {\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"continuous_drop_off\":1,\n" +
" \"continuous_pickup\":1,\n" +
" \"default_dwell_time\":0,\n" +
Expand All @@ -782,6 +807,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"232096911\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"2320969\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -800,6 +826,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"75919012\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759190\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -818,6 +845,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"232607913\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"2326079\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand All @@ -836,6 +864,7 @@ void canCreateUpdateAndDeletePattern() throws IOException, SQLException, Invalid
" },\n" +
" {\n" +
" \"id\":\"75919314\",\n" +
" \"pattern_id\":\"pattern-id-123\",\n" +
" \"stop_id\":\"759193\",\n" +
" \"location_id\":null,\n" +
" \"location_group_id\":null,\n" +
Expand Down

0 comments on commit abd7b9d

Please sign in to comment.