boolean fillIssueInFileLocation(NewIssueLocation newIssueLocation, Location location) {
    PhysicalLocation physicalLocation = location.getPhysicalLocation();

    String fileUri = getFileUriOrThrow(location);
    Optional<InputFile> file = findFile(fileUri);
    if (file.isEmpty()) {
      return false;
    }
    InputFile inputFile = file.get();
    newIssueLocation.on(inputFile);
    regionMapper.mapRegion(physicalLocation.getRegion(), inputFile).ifPresent(newIssueLocation::at);
    return true;
  }
@Test
  public void fillIssueInFileLocation_ifNullArtifactLocation_throws() {
    when(location.getPhysicalLocation().getArtifactLocation()).thenReturn(null);

    assertThatIllegalArgumentException()
      .isThrownBy(() -> locationMapper.fillIssueInFileLocation(newIssueLocation, location))
      .withMessage(EXPECTED_MESSAGE_URI_MISSING);
  }