public void setIssueComponent(DefaultIssue issue, String newComponentUuid, String newComponentKey, Date updateDate) {
    if (!Objects.equals(newComponentUuid, issue.componentUuid())) {
      issue.setComponentUuid(newComponentUuid);
      issue.setUpdateDate(updateDate);
      issue.setChanged(true);
    }

    // other fields (such as module, modulePath, componentKey) are read-only and set/reset for consistency only
    issue.setComponentKey(newComponentKey);
  }
@Test
  void setIssueComponent_has_no_effect_if_component_uuid_is_not_changed() {
    String componentKey = "key";
    String componentUuid = "uuid";

    issue.setComponentUuid(componentUuid);
    issue.setComponentKey(componentKey);

    underTest.setIssueComponent(issue, componentUuid, componentKey, context.date());

    assertThat(issue.componentUuid()).isEqualTo(componentUuid);
    assertThat(issue.componentKey()).isEqualTo(componentKey);
    assertThat(issue.isChanged()).isFalse();
    assertThat(issue.updateDate()).isNull();
    assertThat(issue.mustSendNotifications()).isFalse();
  }