/**************************************************************************** ** ** This file is part of the KD Soap project. ** ** SPDX-FileCopyrightText: 2014 Klarälvdalens Datakonsult AB, a KDAB Group company ** ** SPDX-License-Identifier: MIT ** ****************************************************************************/ #include "httpserver_p.h" #include "wsdl_EnzoService.h" #include #include class TestEnzo : public QObject { Q_OBJECT public: explicit TestEnzo(); private slots: void test(); }; using namespace KDSoapUnitTestHelpers; TestEnzo::TestEnzo() { } static QByteArray authenticateResponse() { return QByteArray(xmlEnvBegin11()) + ">" // TODO "" + xmlEnvEnd(); } void TestEnzo::test() { HttpServerThread server(authenticateResponse(), HttpServerThread::Public); EnzoService service; service.setEndPoint(server.endPoint()); AuthenticateJob *job = new AuthenticateJob(&service); I0__Authenticate auth; Q2__AuthenticationRequest request; request.setHotelCode("hotel"); request.setPassWord("passWord"); request.setUserName("user"); auth.setRequest(request); job->setParameters(auth); QEventLoop loop; QObject::connect(job, &AuthenticateJob::finished, &loop, &QEventLoop::quit); job->start(); loop.exec(); const QByteArray expectedData = QByteArray(xmlEnvBegin11()) + ">" "" "" "hotel" "passWord" "user" "" ""; QVERIFY(xmlBufferCompare(server.receivedData(), expectedData)); } QTEST_MAIN(TestEnzo) #include "test_enzo.moc"