| 12345678910111213141516171819202122 |
- using System.Reflection;
- using Admin.NET.Plugin.AiDOP.DataPlatform.UnifiedIngress;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- using Xunit;
- namespace Admin.NET.Plugin.AiDOP.Tests.DataPlatform;
- public sealed class MdpIngestEndpointTests
- {
- [Fact]
- public void UnifiedIngestExposesDatasetPostUsingDedicatedAuthentication()
- {
- var controller = Assert.Single(typeof(MdpIngestDatasetController).Assembly.GetTypes().Where(type =>
- type.GetCustomAttribute<RouteAttribute>()?.Template == "api/v1/ingest"));
- var post = Assert.Single(controller.GetMethods().Where(method =>
- method.GetCustomAttribute<HttpPostAttribute>()?.Template == "{datasetKey}"));
- Assert.NotNull(post);
- Assert.Equal("MdpUnifiedIngress", controller.GetCustomAttribute<AuthorizeAttribute>()?.AuthenticationSchemes);
- }
- }
|