Clean up testing with clocks.

This commit is contained in:
erik-signal
2022-10-21 12:39:47 -04:00
committed by GitHub
parent 0c357bc340
commit fe60cf003f
9 changed files with 133 additions and 52 deletions

View File

@@ -37,21 +37,19 @@ import org.whispersystems.textsecuregcm.entities.Badge;
import org.whispersystems.textsecuregcm.entities.BadgeSvg;
import org.whispersystems.textsecuregcm.entities.SelfBadge;
import org.whispersystems.textsecuregcm.storage.AccountBadge;
import org.whispersystems.textsecuregcm.util.TestClock;
public class ConfiguredProfileBadgeConverterTest {
private Clock clock;
private final Clock clock = TestClock.pinned(Instant.ofEpochSecond(42));
private ResourceBundleFactory resourceBundleFactory;
private ResourceBundle resourceBundle;
@BeforeEach
private void beforeEach() {
clock = mock(Clock.class);
resourceBundleFactory = mock(ResourceBundleFactory.class, (invocation) -> {
throw new UnsupportedOperationException();
});
when(clock.instant()).thenReturn(Instant.ofEpochSecond(42));
}
private static String idFor(int i) {