@@ -46,6 +46,51 @@ def test_async_operations(process):
4646 timeout , completion_key
4747 )
4848
49+ def test_send_request_async_response_required_boolean_conversion (process ):
50+ """Test that response_required boolean is correctly converted to int (0 or 1) for Iris API."""
51+ target = "target_service"
52+ request = SimpleMessage (integer = 1 , string = 'test' )
53+
54+ # Test with response_required=True (should be converted to 1)
55+ process .send_request_async (target , request , response_required = True )
56+ args , kwargs = process .iris_handle .dispatchSendRequestAsync .call_args
57+ # args[0] = target, args[1] = request (serialized), args[2] = response_required, args[3] = completion_key, args[4] = description
58+ assert args [2 ] == 1 , "response_required=True should be converted to 1"
59+ assert args [0 ] == target , "Target should be passed correctly"
60+
61+ # Reset mock
62+ process .iris_handle .reset_mock ()
63+
64+ # Test with response_required=False (should be converted to 0)
65+ process .send_request_async (target , request , response_required = False )
66+ args , kwargs = process .iris_handle .dispatchSendRequestAsync .call_args
67+ assert args [2 ] == 0 , "response_required=False should be converted to 0"
68+ assert args [0 ] == target , "Target should be passed correctly"
69+
70+ # Reset mock
71+ process .iris_handle .reset_mock ()
72+
73+ # Test default value (should be True, converted to 1)
74+ process .send_request_async (target , request )
75+ args , kwargs = process .iris_handle .dispatchSendRequestAsync .call_args
76+ assert args [2 ] == 1 , "Default response_required should be True (converted to 1)"
77+
78+ # Verify all parameters are passed correctly with response_required=False
79+ process .iris_handle .reset_mock ()
80+ description = "Test description"
81+ completion_key = "test_key"
82+ process .send_request_async (
83+ target , request ,
84+ description = description ,
85+ completion_key = completion_key ,
86+ response_required = False
87+ )
88+ args , kwargs = process .iris_handle .dispatchSendRequestAsync .call_args
89+ assert args [0 ] == target , "Target should be passed correctly"
90+ assert args [2 ] == 0 , "response_required=False should be converted to 0"
91+ assert args [3 ] == completion_key , "Completion key should be passed correctly"
92+ assert args [4 ] == description , "Description should be passed correctly"
93+
4994def test_persistent_properties ():
5095 # Test persistent property handling
5196 class ProcessWithProperties (_BusinessProcess ):
0 commit comments