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);  }
@Test(expected = IllegalArgumentException.class) public void testFindUpdatedDetectorDocuments_timePeriodInvalid() { clientUnderTest.findUpdatedDetectorDocuments(TIME_PERIOD_INVALID); }
@Test(expected = DetectorException.class) public void testFindUpdatedDetectorDocuments_cantGet() { clientUnderTest.findUpdatedDetectorDocuments(TIME_PERIOD_CANT_GET); }
@Test(expected = DetectorException.class) public void testFindUpdatedDetectorDocuments_cantRead() { clientUnderTest.findUpdatedDetectorDocuments(TIME_PERIOD_CANT_READ); }