@Test
  public void testMinDoesNotSupportPartialResults() throws Exception {
    AggregateRequest noPartialRequest =
      AggregateRequest.newBuilder().setScan(ProtobufUtil.toScan(scan))
        .setInterpreterClassName(LongColumnInterpreter.class.getName())
        .setClientSupportsPartialResult(false).build();

    OperationQuota nonThrottlingQuota = mock(OperationQuota.class);
    when(env.checkScanQuota(any(), anyLong(), anyLong())).thenReturn(nonThrottlingQuota);

    ArgumentCaptor<AggregateResponse> responseCaptor =
      ArgumentCaptor.forClass(AggregateResponse.class);
    RpcCallback<AggregateResponse> callback = mock(RpcCallback.class);

    // Call should complete without throttling
    aggregate.getMin(controller, noPartialRequest, callback);

    verify(callback).run(responseCaptor.capture());

    AggregateResponse response = responseCaptor.getValue();

    assertFalse("Response should not indicate there are more rows",
      response.hasNextChunkStartRow());
    ByteString b = response.getFirstPart(0);
    HBaseProtos.LongMsg q = getParsedGenericInstance(LONG_COLUMN_INTERPRETER.getClass(), 3, b);
    assertEquals(1L, (long) LONG_COLUMN_INTERPRETER.getCellValueFromProto(q));
  }
Test AggregateImplementation with throttling and partial results
hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestAggregateImplementation.java