From 603f4c071dc3067b023e910d1aee67b966858df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Pe=C3=B1aranda?= Date: Fri, 2 Feb 2024 11:28:00 -0300 Subject: [PATCH] [tests] Check set handler throws if unauthorized. --- tests/test_daemon.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test_daemon.cpp b/tests/test_daemon.cpp index e157fb9d6ab..24202906b14 100644 --- a/tests/test_daemon.cpp +++ b/tests/test_daemon.cpp @@ -41,6 +41,7 @@ #include "tracking_url_downloader.h" #include +#include #include #include @@ -2126,10 +2127,16 @@ TEST_P(DaemonSetExceptions, setHandlesSettingsException) } INSTANTIATE_TEST_SUITE_P( - Daemon, DaemonSetExceptions, - Values(std::tuple{mp::UnrecognizedSettingException{"foo"}, grpc::StatusCode::INVALID_ARGUMENT, + Daemon, + DaemonSetExceptions, + Values(std::tuple{mp::NonAuthorizedBridgeSettingsException{"reason", "instance", "eth8"}, + grpc::StatusCode::INTERNAL, + HasSubstr("Need user authorization to bridge eth8")}, + std::tuple{mp::UnrecognizedSettingException{"foo"}, + grpc::StatusCode::INVALID_ARGUMENT, AllOf(HasSubstr("Unrecognized"), HasSubstr("foo"))}, - std::tuple{mp::InvalidSettingException{"foo", "bar", "err"}, grpc::StatusCode::INVALID_ARGUMENT, + std::tuple{mp::InvalidSettingException{"foo", "bar", "err"}, + grpc::StatusCode::INVALID_ARGUMENT, AllOf(HasSubstr("Invalid"), HasSubstr("foo"), HasSubstr("bar"), HasSubstr("err"))}, std::tuple{std::runtime_error{"Other"}, grpc::StatusCode::INTERNAL, HasSubstr("Other")}));