@Test
    public void testNumberOfGetPartitionCalls() throws Exception {
        HiveMetaStoreClient spyMSC = spy(msc);
        hive.setMSC(spyMSC);
        // test with a batch size of 10 and decaying factor of 2
        hive.getAllPartitionsInBatches(hive.getTable(dbName, tableName),10, 2, 0, PARTIAL_PARTITION_SPEC, IS_AUTH_REQUIRED);
        ArgumentCaptor<GetPartitionsByNamesRequest> req = ArgumentCaptor.forClass(GetPartitionsByNamesRequest.class);
        // there should be 3 calls to get partitions
        verify(spyMSC, times(3)).getPartitionsByNames(req.capture());
        Assert.assertEquals(10, req.getValue().getNames().size());
    }
Tests the number of times Hive.getAllPartitionsOf calls are executed with total number of
partitions to be added are equally divisible by batch size

@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/exec/TestGetPartitionInBatches.java