@Test
public void testGetUniqueUsingScopeSchemaIndex() throws IOException {

    MetricSchemaRecordQuery queryForScope = new MetricSchemaRecordQuery.MetricSchemaRecordQueryBuilder().scope("system*")
            .metric("*")
            .tagKey("*")
            .tagValue("*")
            .namespace("*")
            .limit(2)
            .build();
    SchemaService.RecordType scopeType = SchemaService.RecordType.SCOPE;
    MonitorService mockedMonitor = mock(MonitorService.class);
    ElasticSearchSchemaService spyService = _initializeSpyService(_esSchemaService, getReply, getReply);
    spyService.getUnique(queryForScope, scopeType);
    ArgumentCaptor<Request> captor = ArgumentCaptor.forClass(Request.class);
    verify(restClient, times(1)).performRequest(captor.capture());
    String requestUrl = captor.getValue().getEndpoint();
    String queryJson = convertToPrettyJson(EntityUtils.toString(captor.getValue().getEntity()));
    assertEquals(scopeQuery, queryJson);
    assertEquals("/scopenames/scope_type/_search", requestUrl);
    assertTrue(queryForScope.isQueryOnlyOnScope());
    assertTrue(queryForScope.isQueryOnlyOnScopeAndMetric());
}