def test_terminate_process_not_started(self, mock_process_started,
                                           mock_process_terminate):
        service = ServiceOpenSearch(self.version, self.additional_config, True,
                                    self.dependency_installer, self.work_dir)

        service.terminate()

        mock_process_terminate.assert_not_called()
        mock_process_started.assert_called_once()
    def test_terminate(self, mock_process_stderr_data,
                       mock_process_stdout_data, mock_process_started,
                       mock_process_terminate):
        service = ServiceOpenSearch(self.version, self.additional_config, True,
                                    self.dependency_installer, self.work_dir)

        termination_result = service.terminate()

        mock_process_terminate.assert_called_once()

        self.assertEqual(termination_result.return_code, 123)
        self.assertEqual(termination_result.stdout_data, "test stdout_data")
        self.assertEqual(termination_result.stderr_data, "test stderr_data")
        self.assertEqual(
            termination_result.log_files, {
                "opensearch-service-logs":
                os.path.join("test_work_dir", "opensearch-1.1.0", "logs")
            })