Refactor serialization tests and remove unused dependencies
Updated object initialization in serialization tests for consistency and renamed `async void` methods to `async Task`. Removed unused `ISystemClock` dependency from OpenTelemetry middleware constructors to simplify implementation.
This commit is contained in:
parent
e10c95f4e2
commit
01d286b386
|
|
@ -14,7 +14,7 @@ namespace Elsa.OpenTelemetry.Middleware;
|
|||
|
||||
/// <inheritdoc />
|
||||
[UsedImplicitly]
|
||||
public class OpenTelemetryTracingActivityExecutionMiddleware(ActivityMiddlewareDelegate next, ISystemClock systemClock) : IActivityExecutionMiddleware
|
||||
public class OpenTelemetryTracingActivityExecutionMiddleware(ActivityMiddlewareDelegate next) : IActivityExecutionMiddleware
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public async ValueTask InvokeAsync(ActivityExecutionContext context)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Elsa.OpenTelemetry.Middleware;
|
|||
/// Middleware that traces workflow execution using OpenTelemetry.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareDelegate next, ISystemClock systemClock, IOptions<OpenTelemetryOptions> options) : WorkflowExecutionMiddleware(next)
|
||||
public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareDelegate next, IOptions<OpenTelemetryOptions> options) : WorkflowExecutionMiddleware(next)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override async ValueTask InvokeAsync(WorkflowExecutionContext context)
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ public class Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async void SerializeFlowchartContainerTest()
|
||||
public async Task SerializeFlowchartContainerTest()
|
||||
{
|
||||
await _services.PopulateRegistriesAsync();
|
||||
|
||||
// Arrange
|
||||
|
||||
var start = new Start()
|
||||
var start = new Start
|
||||
{
|
||||
Id = "start",
|
||||
Name = "Start",
|
||||
|
|
@ -39,39 +39,39 @@ public class Tests
|
|||
Name = "WriteLine",
|
||||
Version = 3,
|
||||
};
|
||||
var end = new End()
|
||||
var end = new End
|
||||
{
|
||||
Id = "end",
|
||||
Name = "end",
|
||||
};
|
||||
var container = new Flowchart()
|
||||
var container = new Flowchart
|
||||
{
|
||||
Id = "flowchart",
|
||||
Name = "Flowchart",
|
||||
Type = "Elsa.Flowchart",
|
||||
Version = 42,
|
||||
CustomProperties = new Dictionary<string, object>()
|
||||
CustomProperties = new Dictionary<string, object>
|
||||
{
|
||||
{ "purpose", "somePurpose" }
|
||||
},
|
||||
Metadata = new Dictionary<string, object>()
|
||||
Metadata = new Dictionary<string, object>
|
||||
{
|
||||
{ "int", 10 },
|
||||
{ "bool", false },
|
||||
{ "string", "str" },
|
||||
},
|
||||
Activities = new List<IActivity>() {
|
||||
Activities = new List<IActivity> {
|
||||
start,
|
||||
writeLine,
|
||||
end
|
||||
},
|
||||
Variables = new List<Variable>() {
|
||||
Variables = new List<Variable> {
|
||||
new Variable<string>("TextVar", "This is the text to write")
|
||||
},
|
||||
Connections = new List<Connection>()
|
||||
Connections = new List<Connection>
|
||||
{
|
||||
new Connection(start, writeLine),
|
||||
new Connection(writeLine, end),
|
||||
new(start, writeLine),
|
||||
new(writeLine, end),
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -92,16 +92,16 @@ public class Tests
|
|||
|
||||
// Arrange
|
||||
|
||||
var container = new Sequence()
|
||||
var container = new Sequence
|
||||
{
|
||||
Id = "sequence",
|
||||
Name = "Sequence",
|
||||
Type = "Elsa.Sequence",
|
||||
Version = 42,
|
||||
Variables = new List<Variable>() {
|
||||
Variables = new List<Variable> {
|
||||
new Variable<string>("TextVar", "This is the text to write")
|
||||
},
|
||||
Activities = new List<IActivity>() {
|
||||
Activities = new List<IActivity> {
|
||||
new WriteLine(new Input<string>(new Expression("JavaScript", "getVariable('TextVar')")))
|
||||
{
|
||||
Id = "writeLine",
|
||||
|
|
@ -109,11 +109,11 @@ public class Tests
|
|||
CanStartWorkflow = true,
|
||||
},
|
||||
},
|
||||
CustomProperties = new Dictionary<string, object>()
|
||||
CustomProperties = new Dictionary<string, object>
|
||||
{
|
||||
{ "purpose", "somePurpose" }
|
||||
},
|
||||
Metadata = new Dictionary<string, object>()
|
||||
Metadata = new Dictionary<string, object>
|
||||
{
|
||||
{ "int", 10 },
|
||||
{ "bool", false },
|
||||
|
|
@ -138,16 +138,16 @@ public class Tests
|
|||
|
||||
// Arrange
|
||||
|
||||
var container = new Workflows.Activities.Parallel()
|
||||
var container = new Workflows.Activities.Parallel
|
||||
{
|
||||
Id = "parallel",
|
||||
Name = "Parallel",
|
||||
Type = "Elsa.Parallel",
|
||||
Version = 42,
|
||||
Variables = new List<Variable>() {
|
||||
Variables = new List<Variable> {
|
||||
new Variable<string>("TextVar", "This is the text to write")
|
||||
},
|
||||
Activities = new List<IActivity>() {
|
||||
Activities = new List<IActivity> {
|
||||
new WriteLine(new Input<string>(new Expression("JavaScript", "getVariable('TextVar')")))
|
||||
{
|
||||
Id = "writeLine",
|
||||
|
|
@ -155,11 +155,11 @@ public class Tests
|
|||
CanStartWorkflow = true,
|
||||
},
|
||||
},
|
||||
CustomProperties = new Dictionary<string, object>()
|
||||
CustomProperties = new Dictionary<string, object>
|
||||
{
|
||||
{ "purpose", "somePurpose" }
|
||||
},
|
||||
Metadata = new Dictionary<string, object>()
|
||||
Metadata = new Dictionary<string, object>
|
||||
{
|
||||
{ "int", 10 },
|
||||
{ "bool", false },
|
||||
|
|
|
|||
Loading…
Reference in a new issue