/**************************************************************************** ** ** This file is part of the KD Soap project. ** ** SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company ** ** SPDX-License-Identifier: MIT ** ****************************************************************************/ #include "KDSoapClientInterface.h" #include "KDSoapMessage.h" #include "KDSoapPendingCallWatcher.h" #include "KDSoapValue.h" #include "httpserver_p.h" #include "wsdl_unqualified.h" #include #include #include using namespace KDSoapUnitTestHelpers; class UnqualifiedTest : public QObject { Q_OBJECT private Q_SLOTS: void initTestCase() { } void testRequest() { HttpServerThread server(queryResponse(), HttpServerThread::Public); ExampleService service(this); service.setEndPoint(server.endPoint()); // prepare instances CFWT__Authenticate req; req.setName("MyUser"); req.setPhrase("Adsadsda asdasd asda"); CFWT__MyAuthenticate auth; auth.setRequest(req); service.myAuthenticate(auth); // Check what we sent QByteArray expectedRequestXml = QByteArray(xmlEnvBegin11()) + ">" "" "" "" "MyUser" "Adsadsda asdasd asda" "" "" "" + xmlEnvEnd() + '\n'; // added by QXmlStreamWriter::writeEndDocument QVERIFY(xmlBufferCompare(server.receivedData(), expectedRequestXml)); } private: static QByteArray queryResponse() { return QByteArray(xmlEnvBegin11()) + " xmlns:sf=\"urn:sobject.partner.soap.sforce.com\">" "" // TODO "" "" + xmlEnvEnd(); } }; QTEST_MAIN(UnqualifiedTest) #include "test_unqualified.moc"