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