public void validate(AlmSettingDto dto) {
    try {
      azureDevOpsHttpClient.checkPAT(requireNonNull(dto.getUrl()),
        requireNonNull(dto.getDecryptedPersonalAccessToken(settings.getEncryption())));
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException("Invalid Azure URL or Personal Access Token", e);
    }
  }
@Test
  public void validate_givenHttpClientThrowingException_throwException() {
    AlmSettingDto dto = createMockDto();

    doThrow(new IllegalArgumentException()).when(azureDevOpsHttpClient).checkPAT(any(), any());

    assertThatExceptionOfType(IllegalArgumentException.class)
      .isThrownBy(() -> underTest.validate(dto))
      .withMessage("Invalid Azure URL or Personal Access Token");

  }