@Test(expected = DetectorException.class) public void testFindUpdatedDetectorDocuments_cantGet() { clientUnderTest.findUpdatedDetectorDocuments(TIME_PERIOD_CANT_GET); }
public List<DetectorDocument> findUpdatedDetectorDocuments(long timeInSecs) { isTrue(timeInSecs > 0, "sinceSeconds must be strictly positive"); val uri = String.format(baseUri + FIND_UPDATED_DOCUMENTS_PATH, timeInSecs); Content content; try { content = httpClient.get(uri); } catch (IOException e) { val message = "IOException while getting last updated detectors" + ": sinceSeconds=" + timeInSecs + ", httpMethod=GET" + ", uri=" + uri; throw new DetectorException(message, e); } try { return Arrays.asList(objectMapper.readValue(content.asBytes(), DetectorDocument[].class)); } catch (IOException e) { val message = "IOException while reading detectors: sinceSeconds=" + timeInSecs; throw new DetectorException(message, e); } }
DetectorClient { public List<DetectorDocument> findUpdatedDetectorDocuments(long timeInSecs) { isTrue(timeInSecs > 0, "sinceSeconds must be strictly positive"); val uri = String.format(baseUri + FIND_UPDATED_DOCUMENTS_PATH, timeInSecs); Content content; try { content = httpClient.get(uri); } catch (IOException e) { val message = "IOException while getting last updated detectors" + ": sinceSeconds=" + timeInSecs + ", httpMethod=GET" + ", uri=" + uri; throw new DetectorException(message, e); } try { return Arrays.asList(objectMapper.readValue(content.asBytes(), DetectorDocument[].class)); } catch (IOException e) { val message = "IOException while reading detectors: sinceSeconds=" + timeInSecs; throw new DetectorException(message, e); } } }
DetectorClient { public List<DetectorDocument> findUpdatedDetectorDocuments(long timeInSecs) { isTrue(timeInSecs > 0, "sinceSeconds must be strictly positive"); val uri = String.format(baseUri + FIND_UPDATED_DOCUMENTS_PATH, timeInSecs); Content content; try { content = httpClient.get(uri); } catch (IOException e) { val message = "IOException while getting last updated detectors" + ": sinceSeconds=" + timeInSecs + ", httpMethod=GET" + ", uri=" + uri; throw new DetectorException(message, e); } try { return Arrays.asList(objectMapper.readValue(content.asBytes(), DetectorDocument[].class)); } catch (IOException e) { val message = "IOException while reading detectors: sinceSeconds=" + timeInSecs; throw new DetectorException(message, e); } }  }
DetectorClient { public List<DetectorDocument> findUpdatedDetectorDocuments(long timeInSecs) { isTrue(timeInSecs > 0, "sinceSeconds must be strictly positive"); val uri = String.format(baseUri + FIND_UPDATED_DOCUMENTS_PATH, timeInSecs); Content content; try { content = httpClient.get(uri); } catch (IOException e) { val message = "IOException while getting last updated detectors" + ": sinceSeconds=" + timeInSecs + ", httpMethod=GET" + ", uri=" + uri; throw new DetectorException(message, e); } try { return Arrays.asList(objectMapper.readValue(content.asBytes(), DetectorDocument[].class)); } catch (IOException e) { val message = "IOException while reading detectors: sinceSeconds=" + timeInSecs; throw new DetectorException(message, e); } }  DetectorDocument findDetectorDocument(UUID uuid); List<DetectorDocument> findUpdatedDetectorDocuments(long timeInSecs); void updatedDetectorLastUsed(UUID uuid); DetectorMatchResponse findMatchingDetectorMappings(List<Map<String, String>> tagsList); List<DetectorMapping> findUpdatedDetectorMappings(long timeInSecs); DetectorMapping findDetectorMappingByUuid(UUID uuid); }
DetectorClient { public List<DetectorDocument> findUpdatedDetectorDocuments(long timeInSecs) { isTrue(timeInSecs > 0, "sinceSeconds must be strictly positive"); val uri = String.format(baseUri + FIND_UPDATED_DOCUMENTS_PATH, timeInSecs); Content content; try { content = httpClient.get(uri); } catch (IOException e) { val message = "IOException while getting last updated detectors" + ": sinceSeconds=" + timeInSecs + ", httpMethod=GET" + ", uri=" + uri; throw new DetectorException(message, e); } try { return Arrays.asList(objectMapper.readValue(content.asBytes(), DetectorDocument[].class)); } catch (IOException e) { val message = "IOException while reading detectors: sinceSeconds=" + timeInSecs; throw new DetectorException(message, e); } }  DetectorDocument findDetectorDocument(UUID uuid); List<DetectorDocument> findUpdatedDetectorDocuments(long timeInSecs); void updatedDetectorLastUsed(UUID uuid); DetectorMatchResponse findMatchingDetectorMappings(List<Map<String, String>> tagsList); List<DetectorMapping> findUpdatedDetectorMappings(long timeInSecs); DetectorMapping findDetectorMappingByUuid(UUID uuid);  }