16
16
import org .opentripplanner .graph_builder .issue .api .DataImportIssueStore ;
17
17
import org .opentripplanner .transit .model ._data .TimetableRepositoryForTest ;
18
18
import org .opentripplanner .transit .model .basic .TransitMode ;
19
+ import org .opentripplanner .transit .model .framework .AbstractTransitEntity ;
20
+ import org .opentripplanner .transit .model .framework .FeedScopedId ;
19
21
import org .opentripplanner .transit .model .network .BikeAccess ;
20
22
import org .opentripplanner .transit .model .organization .Branding ;
21
23
22
- public class RouteMapperTest {
24
+ class RouteMapperTest {
25
+
26
+ private static final String FEED_ID = "A" ;
23
27
24
28
private static final Agency AGENCY = new GtfsTestData ().agency ;
25
29
26
- private static final AgencyAndId ROUTE_ID = new AgencyAndId ("A" , "1" );
30
+ private static final AgencyAndId ROUTE_ID = new AgencyAndId (FEED_ID , "1" );
27
31
28
32
private static final String SHORT_NAME = "Short Name" ;
29
33
@@ -48,7 +52,7 @@ public class RouteMapperTest {
48
52
private static final Integer SORT_ORDER = 1 ;
49
53
50
54
private static final Route ROUTE = new Route ();
51
- private static final IdFactory ID_FACTORY = new IdFactory ("A" );
55
+ private static final IdFactory ID_FACTORY = new IdFactory (FEED_ID );
52
56
private final RouteMapper subject = new RouteMapper (
53
57
ID_FACTORY ,
54
58
new AgencyMapper (ID_FACTORY ),
@@ -71,14 +75,14 @@ public class RouteMapperTest {
71
75
}
72
76
73
77
@ Test
74
- public void testMapCollection () throws Exception {
78
+ void testMapCollection () throws Exception {
75
79
assertNull (subject .map ((Collection <Route >) null ));
76
80
assertTrue (subject .map (Collections .emptyList ()).isEmpty ());
77
81
assertEquals (1 , subject .map (Collections .singleton (ROUTE )).size ());
78
82
}
79
83
80
84
@ Test
81
- public void testMap () throws Exception {
85
+ void testMap () throws Exception {
82
86
org .opentripplanner .transit .model .network .Route result = subject .map (ROUTE );
83
87
84
88
assertEquals ("A:1" , result .getId ().toString ());
@@ -100,7 +104,7 @@ public void testMap() throws Exception {
100
104
}
101
105
102
106
@ Test
103
- public void testMapWithNulls () throws Exception {
107
+ void testMapWithNulls () throws Exception {
104
108
Route input = new Route ();
105
109
106
110
// id, agency, mode and name (short or long) is required.
@@ -129,7 +133,7 @@ public void testMapWithNulls() throws Exception {
129
133
}
130
134
131
135
@ Test
132
- public void mapNetworkId () {
136
+ void mapNetworkId () {
133
137
Route input = new Route ();
134
138
135
139
input .setId (ROUTE_ID );
@@ -141,8 +145,8 @@ public void mapNetworkId() {
141
145
org .opentripplanner .transit .model .network .Route result = subject .map (input );
142
146
143
147
assertEquals (
144
- List .of (NETWORK_ID ),
145
- result .getGroupsOfRoutes ().stream ().map (g -> g . getId (). getId () ).toList ()
148
+ List .of (new FeedScopedId ( FEED_ID , NETWORK_ID ) ),
149
+ result .getGroupsOfRoutes ().stream ().map (AbstractTransitEntity :: getId ).toList ()
146
150
);
147
151
}
148
152
@@ -164,7 +168,7 @@ void carpool() {
164
168
* Mapping the same object twice, should return the same instance.
165
169
*/
166
170
@ Test
167
- public void testMapCache () throws Exception {
171
+ void testMapCache () throws Exception {
168
172
org .opentripplanner .transit .model .network .Route result1 = subject .map (ROUTE );
169
173
org .opentripplanner .transit .model .network .Route result2 = subject .map (ROUTE );
170
174
0 commit comments