DiscoveryService extends EndpointService { public List<String> getMatchingRecordFields(String namespaceRegex, String scopeRegex, String metricRegex, String tagKeyRegex, String tagValueRegex, FieldSelector type, int limit) throws IOException, TokenExpiredException { StringBuilder urlBuilder = _buildBaseUrl(namespaceRegex, scopeRegex, metricRegex, tagKeyRegex, tagValueRegex, limit); urlBuilder.append("&type=").append(type.name().toLowerCase(Locale.ENGLISH)); String requestUrl = urlBuilder.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); return fromJson(response.getResult(), new TypeReference<List<String>>() { }); } DiscoveryService(ArgusHttpClient client); List<MetricSchemaRecord> getMatchingRecords(String namespaceRegex, String scopeRegex, String metricRegex, String tagKeyRegex,
        String tagValueRegex, int limit); List<String> getMatchingRecordFields(String namespaceRegex, String scopeRegex, String metricRegex, String tagKeyRegex,
        String tagValueRegex, FieldSelector type, int limit); MetricDiscoveryResult getMatchingRecords(MetricDiscoveryQuery query);  }
@Test public void testGetMatchingRecordFields() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/DiscoveryServiceTest.json"))) { DiscoveryService discoveryService = argusService.getDiscoveryService(); List<String> result = discoveryService.getMatchingRecordFields("nsReg", "scpReg", "metReg", "tkReg", "tvReg", NAMESPACE, 2); List<String> expected = Arrays.asList(new String[] { "namespace1", "namespace2" }); assertEquals(expected, result); } }