@Test public void testCallDiscoverAPIForSandbox() throws ConnectionException { DiscoveryAPIResponse discoveryAPIResponse = new DiscoveryAPIClient(null).callDiscoveryAPI(Environment.SANDBOX); assertNotNull(discoveryAPIResponse); assertEquals("https: }
public DiscoveryAPIResponse callDiscoveryAPI(Environment environment) throws ConnectionException { logger.debug("Enter DiscoveryAPIClient::callDiscoveryAPI"); try { HttpRequestClient client = new HttpRequestClient(proxyConfig); Request request = new Request.RequestBuilder(MethodType.GET, getDiscoveryAPIHost(environment)) .requiresAuthentication(false) .build(); Response response = client.makeRequest(request); logger.debug("Response Code : " + response.getStatusCode()); logger.debug("intuit_tid : "+ response.getIntuit_tid()); if (response.getStatusCode() == 200) { ObjectReader reader = mapper.readerFor(DiscoveryAPIResponse.class); DiscoveryAPIResponse discoveryAPIResponse = reader.readValue(response.getContent()); discoveryAPIResponse.setIntuit_tid(response.getIntuit_tid()); return discoveryAPIResponse; } else { logger.debug("failed calling discovery document API"); logger.debug("Response content: " + response.getContent()); throw new ConnectionException("Failed calling discovery document API", response.getStatusCode() + "", response.getIntuit_tid(), response); } } catch (ConnectionException ex) { logger.error("ConnectionException while calling discovery document " + ex.getResponseContent() + ex.getResponseContent(), ex); throw new ConnectionException("Failed calling discovery document API", ex.getStatusCode() + "", ex.getIntuit_tid(), ex.getResponse()); } catch (Exception ex) { logger.error("Exception while calling discovery document", ex); throw new ConnectionException(ex.getMessage(), ex); } }
DiscoveryAPIClient { public DiscoveryAPIResponse callDiscoveryAPI(Environment environment) throws ConnectionException { logger.debug("Enter DiscoveryAPIClient::callDiscoveryAPI"); try { HttpRequestClient client = new HttpRequestClient(proxyConfig); Request request = new Request.RequestBuilder(MethodType.GET, getDiscoveryAPIHost(environment)) .requiresAuthentication(false) .build(); Response response = client.makeRequest(request); logger.debug("Response Code : " + response.getStatusCode()); logger.debug("intuit_tid : "+ response.getIntuit_tid()); if (response.getStatusCode() == 200) { ObjectReader reader = mapper.readerFor(DiscoveryAPIResponse.class); DiscoveryAPIResponse discoveryAPIResponse = reader.readValue(response.getContent()); discoveryAPIResponse.setIntuit_tid(response.getIntuit_tid()); return discoveryAPIResponse; } else { logger.debug("failed calling discovery document API"); logger.debug("Response content: " + response.getContent()); throw new ConnectionException("Failed calling discovery document API", response.getStatusCode() + "", response.getIntuit_tid(), response); } } catch (ConnectionException ex) { logger.error("ConnectionException while calling discovery document " + ex.getResponseContent() + ex.getResponseContent(), ex); throw new ConnectionException("Failed calling discovery document API", ex.getStatusCode() + "", ex.getIntuit_tid(), ex.getResponse()); } catch (Exception ex) { logger.error("Exception while calling discovery document", ex); throw new ConnectionException(ex.getMessage(), ex); } } }
DiscoveryAPIClient { public DiscoveryAPIResponse callDiscoveryAPI(Environment environment) throws ConnectionException { logger.debug("Enter DiscoveryAPIClient::callDiscoveryAPI"); try { HttpRequestClient client = new HttpRequestClient(proxyConfig); Request request = new Request.RequestBuilder(MethodType.GET, getDiscoveryAPIHost(environment)) .requiresAuthentication(false) .build(); Response response = client.makeRequest(request); logger.debug("Response Code : " + response.getStatusCode()); logger.debug("intuit_tid : "+ response.getIntuit_tid()); if (response.getStatusCode() == 200) { ObjectReader reader = mapper.readerFor(DiscoveryAPIResponse.class); DiscoveryAPIResponse discoveryAPIResponse = reader.readValue(response.getContent()); discoveryAPIResponse.setIntuit_tid(response.getIntuit_tid()); return discoveryAPIResponse; } else { logger.debug("failed calling discovery document API"); logger.debug("Response content: " + response.getContent()); throw new ConnectionException("Failed calling discovery document API", response.getStatusCode() + "", response.getIntuit_tid(), response); } } catch (ConnectionException ex) { logger.error("ConnectionException while calling discovery document " + ex.getResponseContent() + ex.getResponseContent(), ex); throw new ConnectionException("Failed calling discovery document API", ex.getStatusCode() + "", ex.getIntuit_tid(), ex.getResponse()); } catch (Exception ex) { logger.error("Exception while calling discovery document", ex); throw new ConnectionException(ex.getMessage(), ex); } } DiscoveryAPIClient(ProxyConfig proxyConfig);  DiscoveryAPIClient(); }
DiscoveryAPIClient { public DiscoveryAPIResponse callDiscoveryAPI(Environment environment) throws ConnectionException { logger.debug("Enter DiscoveryAPIClient::callDiscoveryAPI"); try { HttpRequestClient client = new HttpRequestClient(proxyConfig); Request request = new Request.RequestBuilder(MethodType.GET, getDiscoveryAPIHost(environment)) .requiresAuthentication(false) .build(); Response response = client.makeRequest(request); logger.debug("Response Code : " + response.getStatusCode()); logger.debug("intuit_tid : "+ response.getIntuit_tid()); if (response.getStatusCode() == 200) { ObjectReader reader = mapper.readerFor(DiscoveryAPIResponse.class); DiscoveryAPIResponse discoveryAPIResponse = reader.readValue(response.getContent()); discoveryAPIResponse.setIntuit_tid(response.getIntuit_tid()); return discoveryAPIResponse; } else { logger.debug("failed calling discovery document API"); logger.debug("Response content: " + response.getContent()); throw new ConnectionException("Failed calling discovery document API", response.getStatusCode() + "", response.getIntuit_tid(), response); } } catch (ConnectionException ex) { logger.error("ConnectionException while calling discovery document " + ex.getResponseContent() + ex.getResponseContent(), ex); throw new ConnectionException("Failed calling discovery document API", ex.getStatusCode() + "", ex.getIntuit_tid(), ex.getResponse()); } catch (Exception ex) { logger.error("Exception while calling discovery document", ex); throw new ConnectionException(ex.getMessage(), ex); } } DiscoveryAPIClient(ProxyConfig proxyConfig);  DiscoveryAPIClient(); DiscoveryAPIResponse callDiscoveryAPI(Environment environment); DiscoveryAPIResponse callDiscoveryAPI(String discoveryEndpoint); }
DiscoveryAPIClient { public DiscoveryAPIResponse callDiscoveryAPI(Environment environment) throws ConnectionException { logger.debug("Enter DiscoveryAPIClient::callDiscoveryAPI"); try { HttpRequestClient client = new HttpRequestClient(proxyConfig); Request request = new Request.RequestBuilder(MethodType.GET, getDiscoveryAPIHost(environment)) .requiresAuthentication(false) .build(); Response response = client.makeRequest(request); logger.debug("Response Code : " + response.getStatusCode()); logger.debug("intuit_tid : "+ response.getIntuit_tid()); if (response.getStatusCode() == 200) { ObjectReader reader = mapper.readerFor(DiscoveryAPIResponse.class); DiscoveryAPIResponse discoveryAPIResponse = reader.readValue(response.getContent()); discoveryAPIResponse.setIntuit_tid(response.getIntuit_tid()); return discoveryAPIResponse; } else { logger.debug("failed calling discovery document API"); logger.debug("Response content: " + response.getContent()); throw new ConnectionException("Failed calling discovery document API", response.getStatusCode() + "", response.getIntuit_tid(), response); } } catch (ConnectionException ex) { logger.error("ConnectionException while calling discovery document " + ex.getResponseContent() + ex.getResponseContent(), ex); throw new ConnectionException("Failed calling discovery document API", ex.getStatusCode() + "", ex.getIntuit_tid(), ex.getResponse()); } catch (Exception ex) { logger.error("Exception while calling discovery document", ex); throw new ConnectionException(ex.getMessage(), ex); } } DiscoveryAPIClient(ProxyConfig proxyConfig);  DiscoveryAPIClient(); DiscoveryAPIResponse callDiscoveryAPI(Environment environment); DiscoveryAPIResponse callDiscoveryAPI(String discoveryEndpoint);  }