Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
agile.zhou committed Sep 28, 2024
1 parent 1236ca6 commit 54e00f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
21 changes: 9 additions & 12 deletions test/ApiSiteTests/TestApiConfigController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -59,22 +60,18 @@ List<Config> newConfigs()
.ReturnsAsync(newConfigs);

IMemoryCache memoryCache = null;
var remoteNodeProxy = new Mock<IRemoteServerNodeProxy>();
var serverNodeService = new Mock<IServerNodeService>();
var sysLogService = new Mock<ISysLogService>();
var appBasicAuthService = new Mock<IAppBasicAuthService>();
var userSErvice = new Mock<IUserService>();
var eventBus = new Mock<ITinyEventBus>();
var meterService = new Mock<IMeterService>();

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);
Expand All @@ -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);
Expand Down

0 comments on commit 54e00f7

Please sign in to comment.