@Around(SYNC_UPDATE_CONFIG_ALL)
    public Object aroundSyncUpdateConfigAll(ProceedingJoinPoint pjp, HttpServletRequest request,
            HttpServletResponse response, String dataId, String group, String content, String appName, String srcUser,
            String tenant, String tag) throws Throwable {
        if (!PropertyUtil.isManageCapacity()) {
            return pjp.proceed();
        }
        LOGGER.info("[capacityManagement] aroundSyncUpdateConfigAll");
        String betaIps = request.getHeader("betaIps");
        if (StringUtils.isBlank(betaIps)) {
            if (StringUtils.isBlank(tag)) {
                // do capacity management limitation check for writing or updating config_info table.
                if (configInfoPersistService.findConfigInfo(dataId, group, tenant) == null) {
                    // Write operation.
                    return do4Insert(pjp, request, response, group, tenant, content);
                }
                // Update operation.
                return do4Update(pjp, request, response, dataId, group, tenant, content);
            }
        }
        return pjp.proceed();
    }
@Test
    void testAroundSyncUpdateConfigAllForInsertRollbackAspect() throws Throwable {
        //test with insert
        //condition:
        //  1. has tenant: true
        //  2. capacity limit check: true
        //  3. over cluster quota: false
        //  4. tenant capacity: not null
        //  5. over tenant max size: true/false (if tenant max size is 0, will use default max size)
        when(PropertyUtil.isManageCapacity()).thenReturn(true);
        when(PropertyUtil.isCapacityLimitCheck()).thenReturn(true);
        when(configInfoPersistService.findConfigInfo(any(), any(), any())).thenReturn(null);
        when(capacityService.insertAndUpdateClusterUsage(any(), anyBoolean())).thenReturn(true);
        when(capacityService.updateClusterUsage(any())).thenReturn(true);
        when(capacityService.updateTenantUsage(any(), eq(mockTenant))).thenReturn(true);
        TenantCapacity localTenantCapacity = new TenantCapacity();
        localTenantCapacity.setTenant(mockTenant);
        localTenantCapacity.setMaxSize(10 * 1024);
        localTenantCapacity.setMaxAggrCount(1024);
        when(capacityService.getTenantCapacity(eq(mockTenant))).thenReturn(localTenantCapacity);
        
        String localMockResult = null;
        MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest();
        MockHttpServletResponse mockHttpServletResponse = new MockHttpServletResponse();
        try {
            localMockResult = (String) capacityManagementAspect.aroundSyncUpdateConfigAll(localMockProceedingJoinPoint,
                    mockHttpServletRequest, mockHttpServletResponse, mockDataId, mockGroup, mockContent, null, null, mockTenant, null);
        } catch (Throwable e) {
            assertEquals(e.getMessage(), mockException.getMessage());
        }
        assertNull(localMockResult);
        Mockito.verify(capacityService, Mockito.times(0)).initTenantCapacity(eq(mockTenant));
        Mockito.verify(capacityService, Mockito.times(1)).updateTenantUsage(eq(CounterMode.INCREMENT), eq(mockTenant));
        Mockito.verify(capacityService, Mockito.times(1)).updateTenantUsage(eq(CounterMode.DECREMENT), eq(mockTenant));
        Mockito.verify(capacityService, Mockito.times(1)).insertAndUpdateClusterUsage(eq(CounterMode.INCREMENT), anyBoolean());
        Mockito.verify(capacityService, Mockito.times(1)).updateClusterUsage(eq(CounterMode.DECREMENT));
        Mockito.verify(localMockProceedingJoinPoint, Mockito.times(1)).proceed();
    }