From 3bff4fd91fa051447fd3061bd0a0cd85d45ba6ad Mon Sep 17 00:00:00 2001 From: lannoy0523 <935275025@qq.com> Date: Thu, 24 Oct 2024 15:41:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8E=E5=8F=B0=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=99=90=E6=B5=81=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2=20#2655?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ratelimiter/service/AbstractRateLimiterServiceTest.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/common/common-ratelimiter/src/test/kotlin/com/tencent/bkrepo/common/ratelimiter/service/AbstractRateLimiterServiceTest.kt b/src/backend/common/common-ratelimiter/src/test/kotlin/com/tencent/bkrepo/common/ratelimiter/service/AbstractRateLimiterServiceTest.kt index ba11d297c9..090da664cf 100644 --- a/src/backend/common/common-ratelimiter/src/test/kotlin/com/tencent/bkrepo/common/ratelimiter/service/AbstractRateLimiterServiceTest.kt +++ b/src/backend/common/common-ratelimiter/src/test/kotlin/com/tencent/bkrepo/common/ratelimiter/service/AbstractRateLimiterServiceTest.kt @@ -43,6 +43,7 @@ import com.tencent.bkrepo.common.ratelimiter.enums.LimitDimension import com.tencent.bkrepo.common.ratelimiter.enums.WorkScope import com.tencent.bkrepo.common.ratelimiter.exception.InvalidResourceException import com.tencent.bkrepo.common.ratelimiter.metrics.RateLimiterMetrics +import com.tencent.bkrepo.common.ratelimiter.repository.RateLimitRepository import com.tencent.bkrepo.common.ratelimiter.rule.common.ResInfo import com.tencent.bkrepo.common.ratelimiter.rule.common.ResourceLimit import com.tencent.bkrepo.common.ratelimiter.service.user.RateLimiterConfigService @@ -68,6 +69,9 @@ open class AbstractRateLimiterServiceTest : DistributedTest() { @MockBean private lateinit var meterRegistry: MeterRegistry + @MockBean + private lateinit var rateLimitRepository: RateLimitRepository + fun init() { request = MockHttpServletRequest() val scheduler = ThreadPoolTaskScheduler() @@ -75,6 +79,7 @@ open class AbstractRateLimiterServiceTest : DistributedTest() { taskScheduler = scheduler rateLimiterProperties = RateLimiterProperties() rateLimiterMetrics = RateLimiterMetrics(meterRegistry) + rateLimiterConfigService = RateLimiterConfigService(rateLimitRepository) }