MetricDto metric = metricsById.get(measure.getMetricId());
measuresByMetric.put(metric, measure);
}
- Map<Long, String> referenceComponentUuidById = new HashMap<>();
+ Map<Long, ComponentDto> referenceComponentUuidById = new HashMap<>();
if (refComponent.isPresent()) {
- referenceComponentUuidById.put(refComponent.get().getId(), refComponent.get().uuid());
+ referenceComponentUuidById.put(refComponent.get().getId(), refComponent.get());
}
response.setComponent(componentDtoToWsComponent(component, measuresByMetric, referenceComponentUuidById));
@Test
public void reference_uuid_in_the_response() {
- ComponentDto project = newProjectDto("project-uuid");
+ ComponentDto project = newProjectDto("project-uuid").setKey("project-key");
ComponentDto view = newView("view-uuid");
componentDb.insertViewAndSnapshot(view);
componentDb.insertProjectAndSnapshot(project);
assertThat(response.getComponent().getId()).isEqualTo("project-uuid-copy");
assertThat(response.getComponent().getRefId()).isEqualTo("project-uuid");
+ assertThat(response.getComponent().getRefKey()).isEqualTo("project-key");
}
@Test