Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame^] | 1 | #include "token_authorization_middleware.hpp" |
| 2 | #include <crow/app.h> |
| 3 | #include "gtest/gtest.h" |
| 4 | |
| 5 | |
| 6 | // Tests that Base64 basic strings work |
| 7 | TEST(Authentication, TestBasicReject) |
| 8 | { |
| 9 | crow::App<crow::TokenAuthorizationMiddleware> app; |
| 10 | crow::request req; |
| 11 | crow::response res; |
| 12 | app.handle(req, res); |
| 13 | ASSERT_EQ(res.code, 400); |
| 14 | |
| 15 | |
| 16 | crow::App<crow::TokenAuthorizationMiddleware> app; |
| 17 | decltype(app)::server_t server(&app, "127.0.0.1", 45451); |
| 18 | CROW_ROUTE(app, "/")([&](const crow::request& req) |
| 19 | { |
| 20 | app.get_context<NullMiddleware>(req); |
| 21 | app.get_context<NullSimpleMiddleware>(req); |
| 22 | return ""; |
| 23 | }); |
| 24 | } |
| 25 | |
| 26 | |