public boolean insertGroupCapacity(final GroupCapacity capacity) {
        GroupCapacityMapper groupCapacityMapper = mapperManager.findMapper(dataSourceService.getDataSourceType(),
                TableConstant.GROUP_CAPACITY);
        MapperResult mapperResult;
        MapperContext context = new MapperContext();
        context.putUpdateParameter(FieldConstant.GROUP_ID, capacity.getGroup());
        context.putUpdateParameter(FieldConstant.QUOTA, capacity.getQuota());
        context.putUpdateParameter(FieldConstant.MAX_SIZE, capacity.getMaxSize());
        context.putUpdateParameter(FieldConstant.MAX_AGGR_SIZE, capacity.getMaxAggrSize());
        context.putUpdateParameter(FieldConstant.MAX_AGGR_COUNT, capacity.getMaxAggrCount());
        context.putUpdateParameter(FieldConstant.GMT_CREATE, capacity.getGmtCreate());
        context.putUpdateParameter(FieldConstant.GMT_MODIFIED, capacity.getGmtModified());
        
        context.putWhereParameter(FieldConstant.GROUP_ID, capacity.getGroup());
        if (CLUSTER.equals(capacity.getGroup())) {
            mapperResult = groupCapacityMapper.insertIntoSelect(context);
        } else {
            // Note: add "tenant_id = ''" condition.
            mapperResult = groupCapacityMapper.insertIntoSelectByWhere(context);
        }
        return jdbcTemplate.update(mapperResult.getSql(), mapperResult.getParamList().toArray()) > 0;
    }
@Test
    void testInsertGroupCapacity() {
        
        doReturn(1).when(jdbcTemplate).update(anyString(), eq(""), eq(null), eq(null), eq(null), eq(null), eq(null), eq(null));
        // when(jdbcTemplate.update(anyString(), eq(timestamp), eq("test3"))).thenReturn(1);
        
        GroupCapacity capacity = new GroupCapacity();
        capacity.setGroup(GroupCapacityPersistService.CLUSTER);
        assertTrue(service.insertGroupCapacity(capacity));
        
        capacity.setGroup("test");
        doReturn(1).when(jdbcTemplate)
                .update(anyString(), eq("test"), eq(null), eq(null), eq(null), eq(null), eq(null), eq(null), eq("test"));
        
        assertTrue(service.insertGroupCapacity(capacity));
    }