| 31 | using namespace testing; |
| 32 | |
| 33 | TEST(BridgeConfig, refresh) |
| 34 | { |
| 35 | auto handler = std::make_shared<MockHttpHandler>(); |
| 36 | HueCommandAPI commands(getBridgeIp(), getBridgePort(), getBridgeUsername(), handler); |
| 37 | auto baseCache = std::make_shared<APICache>("", commands, std::chrono::steady_clock::duration::max(), nullptr); |
| 38 | EXPECT_CALL( |
| 39 | *handler, GETJson("/api/" + getBridgeUsername(), nlohmann::json::object(), getBridgeIp(), getBridgePort())) |
| 40 | .WillOnce(Return(nlohmann::json::object())); |
| 41 | baseCache->refresh(); |
| 42 | BridgeConfig config(baseCache, std::chrono::steady_clock::duration::max()); |
| 43 | |
| 44 | EXPECT_CALL(*handler, |
| 45 | GETJson("/api/" + getBridgeUsername() + "/config", nlohmann::json::object(), getBridgeIp(), getBridgePort())) |
| 46 | .WillOnce(Return(nlohmann::json::object())); |
| 47 | config.refresh(true); |
| 48 | } |
| 49 | |
| 50 | TEST(BridgeConfig, getWhitelistedUsers) |
| 51 | { |
nothing calls this directly
no test coverage detected