@Override
  public Mono<GetTurnCredentialsResponse> getTurnCredentials(final GetTurnCredentialsRequest request) {
    final AuthenticatedDevice authenticatedDevice = AuthenticationUtil.requireAuthenticatedDevice();

    return rateLimiters.getTurnLimiter().validateReactive(authenticatedDevice.accountIdentifier())
        .then(Mono.fromSupplier(() -> turnTokenGenerator.generate(authenticatedDevice.accountIdentifier())))
        .map(turnToken -> GetTurnCredentialsResponse.newBuilder()
            .setUsername(turnToken.username())
            .setPassword(turnToken.password())
            .addAllUrls(turnToken.urls())
            .build());
  }
@Test
  void getTurnCredentials() {
    final String username = "test-username";
    final String password = "test-password";
    final List<String> urls = List.of("first", "second");
    final String hostname = "hostname";

    MockUtils.updateRateLimiterResponseToAllow(turnCredentialRateLimiter, AUTHENTICATED_ACI);
    when(turnTokenGenerator.generate(any())).thenReturn(new TurnToken(username, password, urls, null, hostname));

    final GetTurnCredentialsResponse response = authenticatedServiceStub().getTurnCredentials(GetTurnCredentialsRequest.newBuilder().build());

    final GetTurnCredentialsResponse expectedResponse = GetTurnCredentialsResponse.newBuilder()
        .setUsername(username)
        .setPassword(password)
        .addAllUrls(urls)
        .build();

    assertEquals(expectedResponse, response);
  }