From 54e00f7143dfba5eaff0aa664bb33c36e630548b Mon Sep 17 00:00:00 2001 From: "agile.zhou" Date: Sat, 28 Sep 2024 22:37:38 +0800 Subject: [PATCH] Fix build error --- .../Controllers/api/ConfigController.cs | 1 - test/ApiSiteTests/TestApiConfigController.cs | 21 ++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/AgileConfig.Server.Apisite/Controllers/api/ConfigController.cs b/src/AgileConfig.Server.Apisite/Controllers/api/ConfigController.cs index 3f24a566..67efada1 100644 --- a/src/AgileConfig.Server.Apisite/Controllers/api/ConfigController.cs +++ b/src/AgileConfig.Server.Apisite/Controllers/api/ConfigController.cs @@ -7,7 +7,6 @@ using AgileConfig.Server.Apisite.Metrics; using AgileConfig.Server.Apisite.Models; using AgileConfig.Server.Apisite.Models.Mapping; -using AgileConfig.Server.Common.EventBus; using AgileConfig.Server.Data.Entity; using AgileConfig.Server.IService; using Microsoft.AspNetCore.Mvc; diff --git a/test/ApiSiteTests/TestApiConfigController.cs b/test/ApiSiteTests/TestApiConfigController.cs index 22593b05..23ffc691 100644 --- a/test/ApiSiteTests/TestApiConfigController.cs +++ b/test/ApiSiteTests/TestApiConfigController.cs @@ -10,6 +10,7 @@ using AgileConfig.Server.Apisite.Controllers.api.Models; using AgileConfig.Server.Common.EventBus; using AgileConfig.Server.Apisite.Metrics; +using AgileConfig.Server.Apisite.Models; namespace ApiSiteTests; @@ -59,10 +60,6 @@ List newConfigs() .ReturnsAsync(newConfigs); IMemoryCache memoryCache = null; - var remoteNodeProxy = new Mock(); - var serverNodeService = new Mock(); - var sysLogService = new Mock(); - var appBasicAuthService = new Mock(); var userSErvice = new Mock(); var eventBus = new Mock(); var meterService = new Mock(); @@ -70,11 +67,11 @@ List newConfigs() var ctrl = new ConfigController( configService.Object, appService.Object, - userSErvice.Object, - memoryCache, eventBus.Object, - meterService.Object + memoryCache, + meterService.Object, + new AgileConfig.Server.Apisite.Controllers.ConfigController(configService.Object, appService.Object, userSErvice.Object, eventBus.Object) ); - var act = await ctrl.GetAppConfig("001", "DEV"); + var act = await ctrl.GetAppConfig("001", new EnvString() { Value = "DEV" }); Assert.IsNotNull(act); Assert.IsNotNull(act.Value); @@ -94,11 +91,11 @@ App newApp1() ctrl = new ConfigController( configService.Object, appService.Object, - userSErvice.Object, - memoryCache, eventBus.Object, - meterService.Object + memoryCache, + meterService.Object, + new AgileConfig.Server.Apisite.Controllers.ConfigController(configService.Object, appService.Object, userSErvice.Object, eventBus.Object) ); - act = await ctrl.GetAppConfig("001", "DEV"); + act = await ctrl.GetAppConfig("001", new EnvString() { Value = "DEV" }); Assert.IsNotNull(act); Assert.IsNull(act.Value);