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 @@ -21,7 +21,7 @@ virtual void TearDown() { Aws::ShutdownAPI({}); } -}; +} TEST_F(DatabaseManagerTest, PutAndFoundMessageItemsStaticDataIsSame) { const database::MessageItem item( @@ -38,6 +38,7 @@ "6d37StvXBzfJoZVU79UeOF2bFvb3DNoArEOe", "7s6ZUSDoFfZe3eJWQ15ngYhgMw1TsfbECnMVQTYvY6OyqWPBQi5wiftFcluoxor8", static_cast(std::time(0)) + 600); + const size_t currentTimestamp = static_cast(std::time(0)); EXPECT_EQ( database::DatabaseManager::getInstance().isTableAvailable( item.getTableName()), @@ -52,6 +53,7 @@ EXPECT_EQ(item.getPayload(), foundItem->getPayload()); EXPECT_EQ(item.getBlobHashes(), foundItem->getBlobHashes()); EXPECT_EQ(item.getExpire(), foundItem->getExpire()); + EXPECT_EQ(foundItem->getCreatedAt() >= currentTimestamp, true); database::DatabaseManager::getInstance().removeMessageItem( item.getMessageID()); }