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

Updating route_id updates AgencyAndId object and not the route's id. #148

Open
romainguefveneu opened this issue Jun 27, 2020 · 0 comments

Comments

@romainguefveneu
Copy link

Summary:

Updating route_id updates AgencyAndId object and not the route's id, leading to have the agency code postfixed to the new route id.

Steps to reproduce:

  @Test
  public void testUpdateRouteId() throws Exception {
    _factory.addModificationsFromString("{'op':'update', "
            + "'match':{'file':'routes.txt'}, "
            + "'update':{'route_id':'s/r/route/'}}");

    GtfsTransformStrategy transform = _transformer.getLastTransform();
    TransformContext context = new TransformContext();
    GtfsMutableRelationalDao dao = new GtfsRelationalDaoImpl();

    Route route = new Route();
    route.setId(new AgencyAndId("a0", "r0"));
    dao.saveEntity(route);

    transform.run(context, dao);

    assertEquals("route0", route.getId().getId());
  }

Expected behavior:

It should transforms r0 into route0

Observed behavior:

It transforms r0 into a0_route0

Platform:

macOS 10.15.5
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
onebusaway-gtfs-modules 1.3.89-SNAPSHOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant