/**************************************************************************** ** ** 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 "wsdl_WS_DV_TerminalAuth.h" #include "httpserver_p.h" #include #include #include #include #include #include using namespace KDSoapUnitTestHelpers; class TestDVTerminalAuth : public QObject { Q_OBJECT private: static QByteArray expectedGetCACertRequest() { return QByteArray(xmlEnvBegin11()) + ">" "" "" "callback_not_possible" "" "" "" "" + xmlEnvEnd() + '\n'; // added by QXmlStreamWriter::writeEndDocument; } static QByteArray getCACertResponse() { return "" "ok_cert_available" + QByteArray("XXXYYYZZZ").toBase64() + ""; } private Q_SLOTS: void testGetCACertificates() { HttpServerThread server(getCACertResponse(), HttpServerThread::Public); EAC_DV_ProtocolService service; service.setEndPoint(server.endPoint()); NS__CallbackIndicatorType indicator; indicator.setType(NS__CallbackIndicatorType::Callback_not_possible); NS__OptionalMessageIDType messageId; NS__OptionalStringType responseURL; NS__GetCACertificatesResult result = service.getCACertificates(indicator, messageId, responseURL); // Check what we sent { QVERIFY(xmlBufferCompare(server.receivedData(), expectedGetCACertRequest())); QCOMPARE(QString::fromUtf8(server.receivedData().constData()), QString::fromUtf8(expectedGetCACertRequest().constData())); QCOMPARE(server.header("SoapAction").constData(), "\"\""); // SOAP-135 } QCOMPARE(NS__GetCACertificates_returnCodeType::Type(result.returnCode()), NS__GetCACertificates_returnCodeType::Ok_cert_available); QCOMPARE(result.certificateSeq().certificate(), QList() << QByteArray("XXXYYYZZZ")); } }; QTEST_MAIN(TestDVTerminalAuth) #include "test_dv_terminalauth.moc"