BlueRunChangesetPreloader extends RESTFetchPreloader { @Override protected FetchData getFetchData(@Nonnull BlueUrlTokenizer blueUrl) { if (!blueUrl.lastPartIs(BlueUrlTokenizer.UrlPart.PIPELINE_RUN_DETAIL_TAB, "changes")) { return null; } BluePipeline pipeline = getPipeline(blueUrl); if (pipeline == null) { return null; } Container<BlueRun> activitiesContainer = pipeline.getRuns(); if(activitiesContainer==null){ return null; } BlueRun run = activitiesContainer.get(blueUrl.getPart(BlueUrlTokenizer.UrlPart.PIPELINE_RUN_DETAIL_ID)); Container<BlueChangeSetEntry> containerChangeSets = run.getChangeSet(); return getFetchData(containerChangeSets); }  FetchData getFetchData(Container<BlueChangeSetEntry> containerChangeSets);  }
@Test public void prefetchUrlIsRight() throws IOException, ExecutionException, InterruptedException { FreeStyleProject project = j.createFreeStyleProject("project"); Run run = j.waitForCompletion(project.scheduleBuild2(0).waitForStart()); FreeStylePipeline freeStylePipeline = (FreeStylePipeline) BluePipelineFactory.resolve(project); assertNotNull(freeStylePipeline); BlueRun blueRun = freeStylePipeline.getLatestRun(); assertNotNull(blueRun); BlueOrganization organization = OrganizationFactory.getInstance().getContainingOrg(Jenkins.getInstance()); ChangeSetContainerImpl container = new ChangeSetContainerImpl( organization, blueRun, run ); BlueRunChangesetPreloader preloader = new BlueRunChangesetPreloader(); RESTFetchPreloader.FetchData fetchData = preloader.getFetchData(container); assertEquals("/blue/rest/organizations/jenkins/pipelines/project/runs/1/changeSet/?start=0&limit=101", fetchData.getRestUrl()); }