@Override
  public boolean isValid(Request request) {
    if (configuredPasscode == null) {
      return false;
    }
    return isValidPasscode(request.header(PASSCODE_HTTP_HEADER).orElse(null));
  }
@Test
  @UseDataProvider("passcodeConfigurationAndUserInput")
  public void isValid_worksCorrectly(String configuredPasscode, String userPasscode, boolean expectedResult) {
    configurePasscode(configuredPasscode);

    SimpleGetRequest request = new SimpleGetRequest();
    request.setHeader("X-Sonar-Passcode", userPasscode);

    assertThat(underTest.isValid(request)).isEqualTo(expectedResult);
  }