@@ -62,6 +62,7 @@ CSP_PUBLIC_TEST(CSPEngine, QuotaSystemTests, TierFeatureEnumTesttoStringTest)
6262 EXPECT_EQ (TierFeatureEnumToString (csp::systems::TierFeatures::SpaceOwner), " SpaceOwner" );
6363 EXPECT_EQ (TierFeatureEnumToString (csp::systems::TierFeatures::TicketedSpace), " TicketedSpace" );
6464 EXPECT_EQ (TierFeatureEnumToString (csp::systems::TierFeatures::TotalUploadSizeInKilobytes), " TotalUploadSizeInKilobytes" );
65+ EXPECT_EQ (TierFeatureEnumToString (csp::systems::TierFeatures::GoogleGenAI), " GoogleGenAI" );
6566}
6667
6768CSP_PUBLIC_TEST (CSPEngine, QuotaSystemTests, StringToTierFeatureEnumTestTest)
@@ -75,6 +76,7 @@ CSP_PUBLIC_TEST(CSPEngine, QuotaSystemTests, StringToTierFeatureEnumTestTest)
7576 EXPECT_EQ (StringToTierFeatureEnum (" SpaceOwner" ), csp::systems::TierFeatures::SpaceOwner);
7677 EXPECT_EQ (StringToTierFeatureEnum (" TicketedSpace" ), csp::systems::TierFeatures::TicketedSpace);
7778 EXPECT_EQ (StringToTierFeatureEnum (" TotalUploadSizeInKilobytes" ), csp::systems::TierFeatures::TotalUploadSizeInKilobytes);
79+ EXPECT_EQ (StringToTierFeatureEnum (" GoogleGenAI" ), csp::systems::TierFeatures::GoogleGenAI);
7880}
7981
8082CSP_PUBLIC_TEST (CSPEngine, QuotaSystemTests, GetTotalSpacesOwnedByUserTest)
@@ -210,31 +212,54 @@ CSP_PUBLIC_TEST(CSPEngine, QuotaSystemTests, GetTierFeaturesQuota)
210212 auto UserSystem = SystemsManager.GetUserSystem ();
211213 auto QuotaSystem = SystemsManager.GetQuotaSystem ();
212214
213- csp::common::Array<FeatureQuotaInfo> ExpectedInfoArray
214- = { FeatureQuotaInfo (TierFeatures::SpaceOwner, TierNames::Basic, 3 , PeriodEnum::Total, true ),
215- FeatureQuotaInfo (TierFeatures::ScopeConcurrentUsers, TierNames::Basic, 5 , PeriodEnum::Hours24, true ),
216- FeatureQuotaInfo (TierFeatures::ObjectCaptureUpload, TierNames::Basic, 5 , PeriodEnum::CalendarMonth, false ),
217- FeatureQuotaInfo (TierFeatures::AudioVideoUpload, TierNames::Basic, -1 , PeriodEnum::Total, false ),
218- FeatureQuotaInfo (TierFeatures::TotalUploadSizeInKilobytes, TierNames::Basic, 10000000 , PeriodEnum::Total, true ),
219- FeatureQuotaInfo (TierFeatures::Agora, TierNames::Basic, 0 , PeriodEnum::Total, false ),
220- FeatureQuotaInfo (TierFeatures::OpenAI, TierNames::Basic, 0 , PeriodEnum::Total, false ),
221- FeatureQuotaInfo (TierFeatures::Shopify, TierNames::Basic, 0 , PeriodEnum::Total, false ),
222- FeatureQuotaInfo (TierFeatures::TicketedSpace, TierNames::Basic, 0 , PeriodEnum::Total, false ) };
215+ csp::common::Array<TierFeatures> TierFeaturesArray = { TierFeatures::SpaceOwner, TierFeatures::ScopeConcurrentUsers,
216+ TierFeatures::ObjectCaptureUpload, TierFeatures::AudioVideoUpload, TierFeatures::TotalUploadSizeInKilobytes, TierFeatures::Agora,
217+ TierFeatures::OpenAI, TierFeatures::Shopify, TierFeatures::TicketedSpace };
223218
224219 csp::common::String UserId;
225220 LogInAsNewTestUser (UserSystem, UserId);
226221
227222 auto [Result] = AWAIT_PRE (QuotaSystem, GetTierFeaturesQuota, RequestPredicate, TierNames::Basic);
228223
229224 EXPECT_EQ (Result.GetResultCode (), csp::systems::EResultCode::Success);
230- EXPECT_EQ (Result.GetFeaturesQuotaInfo ().Size (), ExpectedInfoArray.Size ());
225+
226+ // Please note: In service of OF-1805 a new TierFeature 'GoogleGenAI' was added in CSP to the 'TierFeatures' enum.
227+ // However, until this has also been added by the backend services, calls to 'GetTierFeaturesQuota()' will not return this feature.
228+ // The following test has been temporaily modified to account for this. Once this work has been completed, and the backend
229+ // services have added this tier feature, this test should be reverted to its original form (though with the addition of the new
230+ // feature in the 'TierFeaturesArray' array).
231+ bool IsGoogleGenAITierFeatureEnabled = false ;
231232
232233 for (size_t i = 0 ; i < Result.GetFeaturesQuotaInfo ().Size (); i++)
233234 {
234- EXPECT_EQ (Result.GetFeaturesQuotaInfo ()[i].FeatureName , ExpectedInfoArray[i].FeatureName );
235- EXPECT_EQ (Result.GetFeaturesQuotaInfo ()[i].TierName , ExpectedInfoArray[i].TierName );
236- EXPECT_EQ (Result.GetFeaturesQuotaInfo ()[i].Limit , ExpectedInfoArray[i].Limit );
237- EXPECT_EQ (Result.GetFeaturesQuotaInfo ()[i].Period , ExpectedInfoArray[i].Period );
235+ if (Result.GetFeaturesQuotaInfo ()[i].FeatureName == TierFeatures::GoogleGenAI)
236+ {
237+ IsGoogleGenAITierFeatureEnabled = true ;
238+ break ;
239+ }
240+ }
241+
242+ if (IsGoogleGenAITierFeatureEnabled)
243+ {
244+ EXPECT_EQ (Result.GetFeaturesQuotaInfo ().Size (), TierFeaturesArray.Size () + 1 );
245+ }
246+ else
247+ {
248+ EXPECT_EQ (Result.GetFeaturesQuotaInfo ().Size (), TierFeaturesArray.Size ());
249+ }
250+
251+ // We do not validate the full FeatureQuotaInfo object here as its data is subject to change.
252+ for (size_t i = 0 ; i < Result.GetFeaturesQuotaInfo ().Size (); i++)
253+ {
254+ if (IsGoogleGenAITierFeatureEnabled)
255+ {
256+ if (i == Result.GetFeaturesQuotaInfo ().Size () - 1 )
257+ {
258+ EXPECT_EQ (Result.GetFeaturesQuotaInfo ()[i].FeatureName , TierFeatures::GoogleGenAI);
259+ break ;
260+ }
261+ }
262+ EXPECT_EQ (Result.GetFeaturesQuotaInfo ()[i].FeatureName , TierFeaturesArray[i]);
238263 }
239264}
240265
@@ -245,9 +270,6 @@ CSP_PUBLIC_TEST(CSPEngine, QuotaSystemTests, GetConcurrentUsersInSpace)
245270 auto QuotaSystem = SystemsManager.GetQuotaSystem ();
246271 auto SpaceSystem = SystemsManager.GetSpaceSystem ();
247272
248- csp::common::Array<TierFeatures> TierFeaturesArray = { TierFeatures::SpaceOwner, TierFeatures::ObjectCaptureUpload,
249- TierFeatures::AudioVideoUpload, TierFeatures::OpenAI, TierFeatures::TicketedSpace };
250-
251273 const char * TestSpaceName = " CSP-UNITTEST-SPACE-MAG" ;
252274 const char * TestSpaceDescription = " CSP-UNITTEST-SPACEDESC-MAG" ;
253275
0 commit comments