Generate FakeFeatureFlagsImpl in test mode

Before FeatureFlagsImpl will be used as a fake for testing. This change
adds new class FakeFeatureFlagsImpl. The FeatureFlagsImpl will keep the
same as production. FakeFeatureFlagsImpl can be used as fake for
testing.

FakeFeatureFlagsImpl, and FeatureFlagsImpl will be generated in both
test and prod mode. In test mode FeatureFlagsImpl will just be a stub,
and in prod mode FakeFeatureFlagsImpl will just be a stub.

Bug: 280833463
Test: atest aconfig.test
Change-Id: I11c1e716a9ea00d55600e5e9d5fb6442420762e6
This commit is contained in:
Zhi Dou
2023-08-07 22:54:13 +00:00
parent 1afb7ffec2
commit 5aaeee3749
4 changed files with 140 additions and 58 deletions

View File

@@ -10,11 +10,11 @@ public final class Flags \{
}
{{ endfor }}
{{ -if is_test_mode }}
public static void setFeatureFlagsImpl(FeatureFlags featureFlags) \{
public static void setFeatureFlags(FeatureFlags featureFlags) \{
Flags.FEATURE_FLAGS = featureFlags;
}
public static void unsetFeatureFlagsImpl() \{
public static void unsetFeatureFlags() \{
Flags.FEATURE_FLAGS = null;
}
{{ endif}}