private static DopSettingsResource toDopSettingsResource(AlmSettingDto almSettingDto) {
    return new DopSettingsResource(
      almSettingDto.getUuid(),
      toResponseAlm(almSettingDto.getAlm()).name(),
      almSettingDto.getKey(),
      almSettingDto.getUrl(),
      almSettingDto.getAppId());
  }
@Test
  void fetchAllDopSettings_whenDbClientReturnsData_returnsResponse() throws Exception {
    AlmSettingDto almSettingDto1 = generateAlmSettingsDto("github");
    AlmSettingDto almSettingDto2 = generateAlmSettingsDto("azure_devops");
    AlmSettingDto almSettingDto3 = generateAlmSettingsDto("bitbucket_cloud");
    List<AlmSettingDto> dopSettings = List.of(
      almSettingDto1,
      almSettingDto2,
      almSettingDto3
    );
    when(dbClient.almSettingDao().selectAll(dbSession)).thenReturn(dopSettings);

    userSession.logIn().addPermission(PROVISION_PROJECTS);;
    MvcResult mvcResult = mockMvc
      .perform(get(DOP_SETTINGS_ENDPOINT))
      .andExpect(status().isOk())
      .andReturn();
    DopSettingsRestResponse response = gson.fromJson(mvcResult.getResponse().getContentAsString(), DopSettingsRestResponse.class);

    List<DopSettingsResource> expectedDopSettings = List.of(
      toDopSettingsResource(almSettingDto1, "github"),
      toDopSettingsResource(almSettingDto2, "azure"),
      toDopSettingsResource(almSettingDto3, "bitbucketcloud")
    );

    assertThat(response.dopSettings())
      .containsExactlyInAnyOrderElementsOf(expectedDopSettings);
  }