@Test public void should_get_uri_correctly() { DataSiftConfig config = new DataSiftConfig(); config.baseURL = "http: config.sourceID = "SOURCEID"; config.port = 42; config.username = "USER"; config.apiKey = "APIKEY"; BulkManager b = new BulkManager(config, null, null, null); try { assertEquals("http: } catch (Exception e) { assertNull(e); } }
@VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI getUri() throws URISyntaxException { String baseURL = config.baseURL; if (!baseURL.endsWith("/")) { baseURL += "/"; } String url = baseURL + config.sourceID; URI uri = new URIBuilder(url).setPort(config.port).build(); if (uri == null) { String msg = "DataSift configuration base URL " + "and/or port syntax invalid"; log.error(msg); throw new URISyntaxException(url, msg, 0); } return uri; }
BulkManager implements Runnable { @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI getUri() throws URISyntaxException { String baseURL = config.baseURL; if (!baseURL.endsWith("/")) { baseURL += "/"; } String url = baseURL + config.sourceID; URI uri = new URIBuilder(url).setPort(config.port).build(); if (uri == null) { String msg = "DataSift configuration base URL " + "and/or port syntax invalid"; log.error(msg); throw new URISyntaxException(url, msg, 0); } return uri; } }
BulkManager implements Runnable { @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI getUri() throws URISyntaxException { String baseURL = config.baseURL; if (!baseURL.endsWith("/")) { baseURL += "/"; } String url = baseURL + config.sourceID; URI uri = new URIBuilder(url).setPort(config.port).build(); if (uri == null) { String msg = "DataSift configuration base URL " + "and/or port syntax invalid"; log.error(msg); throw new URISyntaxException(url, msg, 0); } return uri; } BulkManager(final DataSiftConfig config,
                       final SimpleConsumerManager simpleConsumerManager,
                       final Backoff backoff,
                       final Metrics metrics); }
BulkManager implements Runnable { @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI getUri() throws URISyntaxException { String baseURL = config.baseURL; if (!baseURL.endsWith("/")) { baseURL += "/"; } String url = baseURL + config.sourceID; URI uri = new URIBuilder(url).setPort(config.port).build(); if (uri == null) { String msg = "DataSift configuration base URL " + "and/or port syntax invalid"; log.error(msg); throw new URISyntaxException(url, msg, 0); } return uri; } BulkManager(final DataSiftConfig config,
                       final SimpleConsumerManager simpleConsumerManager,
                       final Backoff backoff,
                       final Metrics metrics); final void setLogger(final Logger logger); final void shutdown(); final void run(); @SuppressWarnings("checkstyle:designforextension") HttpResponse post(final String data); }
BulkManager implements Runnable { @VisibleForTesting @SuppressWarnings("checkstyle:designforextension") protected URI getUri() throws URISyntaxException { String baseURL = config.baseURL; if (!baseURL.endsWith("/")) { baseURL += "/"; } String url = baseURL + config.sourceID; URI uri = new URIBuilder(url).setPort(config.port).build(); if (uri == null) { String msg = "DataSift configuration base URL " + "and/or port syntax invalid"; log.error(msg); throw new URISyntaxException(url, msg, 0); } return uri; } BulkManager(final DataSiftConfig config,
                       final SimpleConsumerManager simpleConsumerManager,
                       final Backoff backoff,
                       final Metrics metrics); final void setLogger(final Logger logger); final void shutdown(); final void run(); @SuppressWarnings("checkstyle:designforextension") HttpResponse post(final String data);  }