Skip to content

Commit 4d9cd2c

Browse files
committed
fix path on non-windows
1 parent f107009 commit 4d9cd2c

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/Management/test/Endpoint.Test/Actuators/Health/HealthActuatorTest.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ namespace Steeltoe.Management.Endpoint.Test.Actuators.Health;
2626
public sealed class HealthActuatorTest
2727
{
2828
private const long OneGigabyte = 1024 * 1024 * 1024;
29-
private static readonly string DiskSpacePath = Platform.IsWindows ? @"D:\Apps\Data" : "/mnt/apps/data";
3029

3130
private static readonly Dictionary<string, string?> AppSettings = new()
3231
{
@@ -140,21 +139,18 @@ public async Task Configures_claim_when_only_role_specified()
140139
[InlineData(HostBuilderType.WebApplication)]
141140
public async Task Endpoint_returns_expected_data(HostBuilderType hostBuilderType)
142141
{
142+
string diskSpacePath = Platform.IsWindows ? @"D:\Apps\Data" : "/mnt/apps/data";
143+
List<FakeDriveInfoWrapper> drives = [new(16 * OneGigabyte, 128 * OneGigabyte, Platform.IsWindows ? @"D:\" : "/")];
144+
143145
var appSettings = new Dictionary<string, string?>(AppSettings)
144146
{
145147
["Management:Endpoints:Health:ShowComponents"] = "Always",
146148
["Management:Endpoints:Health:ShowDetails"] = "Always",
147-
["Management:Endpoints:Health:DiskSpace:Path"] = DiskSpacePath,
149+
["Management:Endpoints:Health:DiskSpace:Path"] = diskSpacePath,
148150
["Management:Endpoints:Health:DiskSpace:Threshold"] = $"{5 * OneGigabyte}"
149151
};
150152

151-
List<FakeDriveInfoWrapper> drives =
152-
[
153-
new(32 * OneGigabyte, 64 * OneGigabyte, @"C:\"),
154-
new(16 * OneGigabyte, 128 * OneGigabyte, @"D:\")
155-
];
156-
157-
var diskSpaceProvider = new FakeDiskSpaceProvider(true, drives, [], [DiskSpacePath]);
153+
var diskSpaceProvider = new FakeDiskSpaceProvider(true, drives, [], [diskSpacePath]);
158154

159155
await using HostWrapper host = hostBuilderType.Build(builder =>
160156
{

0 commit comments

Comments
 (0)