public static void testHandleResourceUsageReport(long backendId, TResourceUsage usage) {
        resourceUsageReport(backendId, usage);
    }
@Test
    public void testHandleResourceUsageReport() {
        ResourceUsageMonitor resourceUsageMonitor = GlobalStateMgr.getCurrentState().getResourceUsageMonitor();

        Backend backend = new Backend(0, "127.0.0.1", 80);
        ComputeNode computeNode = new ComputeNode(2, "127.0.0.1", 88);

        new MockUp<SystemInfoService>() {
            @Mock
            public ComputeNode getBackendOrComputeNode(long id) {
                if (id == backend.getId()) {
                    return backend;
                }
                if (id == computeNode.getId()) {
                    return computeNode;
                }
                return null;
            }
        };

        new Expectations(resourceUsageMonitor) {
            {
                resourceUsageMonitor.notifyResourceUsageUpdate();
                times = 2;
            }
        };

        int numRunningQueries = 1;
        long memLimitBytes = 3;
        long memUsedBytes = 2;
        int cpuUsedPermille = 300;
        TResourceUsage resourceUsage = genResourceUsage(numRunningQueries, memLimitBytes, memUsedBytes, cpuUsedPermille);

        // For backend, sync to FE followers and notify pending queries.
        ReportHandler.testHandleResourceUsageReport(backend.getId(), resourceUsage);
        Assert.assertEquals(numRunningQueries, backend.getNumRunningQueries());
        //        Assert.assertEquals(memLimitBytes, backend.getMemLimitBytes());
        Assert.assertEquals(memUsedBytes, backend.getMemUsedBytes());
        Assert.assertEquals(cpuUsedPermille, backend.getCpuUsedPermille());

        // For compute node, sync to FE followers and notify pending queries.
        numRunningQueries = 10;
        memLimitBytes = 30;
        memUsedBytes = 20;
        cpuUsedPermille = 310;
        resourceUsage = genResourceUsage(numRunningQueries, memLimitBytes, memUsedBytes, cpuUsedPermille);
        ReportHandler.testHandleResourceUsageReport(computeNode.getId(), resourceUsage);
        Assert.assertEquals(numRunningQueries, computeNode.getNumRunningQueries());
        //        Assert.assertEquals(memLimitBytes, computeNode.getMemLimitBytes());
        Assert.assertEquals(memUsedBytes, computeNode.getMemUsedBytes());
        Assert.assertEquals(cpuUsedPermille, computeNode.getCpuUsedPermille());

        // Don't sync and notify, because this BE doesn't exist.
        ReportHandler.testHandleResourceUsageReport(/* Not Exist */ 1, resourceUsage);
    }