Skip to content

Commit

Permalink
test: added unit test for the UpdateJobTimeoutCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
LennartKleymann committed May 22, 2024
1 parent 29d0799 commit 7b69dc7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Client.UnitTests/GatewayTestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public GatewayTestService()
typedRequestHandler.Add(typeof(CompleteJobRequest), request => new CompleteJobResponse());
typedRequestHandler.Add(typeof(FailJobRequest), request => new FailJobResponse());
typedRequestHandler.Add(typeof(UpdateJobRetriesRequest), request => new UpdateJobRetriesResponse());
typedRequestHandler.Add(typeof(UpdateJobTimeoutRequest), request => new UpdateJobTimeoutResponse());
typedRequestHandler.Add(typeof(ThrowErrorRequest), request => new ThrowErrorResponse());

typedRequestHandler.Add(typeof(DeployResourceRequest), request => new DeployResourceResponse());
Expand Down Expand Up @@ -106,6 +107,11 @@ public override Task<UpdateJobRetriesResponse> UpdateJobRetries(UpdateJobRetries
return Task.FromResult((UpdateJobRetriesResponse)HandleRequest(request, context));
}

public override Task<UpdateJobTimeoutResponse> UpdateJobTimeout(UpdateJobTimeoutRequest request, ServerCallContext context)
{
return Task.FromResult((UpdateJobTimeoutResponse)HandleRequest(request, context));
}

public override Task<ThrowErrorResponse> ThrowError(ThrowErrorRequest request, ServerCallContext context)
{
return Task.FromResult((ThrowErrorResponse)HandleRequest(request, context));
Expand Down
9 changes: 9 additions & 0 deletions Client.UnitTests/TestDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ public static IEnumerable<TestCaseData> Provider()
new EvaluateDecisionResponse(),
(RequestCreator<IEvaluateDecisionResponse>)
(zeebeClient => zeebeClient.NewEvaluateDecisionCommand().DecisionId("decision")));
yield return new TestCaseData(
new UpdateJobTimeoutRequest()
{
JobKey = 12113L,
Timeout = 20000
}, new UpdateJobTimeoutResponse(),
(RequestCreator<IUpdateJobTimeoutResponse>)
(zeebeClient => zeebeClient.NewUpdateJobTimeoutCommand(12113L)
.Timeout(new TimeSpan(0, 0, 0, 20))));
}
}
}

0 comments on commit 7b69dc7

Please sign in to comment.