< Summary

Information
Class: Elsa.Http.Handlers.UpdateRouteTable
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Handlers/UpdateRouteTable.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 29
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
HandleAsync()100%11100%
HandleAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Handlers/UpdateRouteTable.cs

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2using Elsa.Workflows.Runtime.Notifications;
 3using JetBrains.Annotations;
 4
 5namespace Elsa.Http.Handlers;
 6
 7/// <summary>
 8/// A handler that updates the route table when workflow triggers and bookmarks are indexed.
 9/// </summary>
 10[UsedImplicitly]
 32311public class UpdateRouteTable(IRouteTableUpdater routeTableUpdater) :
 12    INotificationHandler<WorkflowTriggersIndexed>,
 13    INotificationHandler<WorkflowBookmarksIndexed>
 14{
 15    /// <inheritdoc />
 16    public async Task HandleAsync(WorkflowTriggersIndexed notification, CancellationToken cancellationToken)
 17    {
 49218        routeTableUpdater.RemoveRoutes(notification.IndexedWorkflowTriggers.RemovedTriggers);
 49219        await routeTableUpdater.AddRoutesAsync(notification.IndexedWorkflowTriggers.AddedTriggers, cancellationToken);
 49220        await routeTableUpdater.AddRoutesAsync(notification.IndexedWorkflowTriggers.UnchangedTriggers, cancellationToken
 49221    }
 22
 23    /// <inheritdoc />
 24    public async Task HandleAsync(WorkflowBookmarksIndexed notification, CancellationToken cancellationToken)
 25    {
 32526        routeTableUpdater.RemoveRoutes(notification.IndexedWorkflowBookmarks.RemovedBookmarks);
 32527        await routeTableUpdater.AddRoutesAsync(notification.IndexedWorkflowBookmarks.AddedBookmarks, notification.Indexe
 32528    }
 29}