@Override
  public void preAction(WebService.Action action, Request request) {
    Level logLevel = getLogLevel();

    String deprecatedSinceEndpoint = action.deprecatedSince();
    if (deprecatedSinceEndpoint != null) {
      logWebServiceMessage(logLevel, deprecatedSinceEndpoint);
    }

    action.params().forEach(param -> logParamMessage(request, logLevel, param));
  }
@Test
  @UseDataProvider("userSessions")
  public void preAction_whenParameterIsDeprecatedAndHasReplacementAndBrowserSession_shouldLogWarning(boolean isLoggedIn, boolean isAuthenticatedBrowserSession, Level expectedLogLevel) {
    when(userSession.hasSession()).thenReturn(true);
    when(userSession.isLoggedIn()).thenReturn(isLoggedIn);
    when(userSession.isAuthenticatedBrowserSession()).thenReturn(isAuthenticatedBrowserSession);

    WebService.Action action = mock(WebService.Action.class);
    when(action.path()).thenReturn("api/issues/search");
    when(action.deprecatedSince()).thenReturn(null);

    WebService.Param mockParam = mock(WebService.Param.class);
    when(mockParam.deprecatedKeySince()).thenReturn("9.6");
    when(mockParam.deprecatedKey()).thenReturn("sansTop25");
    when(mockParam.key()).thenReturn("sansTop25New");
    when(action.params()).thenReturn(List.of(mockParam));
    when(action.param("sansTop25")).thenReturn(mockParam);

    Request request = mock(Request.class);
    Request.StringParam stringParam = mock(Request.StringParam.class);
    when(stringParam.isPresent()).thenReturn(true);
    when(request.hasParam("sansTop25")).thenReturn(true);
    when(request.getParams()).thenReturn(Map.of("sansTop25", new String[]{}));

    underTest.preAction(action, request);

    assertThat(logTester.logs(expectedLogLevel))
      .contains("Parameter 'sansTop25' is deprecated since 9.6 and will be removed in a future version.");
  }