@GET
  @Path("/callback")
  @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
  public Response callback(
      @CookieParam("session_id") String sessionId, @QueryParam("code") String code) {

    var redirect = authService.callback(new CallbackRequest(sessionId, code));
    return Response.seeOther(redirect).build();
  }
@Test
  void callback_success_passParams() {

    var callbackRedirect = URI.create("https://app.example.com/success");
    var authService = mock(AuthService.class);
    when(authService.callback(any())).thenReturn(callbackRedirect);
    var sut = new AuthEndpoint(authService);

    var code = "myCode";
    var sessionId = IdGenerator.generateID();

    // when
    try (var res = sut.callback(sessionId, code)) {

      var captor = ArgumentCaptor.forClass(CallbackRequest.class);
      verify(authService).callback(captor.capture());

      var req = captor.getValue();
      assertEquals(code, req.code());
      assertEquals(sessionId, req.sessionId());
    }
  }