Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: backend tests #11324

Merged
merged 18 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/designer-dotnet-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
analyze:
strategy:
matrix:
os: [ubuntu-latest] #windows-latest and macos-latest excluded temporarily
os: [ubuntu-latest,windows-latest,macos-latest] #windows-latest and macos-latest excluded temporarily
name: Run dotnet build and test
runs-on: ${{ matrix.os}}
env:
Expand All @@ -33,7 +33,7 @@ jobs:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Build
run: |
dotnet build backend/Designer.sln -v n -nodereuse:false
dotnet build backend/Designer.sln -v m
- name: Test
run: |
dotnet test backend/Designer.sln --filter Category!=GiteaIntegrationTest -v n --no-build
dotnet test backend/Designer.sln --filter FullyQualifiedName~AppDevelopmentController --no-build; dotnet test backend/Designer.sln --filter FullyQualifiedName~PreviewController --no-build; dotnet test backend/Designer.sln --filter "(Category!=GiteaIntegrationTest)&(FullyQualifiedName!~AppDevelopmentController)&(FullyQualifiedName!~PreviewController)" -v m --no-build
2 changes: 2 additions & 0 deletions backend/src/Designer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// standalone package Microsoft.Extensions.Logging.ApplicationInsights
// or if you want to capture logs from early in the application startup
// pipeline from Startup.cs or Program.cs itself.
builder.AddApplicationInsights(applicationInsightsKey);

Check warning on line 152 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run dotnet build and test (ubuntu-latest)

'ApplicationInsightsLoggingBuilderExtensions.AddApplicationInsights(ILoggingBuilder, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsights() overload which accepts Action<TelemetryConfiguration> and set TelemetryConfiguration.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

Check warning on line 152 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run integration tests against actual gitea

'ApplicationInsightsLoggingBuilderExtensions.AddApplicationInsights(ILoggingBuilder, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsights() overload which accepts Action<TelemetryConfiguration> and set TelemetryConfiguration.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

Check warning on line 152 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run dotnet build and test (windows-latest)

'ApplicationInsightsLoggingBuilderExtensions.AddApplicationInsights(ILoggingBuilder, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsights() overload which accepts Action<TelemetryConfiguration> and set TelemetryConfiguration.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

Check warning on line 152 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run dotnet build and test (macos-latest)

'ApplicationInsightsLoggingBuilderExtensions.AddApplicationInsights(ILoggingBuilder, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsights() overload which accepts Action<TelemetryConfiguration> and set TelemetryConfiguration.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

// Optional: Apply filters to control what logs are sent to Application Insights.
// The following configures LogLevel Information or above to be sent to
Expand Down Expand Up @@ -213,7 +213,7 @@
// Add application insight telemetry
if (!string.IsNullOrEmpty(applicationInsightsKey))
{
services.AddApplicationInsightsTelemetry(applicationInsightsKey);

Check warning on line 216 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run dotnet build and test (ubuntu-latest)

'ApplicationInsightsExtensions.AddApplicationInsightsTelemetry(IServiceCollection, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsightsTelemetry() overload which accepts Action<ApplicationInsightsServiceOptions> and set ApplicationInsightsServiceOptions.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

Check warning on line 216 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run integration tests against actual gitea

'ApplicationInsightsExtensions.AddApplicationInsightsTelemetry(IServiceCollection, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsightsTelemetry() overload which accepts Action<ApplicationInsightsServiceOptions> and set ApplicationInsightsServiceOptions.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

Check warning on line 216 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run dotnet build and test (windows-latest)

'ApplicationInsightsExtensions.AddApplicationInsightsTelemetry(IServiceCollection, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsightsTelemetry() overload which accepts Action<ApplicationInsightsServiceOptions> and set ApplicationInsightsServiceOptions.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'

Check warning on line 216 in backend/src/Designer/Program.cs

View workflow job for this annotation

GitHub Actions / Run dotnet build and test (macos-latest)

'ApplicationInsightsExtensions.AddApplicationInsightsTelemetry(IServiceCollection, string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the AddApplicationInsightsTelemetry() overload which accepts Action<ApplicationInsightsServiceOptions> and set ApplicationInsightsServiceOptions.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.'
services.ConfigureTelemetryModule<EventCounterCollectionModule>(
(module, o) =>
{
Expand Down Expand Up @@ -359,3 +359,5 @@

return xmlPath;
}

public partial class Program { }
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public interface IProcessModelingService
/// Gets the process definition file stream for a given app.
/// </summary>
/// <param name="altinnRepoEditingContext">An <see cref="AltinnRepoEditingContext"/>.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that observes if operation is cancelled.</param>
/// <returns>A <see cref="Stream"/> of a process definition file.</returns>
Stream GetProcessDefinitionStream(AltinnRepoEditingContext altinnRepoEditingContext);
}
Expand Down
39 changes: 20 additions & 19 deletions backend/tests/Designer.Tests/Controllers/ApiTests/ApiTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,35 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.AspNetCore.Mvc.Testing.Handlers;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SharedResources.Tests;
using Xunit;
using static Designer.Tests.Utils.TestSetupUtils;

namespace Designer.Tests.Controllers.ApiTests;

/// <summary>
/// Base class for testing controller endpoints.
/// </summary>
/// <typeparam name="TController">Provided controller type.</typeparam>
/// <typeparam name="TControllerTest">Controller test class type. Used for generating fluent tests.</typeparam>
[ExcludeFromCodeCoverage]
public abstract class ApiTestsBase<TController, TControllerTest> : FluentTestsBase<TControllerTest>,
IClassFixture<WebApplicationFactory<TController>>
where TController : ControllerBase
where TControllerTest : class
public abstract class ApiTestsBase<TControllerTest> : FluentTestsBase<TControllerTest>, IDisposable where TControllerTest : class
{
private HttpClient _httpClient;

/// <summary>
/// HttpClient that should call endpoints of a provided controller.
/// </summary>
protected Lazy<HttpClient> HttpClient { get; }
protected HttpClient HttpClient
{
get
{
return _httpClient ??= GetTestClient();
}
}

/// <summary>
/// When overridden tests services will be configured.
Expand All @@ -50,12 +49,11 @@ public abstract class ApiTestsBase<TController, TControllerTest> : FluentTestsBa
protected virtual string TestRepositoriesLocation =>
Path.Combine(UnitTestsFolder, "..", "..", "..", "_TestData", "Repositories");

protected readonly WebApplicationFactory<TController> Factory;
protected readonly WebApplicationFactory<Program> Factory;

protected ApiTestsBase(WebApplicationFactory<TController> factory)
protected ApiTestsBase(WebApplicationFactory<Program> factory)
{
Factory = factory;
HttpClient = new Lazy<HttpClient>(GetTestClient);
SetupDirtyHackIfLinux();
}

Expand All @@ -67,15 +65,11 @@ protected ApiTestsBase(WebApplicationFactory<TController> factory)
protected virtual HttpClient GetTestClient()
{
string configPath = GetConfigPath();

var client = Factory.WithWebHostBuilder(builder =>
return Factory.WithWebHostBuilder(builder =>
{
builder.UseTestServer();
builder.ConfigureAppConfiguration((_, conf) => { conf.AddJsonFile(configPath); });

builder.ConfigureTestServices(ConfigureTestServices);
}).CreateDefaultClient(new ApiTestsAuthAndCookieDelegatingHandler(), new CookieContainerHandler());
return client;
}

/// <summary>
Expand All @@ -87,4 +81,11 @@ protected virtual string GetConfigPath()
string projectDir = Directory.GetCurrentDirectory();
return Path.Combine(projectDir, "appsettings.json");
}
public void Dispose()
{
Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
Expand All @@ -17,10 +18,8 @@ namespace Designer.Tests.Controllers.ApiTests
/// More adjusted version of the ApiTestsBase class that is used for testing controllers that contains org and repo in the path.
/// Provides functionality for copying a repository from the test repositories location to a temporary location for testing which is disposed after execution of the test.
/// </summary>
/// <typeparam name="TController">Controller type.</typeparam>
/// <typeparam name="TControllerTest">Tests class type.</typeparam>
public abstract class DisagnerEndpointsTestsBase<TController, TControllerTest> : ApiTestsBase<TController, TControllerTest>, IDisposable
where TController : ControllerBase
public abstract class DisagnerEndpointsTestsBase<TControllerTest> : ApiTestsBase<TControllerTest>
where TControllerTest : class
{
/// <summary>
Expand Down Expand Up @@ -49,7 +48,7 @@ protected override void ConfigureTestServices(IServiceCollection services)
Converters = { new JsonStringEnumConverter() }
};

public DisagnerEndpointsTestsBase(WebApplicationFactory<TController> factory) : base(factory)
public DisagnerEndpointsTestsBase(WebApplicationFactory<Program> factory) : base(factory)
{
}

Expand Down Expand Up @@ -90,19 +89,20 @@ protected async Task CopyRemoteRepositoryForTest(string org, string repo, string
RemoteTestRepoPath = await TestDataHelper.CopyRemoteRepositoryForTest(org, repo, targetRepository);
}

public void Dispose()
protected override void Dispose(bool disposing)
{
if (!string.IsNullOrWhiteSpace(TestRepoPath))
base.Dispose(disposing);
if (!disposing)
{
TestDataHelper.DeleteDirectory(TestRepoPath);
return;
}
if (!string.IsNullOrWhiteSpace(RemoteTestRepoPath))
if (!string.IsNullOrWhiteSpace(TestRepoPath))
{
TestDataHelper.DeleteDirectory(RemoteTestRepoPath);
Directory.Delete(TestRepoPath, true);
}
if (HttpClient.IsValueCreated)
if (!string.IsNullOrWhiteSpace(RemoteTestRepoPath))
{
HttpClient.Value.Dispose();
Directory.Delete(RemoteTestRepoPath, true);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace Designer.Tests.Controllers.AppDevelopmentController
{
public class DeleteFormLayoutTests : DisagnerEndpointsTestsBase<Altinn.Studio.Designer.Controllers.AppDevelopmentController, DeleteFormLayoutTests>
public class DeleteFormLayoutTests : DisagnerEndpointsTestsBase<DeleteFormLayoutTests>, IClassFixture<WebApplicationFactory<Program>>
{
private static string VersionPrefix(string org, string repository) => $"/designer/api/{org}/{repository}/app-development";
public DeleteFormLayoutTests(WebApplicationFactory<Altinn.Studio.Designer.Controllers.AppDevelopmentController> factory) : base(factory)
public DeleteFormLayoutTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

Expand All @@ -30,7 +30,7 @@ public async Task DeleteFormLayout_ShouldDeleteLayoutFile_AndReturnOk(string org

using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Delete, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.OK);

string relativePath = string.IsNullOrEmpty(layoutSetName)
Expand All @@ -52,7 +52,7 @@ public async Task DeleteFormLayout_NonExistingFile_Should_AndReturnNotFound(stri

using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Delete, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.NotFound);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

namespace Designer.Tests.Controllers.AppDevelopmentController
{
public class GetFormLayoutsTests : DisagnerEndpointsTestsBase<Altinn.Studio.Designer.Controllers.AppDevelopmentController, GetFormLayoutsTests>
public class GetFormLayoutsTests : DisagnerEndpointsTestsBase<GetFormLayoutsTests>, IClassFixture<WebApplicationFactory<Program>>
{
private static string VersionPrefix(string org, string repository) => $"/designer/api/{org}/{repository}/app-development";
public GetFormLayoutsTests(WebApplicationFactory<Altinn.Studio.Designer.Controllers.AppDevelopmentController> factory) : base(factory)
public GetFormLayoutsTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

Expand All @@ -35,7 +35,7 @@ public async Task GetAppDevelopment_ShouldReturnLayouts(string org, string app,
string url = $"{VersionPrefix(org, targetRepository)}/form-layouts?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.OK);

string responseContent = await response.Content.ReadAsStringAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace Designer.Tests.Controllers.AppDevelopmentController
{
public class GetLayoutSettingsTests : DisagnerEndpointsTestsBase<Altinn.Studio.Designer.Controllers.AppDevelopmentController, GetLayoutSettingsTests>
public class GetLayoutSettingsTests : DisagnerEndpointsTestsBase<GetLayoutSettingsTests>, IClassFixture<WebApplicationFactory<Program>>
{
private static string VersionPrefix(string org, string repository) => $"/designer/api/{org}/{repository}/app-development";
public GetLayoutSettingsTests(WebApplicationFactory<Altinn.Studio.Designer.Controllers.AppDevelopmentController> factory) : base(factory)
public GetLayoutSettingsTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

Expand All @@ -35,7 +35,7 @@ public async Task GetLayoutSettings_ShouldReturnLayouts(string org, string app,
string url = $"{VersionPrefix(org, targetRepository)}/layout-settings?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.OK);

string responseContent = await response.Content.ReadAsStringAsync();
Expand All @@ -50,7 +50,7 @@ public async Task GetLayoutSettings_IfNotExists_Should_AndReturnNotFound(string
string url = $"{VersionPrefix(org, app)}/layout-settings?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.NotFound);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace Designer.Tests.Controllers.AppDevelopmentController
{
public class GetOptionListIdsTests : DisagnerEndpointsTestsBase<Altinn.Studio.Designer.Controllers.AppDevelopmentController, GetOptionListIdsTests>
public class GetOptionListIdsTests : DisagnerEndpointsTestsBase<GetOptionListIdsTests>, IClassFixture<WebApplicationFactory<Program>>
{
private static string VersionPrefix(string org, string repository) => $"/designer/api/{org}/{repository}/app-development";
public GetOptionListIdsTests(WebApplicationFactory<Altinn.Studio.Designer.Controllers.AppDevelopmentController> factory) : base(factory)
public GetOptionListIdsTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

Expand All @@ -34,7 +34,7 @@ public async Task GetOptionsListIds_ShouldReturnOk(string org, string app, strin
string url = $"{VersionPrefix(org, targetRepository)}/option-list-ids";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.OK);

string responseContent = await response.Content.ReadAsStringAsync();
Expand All @@ -53,7 +53,7 @@ public async Task GetOptionsListIds_WhenNotExists_ReturnsNotFound(string org, st
string url = $"{VersionPrefix(org, app)}/option-list-ids";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);

response.StatusCode.Should().Be(HttpStatusCode.NoContent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace Designer.Tests.Controllers.AppDevelopmentController
{
public class GetRuleConfigTests : DisagnerEndpointsTestsBase<Altinn.Studio.Designer.Controllers.AppDevelopmentController, GetRuleConfigTests>
public class GetRuleConfigTests : DisagnerEndpointsTestsBase<GetRuleConfigTests>, IClassFixture<WebApplicationFactory<Program>>
{
private static string VersionPrefix(string org, string repository) => $"/designer/api/{org}/{repository}/app-development";
public GetRuleConfigTests(WebApplicationFactory<Altinn.Studio.Designer.Controllers.AppDevelopmentController> factory) : base(factory)
public GetRuleConfigTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

Expand All @@ -32,7 +32,7 @@ public async Task GetRuleConfig_ShouldReturnOK(string org, string app, string de
string url = $"{VersionPrefix(org, targetRepository)}/rule-config?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.OK);

string responseContent = await response.Content.ReadAsStringAsync();
Expand All @@ -46,7 +46,7 @@ public async Task GetRuleConfig_WhenNotExists_ReturnsNotFound(string org, string
string url = $"{VersionPrefix(org, app)}/rule-config?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);

response.StatusCode.Should().Be(HttpStatusCode.NoContent);
}
Expand All @@ -64,7 +64,7 @@ public async Task GetRuleConfig_WhenFileMissesDataOnRoot_ReturnsFixedFile(string
string url = $"{VersionPrefix(org, targetRepository)}/rule-config?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.OK);

string responseContent = await response.Content.ReadAsStringAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace Designer.Tests.Controllers.AppDevelopmentController
{
public class GetRuleHandlerTests : DisagnerEndpointsTestsBase<Altinn.Studio.Designer.Controllers.AppDevelopmentController, GetRuleHandlerTests>
public class GetRuleHandlerTests : DisagnerEndpointsTestsBase<GetRuleHandlerTests>, IClassFixture<WebApplicationFactory<Program>>
{
private static string VersionPrefix(string org, string repository) => $"/designer/api/{org}/{repository}/app-development";
public GetRuleHandlerTests(WebApplicationFactory<Altinn.Studio.Designer.Controllers.AppDevelopmentController> factory) : base(factory)
public GetRuleHandlerTests(WebApplicationFactory<Program> factory) : base(factory)
{
}

Expand All @@ -35,7 +35,7 @@ public async Task GetRuleHandler_ShouldReturnJsContent(string org, string app, s
string url = $"{VersionPrefix(org, targetRepository)}/rule-handler?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.OK);

string responseContent = await response.Content.ReadAsStringAsync();
Expand All @@ -50,7 +50,7 @@ public async Task GetRuleHandler_IfNotExists_Should_AndReturnNotFound(string org
string url = $"{VersionPrefix(org, app)}/rule-handler?layoutSetName={layoutSetName}";
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, url);

using var response = await HttpClient.Value.SendAsync(httpRequestMessage);
using var response = await HttpClient.SendAsync(httpRequestMessage);
response.StatusCode.Should().Be(HttpStatusCode.NotFound);
string content = await response.Content.ReadAsStringAsync();
content.Should().Be("Could not find rule handler in app.");
Expand Down
Loading
Loading