Azure Logic Apps (Standard) 5.961.19
Microsoft.Azure.Workflows.WebJobs.Tests.Extension 1.0.3
Describe the Bug
When unit testing a workflow containing a null equality check for an object variable, the test will fail stating an internal server error with no other details.
Plan Type
Local
Steps to Reproduce the Bug or Issue
- Create an HTTP workflow with an object variable, and a conditional check for the variable to equal null
- Run workflow and observe success
- Create a basic unit test to check for success
- Observe that the unit test fails
Workflow JSON
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"actions": {
"Initialize_variables": {
"type": "InitializeVariable",
"inputs": {
"variables": [
{
"name": "PossiblyNullObject",
"type": "object"
}
]
},
"runAfter": {}
},
"test_Resp": {
"type": "Response",
"kind": "Http",
"inputs": {
"statusCode": 200
},
"runAfter": {
"Condition": [
"SUCCEEDED"
]
},
"operationOptions": "Asynchronous"
},
"Condition": {
"type": "If",
"expression": {
"and": [
{
"equals": [
"@variables('PossiblyNullObject')",
"@null"
]
}
]
},
"actions": {},
"else": {
"actions": {}
},
"runAfter": {
"Initialize_variables": [
"SUCCEEDED"
]
}
}
},
"outputs": {},
"triggers": {
"test_req": {
"type": "Request",
"kind": "Http",
"inputs": {
"method": "GET",
"schema": {}
}
}
}
},
"kind": "Stateful"
}
Screenshots or Videos
No response
Additional context
[TestMethod]
public async Task Test_PossiblyNullObjectCondition_WorkflowSucceeds()
{
var triggerMock = new TriggerMock(status: TestWorkflowStatus.Succeeded, name: "test_req", outputs: (MockOutput)null);
var testRun = await this.TestExecutor.Create()
.RunWorkflowAsync(testMock: new TestMockDefinition(
triggerMock: triggerMock,
actionMocks: new Dictionary<string, ActionMock>()))
.ConfigureAwait(false);
Assert.IsNotNull(testRun);
Assert.AreEqual(TestWorkflowStatus.Succeeded, testRun.Status);
}
Azure Logic Apps (Standard) 5.961.19
Microsoft.Azure.Workflows.WebJobs.Tests.Extension 1.0.3
Describe the Bug
When unit testing a workflow containing a null equality check for an object variable, the test will fail stating an internal server error with no other details.
Plan Type
Local
Steps to Reproduce the Bug or Issue
Workflow JSON
{ "definition": { "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "contentVersion": "1.0.0.0", "actions": { "Initialize_variables": { "type": "InitializeVariable", "inputs": { "variables": [ { "name": "PossiblyNullObject", "type": "object" } ] }, "runAfter": {} }, "test_Resp": { "type": "Response", "kind": "Http", "inputs": { "statusCode": 200 }, "runAfter": { "Condition": [ "SUCCEEDED" ] }, "operationOptions": "Asynchronous" }, "Condition": { "type": "If", "expression": { "and": [ { "equals": [ "@variables('PossiblyNullObject')", "@null" ] } ] }, "actions": {}, "else": { "actions": {} }, "runAfter": { "Initialize_variables": [ "SUCCEEDED" ] } } }, "outputs": {}, "triggers": { "test_req": { "type": "Request", "kind": "Http", "inputs": { "method": "GET", "schema": {} } } } }, "kind": "Stateful" }Screenshots or Videos
No response
Additional context