diff --git a/tests/integration_test/chat_service_test.py b/tests/integration_test/chat_service_test.py index 288048f4e..3ac1eaa79 100644 --- a/tests/integration_test/chat_service_test.py +++ b/tests/integration_test/chat_service_test.py @@ -395,14 +395,17 @@ def test_business_messages_without_message(mock_process_message, mock_check_mess @patch("kairon.chat.handlers.channels.business_messages.BusinessMessagesHandler.check_message_create_time") +@patch("kairon.chat.agent_processor.AgentProcessor.reload") +@patch("kairon.chat.agent_processor.AgentProcessor.cache_provider.get") @patch('oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_dict') @patch('businessmessages.businessmessages_v1_client.BusinessmessagesV1') -def test_business_messages_with_valid_data(mock_business_messages, mock_credentials, +def test_business_messages_with_valid_data(mock_business_messages, mock_credentials, mock_get_agent, mock_reload, mock_check_message_create_time): mock_check_message_create_time.return_value = True + mock_get_agent.return_value = KaironAgent mock_credentials.return_value = {} mock_business_messages.return_value = {} - with patch.object(Agent, "handle_message") as mock_agent: + with patch.object(KaironAgent, "handle_message") as mock_agent: mock_agent.side_effect = mock_agent_response response = client.post( f"/api/bot/business_messages/{bot}/{token}",