diff --git a/services/tunnelbroker/test/DatabaseManagerTest.cpp b/services/tunnelbroker/test/DatabaseManagerTest.cpp --- a/services/tunnelbroker/test/DatabaseManagerTest.cpp +++ b/services/tunnelbroker/test/DatabaseManagerTest.cpp @@ -22,3 +22,21 @@ Aws::ShutdownAPI({}); } }; + +TEST_F(DatabaseManagerTest, TestOperationsOnSessionSignItem) { + const database::SessionSignItem item( + tools::generateRandomString(SIGNATURE_REQUEST_LENGTH), + "mobile:" + tools::generateRandomString(DEVICEID_CHAR_LENGTH)); + EXPECT_EQ( + database::DatabaseManager::getInstance().isTableAvailable( + item.getTableName()), + true); + database::DatabaseManager::getInstance().putSessionSignItem(item); + std::shared_ptr foundItem = + database::DatabaseManager::getInstance().findSessionSignItem( + item.getDeviceID()); + EXPECT_NE(foundItem, nullptr); + EXPECT_EQ(item.getSign(), foundItem->getSign()); + database::DatabaseManager::getInstance().removeSessionSignItem( + item.getDeviceID()); +}