title: Not able to mock HTTPResponse in mokito
body: <p>I have to write unit test for this method using mokito, I am facing error while stubbing data</p>
  <pre><code>{        @Mock
           private HttpUtil httpUtil = new HttpUtil();
           private HttpResponse httpResponse = mock(HttpResponse.class);
      {
         when(httpUtil.getRequest(url,&quot;access_token&quot;,                                          
        ContentType.APPLICATION_JSON.toString())).thenReturn(httpResponse);
      }
  
   }
  </code></pre>
  <p>method:</p>
  <pre><code>public List&lt;UGD&gt; getUGD(String ugName, String accessToken) throws IOException,
              InvalidInputException {
          String url = ekauserapiServiceBaseUrl + &quot;uG?gName=&quot; + gName;
          HttpResponse resp = httpUtil.getRequest(url, accessToken,
                  ContentType.APPLICATION_JSON.toString());
          if (resp.getStatusLine().getStatusCode() == 200) {
              return Arrays.asList(mapper.readValue(resp.getEntity().getContent(),
                      UGD[].class));
          }
          throw new NotFoundException(&quot;not found&quot;);
      }
  </code></pre>
  <pre><code>Error : java.lang.LinkageError: loader constraint violation: loader (instance of org/powermock/core/classloader/MockClassLoader) previously initiated loading for a different type with name &quot;javax/security/auth/x500/X500Principal&quot;
  
  java.lang.LinkageError: loader constraint violation: loader (instance of org/powermock/core/classloader/MockClassLoader) previously initiated loading for a different type with name &quot;javax/security/auth/x500/X500Principal&quot;
  
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
      at org.powermock.core.classloader.MockClassLoader.loadUnmockedClass(MockClassLoader.java:262)
      at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:206)
      at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass1(DeferSupportingClassLoader.java:89)
      at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:79)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:435)
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:397)
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
      at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
      at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
      at com.ekahau.client.HttpUtil.getRequest(HttpUtil.java:75)
  </code></pre>
  <p>Just want to know what I am doing wrong here ,suggestions are welcome! TIA</p>