Skip to content

Commit

Permalink
Fixed the Helpdesk Api projections configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz committed Sep 3, 2024
1 parent d5ef978 commit 9d0fe9c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Helpdesk.Api.Tests.Incidents;

public class LogIncidentsTests(AppFixture fixture): IntegrationContext(fixture)
{
[Fact(Skip = "Need to bump wolverine")]
[Fact]
public async Task LogIncident_ShouldSucceed()
{
var result = await Host.Scenario(x =>

Check failure on line 18 in Sample/Helpdesk.Wolverine/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs

View workflow job for this annotation

GitHub Actions / build

Helpdesk.Api.Tests.Incidents.LogIncidentsTests.LogIncident_ShouldSucceed

Alba.ScenarioAssertionException : Expected status code 201, but was 500 Actual body text was: {"type":"https://tools.ietf.org/html/rfc9110#section-15.6.1","title":"Lamar.IoC.LamarMissingRegistrationException","status":500,"detail":"No service registrations exist or can be derived for Microsoft.AspNetCore.Authentication.IAuthenticationHandlerProvider","exception":{"details":"Lamar.IoC.LamarMissingRegistrationException: No service registrations exist or can be derived for Microsoft.AspNetCore.Authentication.IAuthenticationHandlerProvider\n at Lamar.IoC.Scope.GetInstance(Type serviceType)\n at Lamar.Container.Microsoft.Extensions.DependencyInjection.ISupportRequiredService.GetRequiredService(Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)","headers":{"Host":["localhost"],"Content-Type":["application/json"],"Content-Length":["291"],"Accept":["application/json"]},"path":"/api/customers/6d10492b-7e4f-442f-bfcd-b9d80d974d5b/incidents/","endpoint":"HandlerType: Helpdesk.Api.Incidents.Logging.LogEndpoint, Method: System.ValueTuple`2[Wolverine.Http.CreationResponse,Wolverine.Marten.IStartStream] LogIncident(Helpdesk.Api.Incidents.Logging.LogIncident, System.DateTimeOffset)","routeValues":{"customerId":"6d10492b-7e4f-442f-bfcd-b9d80d974d5b"}}}
Expand Down
6 changes: 3 additions & 3 deletions Sample/Helpdesk/Helpdesk.Api/Helpdesk.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Core.WebApi\Core.WebApi.csproj" />
</ItemGroup>
<!-- <ItemGroup>-->
<!-- <ProjectReference Include="..\..\..\Core.WebApi\Core.WebApi.csproj" />-->
<!-- </ItemGroup>-->
</Project>
16 changes: 8 additions & 8 deletions Sample/Helpdesk/Helpdesk.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
using Core.WebApi.Middlewares.ExceptionHandling;
using Helpdesk.Api.Core.Http;
using Helpdesk.Api.Core.Kafka;
using Helpdesk.Api.Core.Marten;
Expand All @@ -14,6 +13,7 @@
using Marten.AspNetCore;
using Marten.Events;
using Marten.Events.Daemon.Resiliency;
using Marten.Events.Projections;
using Marten.Pagination;
using Marten.Schema.Identity;
using Marten.Storage;
Expand All @@ -34,8 +34,8 @@
builder.Services
.AddEndpointsApiExplorer()
.AddSwaggerGen()
.AddDefaultExceptionHandler()
.AddMarten(sp =>
//.AddDefaultExceptionHandler()
.AddMarten(_ =>
{
var options = new StoreOptions();

Expand All @@ -60,11 +60,11 @@
options.Projections.Errors.SkipSerializationErrors = false;
options.Projections.Errors.SkipUnknownEvents = false;

// options.Projections.LiveStreamAggregation<Incident>();
// options.Projections.Add<IncidentHistoryTransformation>(ProjectionLifecycle.Inline);
// options.Projections.Add<IncidentDetailsProjection>(ProjectionLifecycle.Inline);
// options.Projections.Add<IncidentShortInfoProjection>(ProjectionLifecycle.Inline);
// options.Projections.Add<CustomerIncidentsSummaryProjection>(ProjectionLifecycle.Async);
options.Projections.LiveStreamAggregation<Incident>();
options.Projections.Add<IncidentHistoryTransformation>(ProjectionLifecycle.Inline);
options.Projections.Add<IncidentDetailsProjection>(ProjectionLifecycle.Inline);
options.Projections.Add<IncidentShortInfoProjection>(ProjectionLifecycle.Inline);
options.Projections.Add<CustomerIncidentsSummaryProjection>(ProjectionLifecycle.Async);

options.ApplicationAssembly = typeof(CustomerIncidentsSummaryProjection).Assembly;

Expand Down

0 comments on commit 9d0fe9c

Please sign in to comment.