@Test
    public void testSmallNumberOfPartitions() throws Exception {
        HiveMetaStoreClient spyMSC = spy(msc);
        hive.setMSC(spyMSC);
        hive.getAllPartitionsInBatches(hive.getTable(dbName, tableName),100, 2, 0, PARTIAL_PARTITION_SPEC, IS_AUTH_REQUIRED);
        ArgumentCaptor<GetPartitionsByNamesRequest> req = ArgumentCaptor.forClass(GetPartitionsByNamesRequest.class);
        // there should be 1 call to get partitions
        verify(spyMSC, times(1)).getPartitionsByNames(req.capture());
        Assert.assertEquals(30, req.getValue().getNames().size());
    }
Tests the number of times Hive.getAllPartitionsOf calls are executed with total number of
partitions to is less than batch size

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