DetectorClient { public DetectorMatchResponse findMatchingDetectorMappings(List<Map<String, String>> tagsList) { isTrue(tagsList.size() > 0, "tagsList must not be empty"); val uri = baseUri + FIND_MAPPINGS_BY_TAGS_PATH; Content content; try { String body = objectMapper.writeValueAsString(tagsList); content = httpClient.post(uri, body); } catch (IOException e) { val message = "IOException while getting matching detectors for" + ": tags=" + tagsList + ", httpMethod=POST" + ", uri=" + uri; throw new DetectorException(message, e); } try { return objectMapper.readValue(content.asBytes(), DetectorMatchResponse.class); } catch (IOException e) { val message = "IOException while reading detectorMatchResponse: tags=" + tagsList; 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 public void testFindMatchingDetectorMappings() { val result = clientUnderTest.findMatchingDetectorMappings(tags); assertEquals(detectorMatchResponse, result); }
@Test(expected = DetectorException.class) public void testFindMatchingDetectorMappings_cantGet() { clientUnderTest.findMatchingDetectorMappings(tags_cantPost); }
@Test(expected = DetectorException.class) public void testFindMatchingDetectorMappings_cantRead() { clientUnderTest.findMatchingDetectorMappings(tags_cantRead); }