public void validateAppPassword(String encodedCredentials, String workspace) {
    try {
      doGetWithBasicAuth(encodedCredentials, buildUrl("/repositories/" + workspace), r -> null);
    } catch (NotFoundException | IllegalStateException e) {
      throw new IllegalArgumentException(e.getMessage());
    }
  }
@Test
  public void validate_app_password_success() throws Exception {
    String reposResponse = "{\"pagelen\": 10,\n" +
      "\"values\": [],\n" +
      "\"page\": 1,\n" +
      "\"size\": 0\n" +
      "}";

    server.enqueue(new MockResponse().setBody(reposResponse));
    server.enqueue(new MockResponse().setBody("OK"));

    underTest.validateAppPassword("user:password", "workspace");

    RecordedRequest request = server.takeRequest();
    assertThat(request.getPath()).isEqualTo("/2.0/repositories/workspace");
    assertThat(request.getHeader("Authorization")).isNotNull();
  }