diff --git a/source/Octopus.Tentacle.Tests.Integration/ClientScriptExecutionCanRecoverFromNetworkIssues.cs b/source/Octopus.Tentacle.Tests.Integration/ClientScriptExecutionCanRecoverFromNetworkIssues.cs index 747b10fb2..d9259e5fa 100644 --- a/source/Octopus.Tentacle.Tests.Integration/ClientScriptExecutionCanRecoverFromNetworkIssues.cs +++ b/source/Octopus.Tentacle.Tests.Integration/ClientScriptExecutionCanRecoverFromNetworkIssues.cs @@ -239,7 +239,11 @@ await clientTentacle.TentacleClient.ExecuteScript(startScriptCommand, actualException = ex; } - actualException.Should().NotBeNull().And.BeOfType().And.Match(x => x.Message == "Script execution was cancelled"); + var expectedException = new ExceptionContractAssertionBuilder(FailureScenario.ScriptExecutionCancelled, tentacleConfigurationTestCase, clientTentacle) + .ForScriptService(ScriptServiceOperation.CancelScript).Build(); + + actualException.Should().NotBeNull(); + actualException!.ShouldMatchExceptionContract(expectedException); var allLogs = logs.JoinLogs(); allLogs.Should().Contain("hello");