Fix experiments in BackupAuthManager

This commit is contained in:
Ravi Khadiwala
2024-03-19 15:49:45 -05:00
committed by ravi-signal
parent a9b5359f7c
commit e7d1eadf8e
3 changed files with 12 additions and 13 deletions

View File

@@ -7,6 +7,7 @@ package org.whispersystems.textsecuregcm.tests.util;
import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicConfiguration;
import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicExperimentEnrollmentConfiguration;
import org.whispersystems.textsecuregcm.experiment.ExperimentEnrollmentManager;
import org.whispersystems.textsecuregcm.storage.DynamicConfigurationManager;
import java.util.Optional;
import java.util.Set;
@@ -17,7 +18,7 @@ import static org.mockito.Mockito.when;
public class ExperimentHelper {
public static DynamicConfigurationManager<DynamicConfiguration> withEnrollment(
private static DynamicConfigurationManager<DynamicConfiguration> withEnrollment(
final String experimentName,
final Set<UUID> enrolledUuids,
final int enrollmentPercentage) {
@@ -31,11 +32,11 @@ public class ExperimentHelper {
return dcm;
}
public static DynamicConfigurationManager<DynamicConfiguration> withEnrollment(final String experimentName, final Set<UUID> enrolledUuids) {
return withEnrollment(experimentName, enrolledUuids, 0);
public static ExperimentEnrollmentManager withEnrollment(final String experimentName, final Set<UUID> enrolledUuids) {
return new ExperimentEnrollmentManager(withEnrollment(experimentName, enrolledUuids, 0));
}
public static DynamicConfigurationManager<DynamicConfiguration> withEnrollment(final String experimentName, final UUID enrolledUuid) {
return withEnrollment(experimentName, Set.of(enrolledUuid), 0);
public static ExperimentEnrollmentManager withEnrollment(final String experimentName, final UUID enrolledUuid) {
return new ExperimentEnrollmentManager(withEnrollment(experimentName, Set.of(enrolledUuid), 0));
}
}