title: How to Mock Request Headers in Java
body: <p>This is the sample code of what I have written</p>
  
  <pre><code>    String bearerToken="Bearer "+ token; 
      HttpClient client = HttpClientBuilder.create().build(); 
      request.addHeader("Authorization",bearerToken); 
      request.addHeader("cache-control", "no-cache"); 
      HttpResponse response=client.execute(request); 
      System.out.println("Response Code:" + response.getStatusLine().getStatusCode());
  </code></pre>
  
  <p>How can I mock these request headers in java? How do I mock Authorization and response?.</p>