@Override public void accept(DefaultIssue issue, ScmInfo scmInfo) { Builder locations = DbIssues.Locations.newBuilder() .setTextRange(range(2, 3)) .addFlow(newFlow(newLocation(4, 5))) .addFlow(newFlow(newLocation(6, 7, COMPONENT_UUID), newLocation(8, 9, COMPONENT_UUID))); when(issue.getLocations()).thenReturn(locations.build()); setDateOfChangetsetAtLine(scmInfo, 2, 1200L); setDateOfChangetsetAtLine(scmInfo, 3, 1300L); setDateOfChangetsetAtLine(scmInfo, 4, 1400L); setDateOfChangetsetAtLine(scmInfo, 5, 1500L); // some lines missing should be ok setDateOfChangetsetAtLine(scmInfo, 9, 1900L); } }
@Override public void accept(DefaultIssue issue, ScmInfo scmInfo) { Builder locations = DbIssues.Locations.newBuilder() .setTextRange(range(2, 3)) .addFlow(newFlow(newLocation(4, 5))) .addFlow(newFlow(newLocation(6, 7, COMPONENT_UUID), newLocation(8, 9, "another"))); when(issue.getLocations()).thenReturn(locations.build()); setDateOfChangetsetAtLine(scmInfo, 2, 1200L); setDateOfChangetsetAtLine(scmInfo, 3, 1300L); setDateOfChangetsetAtLine(scmInfo, 4, 1400L); setDateOfChangetsetAtLine(scmInfo, 5, 1500L); setDateOfChangetsetAtLine(scmInfo, 6, 1600L); setDateOfChangetsetAtLine(scmInfo, 7, 1700L); setDateOfChangetsetAtLine(scmInfo, 8, 1800L); setDateOfChangetsetAtLine(scmInfo, 9, 1900L); } }
private static DefaultIssue newIssueOnLines(int... lines) { DefaultIssue issue = new DefaultIssue(); issue.setComponentUuid(FILE.getUuid()); DbIssues.Locations.Builder locations = DbIssues.Locations.newBuilder(); DbIssues.Flow.Builder flow = DbIssues.Flow.newBuilder(); Arrays.stream(lines).forEach(line -> flow.addLocation(newLocation(line))); locations.addFlow(flow.build()); issue.setLocations(locations.build()); return issue; }
convertLocation(location).ifPresent(dbFlowBuilder::addLocation); dbLocationsBuilder.addFlow(dbFlowBuilder);
convertLocation(location).ifPresent(dbFlowBuilder::addLocation); dbLocationsBuilder.addFlow(dbFlowBuilder);
ComponentDto file = db.components().insertComponent(newFileDto(project)); ComponentDto anotherFile = db.components().insertComponent(newFileDto(project)); DbIssues.Locations.Builder locations = DbIssues.Locations.newBuilder().addFlow(DbIssues.Flow.newBuilder().addAllLocation(Arrays.asList( DbIssues.Location.newBuilder() .setComponentId(file.uuid())
convertLocation(location).ifPresent(dbFlowBuilder::addLocation); dbLocationsBuilder.addFlow(dbFlowBuilder);
convertLocation(location).ifPresent(dbFlowBuilder::addLocation); dbLocationsBuilder.addFlow(dbFlowBuilder);