code: @Override public MockResponse dispatch(RecordedRequest request) {
      HttpUrl requestUrl = mockWebServer.url(request.getPath());
      String code = requestUrl.queryParameter("code");
      String stateString = requestUrl.queryParameter("state");
      ByteString state = stateString != null ? ByteString.decodeBase64(stateString) : null;
  
      Listener listener;
      synchronized (this) {
        listener = listeners.get(state);
      }
  
      if (code == null || listener == null) {
        return new MockResponse()
            .setResponseCode(404)
            .setBody("unexpected request");
      }
  
      try {
        OAuthSession session = slackApi.exchangeCode(code, redirectUrl());
        listener.sessionGranted(session);
      } catch (IOException e) {
        return new MockResponse()
            .setResponseCode(400)
            .setBody("code exchange failed: " + e.getMessage());
      }
  
      synchronized (this) {
        listeners.remove(state);
      }
  
      // Success!
      return new MockResponse()
          .setResponseCode(302)
          .addHeader("Location", "https://twitter.com/CuteEmergency/status/789457462864863232");
    }
docs: When the browser hits the redirect URL, use the provided code to ask Slack for a session.