public void checkIfComponentNeedIssueSync(DbSession dbSession, String componentKey) {
    checkIfAnyComponentsNeedIssueSync(dbSession, Collections.singletonList(componentKey));
  }
@Test
  public void checkIfComponentNeedIssueSync_single_component() {
    ProjectData projectData1 = insertProjectWithBranches(true, 0);
    ProjectData projectData2 = insertProjectWithBranches(false, 0);

    DbSession session = db.getSession();
    // do nothing when need issue sync false
    underTest.checkIfComponentNeedIssueSync(session, projectData2.getProjectDto().getKey());

    // throws if flag set to TRUE
    String key = projectData1.getProjectDto().getKey();
    assertThatThrownBy(() -> underTest.checkIfComponentNeedIssueSync(session, key))
      .isInstanceOf(EsIndexSyncInProgressException.class)
      .hasFieldOrPropertyWithValue("httpCode", 503)
      .hasMessage("Results are temporarily unavailable. Indexing of issues is in progress.");
  }