martinzink commented on code in PR #1457: URL: https://github.com/apache/nifi-minifi-cpp/pull/1457#discussion_r1066880102
########## extensions/standard-processors/tests/unit/ListenTcpTests.cpp: ########## @@ -134,60 +147,64 @@ TEST_CASE("Test ListenTCP with SSL connection", "[ListenTCP][NetworkListenerProc SECTION("Without client certificate verification") { SECTION("Client certificate not required, Client Auth set to NONE by default") { + ssl_context_service->enable(); + port = scheduleProcessorOnRandomPort(controller, listen_tcp); SECTION("sending through IPv4", "[IPv4]") { - endpoint = asio::ip::tcp::endpoint(asio::ip::address_v4::loopback(), PORT); + endpoint = asio::ip::tcp::endpoint(asio::ip::address_v4::loopback(), port); } SECTION("sending through IPv6", "[IPv6]") { if (utils::isIPv6Disabled()) return; - endpoint = asio::ip::tcp::endpoint(asio::ip::address_v6::loopback(), PORT); + endpoint = asio::ip::tcp::endpoint(asio::ip::address_v6::loopback(), port); } } SECTION("Client certificate not required, but validated if provided") { REQUIRE(controller.plan->setProperty(listen_tcp, ListenTCP::ClientAuth.getName(), "WANT")); + ssl_context_service->enable(); + port = scheduleProcessorOnRandomPort(controller, listen_tcp); SECTION("sending through IPv4", "[IPv4]") { - endpoint = asio::ip::tcp::endpoint(asio::ip::address_v4::loopback(), PORT); + endpoint = asio::ip::tcp::endpoint(asio::ip::address_v4::loopback(), port); } SECTION("sending through IPv6", "[IPv6]") { if (utils::isIPv6Disabled()) return; - endpoint = asio::ip::tcp::endpoint(asio::ip::address_v6::loopback(), PORT); + endpoint = asio::ip::tcp::endpoint(asio::ip::address_v6::loopback(), port); } } - ssl_context_service->enable(); - controller.plan->scheduleProcessor(listen_tcp); expected_successful_messages = {"test_message_1", "another_message"}; for (const auto& message: expected_successful_messages) { - REQUIRE(utils::sendMessagesViaSSL({message}, endpoint, minifi::utils::file::concat_path(executable_dir, "resources/ca_A.crt"))); + check_no_error(utils::sendMessagesViaSSL({message}, endpoint, minifi::utils::file::concat_path(executable_dir, "resources/ca_A.crt"))); Review Comment: I've sidestepped the issue by creating a MatchesSuccess Matcher and use that. https://github.com/apache/nifi-minifi-cpp/commit/fb2cba6cb1b8eab262e1d17b5d67d69ed0e1e9a3 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org