mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 11:56:53 +00:00
Convert DynamicRemoteDeprecationConfiguration to a record
This commit is contained in:
1 parent
71bc23ed02
commit
04c102e51f
5 files changed
+47
-73
No files matched your search
+4
-4
@@ -236,12 +236,12 @@ class DynamicConfigurationTest {
|
||||
.getRemoteDeprecationConfiguration();
|
||||
|
||||
assertEquals(Map.of(ClientPlatform.IOS, new Semver("1.2.3"), ClientPlatform.ANDROID, new Semver("4.5.6")),
|
||||
remoteDeprecationConfiguration.getMinimumVersions());
|
||||
remoteDeprecationConfiguration.minimumVersions());
|
||||
assertEquals(Map.of(ClientPlatform.DESKTOP, new Semver("7.8.9")),
|
||||
remoteDeprecationConfiguration.getVersionsPendingDeprecation());
|
||||
remoteDeprecationConfiguration.versionsPendingDeprecation());
|
||||
assertEquals(Map.of(ClientPlatform.DESKTOP, Set.of(new Semver("1.4.0-beta.2"))),
|
||||
remoteDeprecationConfiguration.getBlockedVersions());
|
||||
assertTrue(remoteDeprecationConfiguration.getVersionsPendingBlock().isEmpty());
|
||||
remoteDeprecationConfiguration.blockedVersions());
|
||||
assertTrue(remoteDeprecationConfiguration.versionsPendingBlock().isEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-7
@@ -56,7 +56,7 @@ class RemoteDeprecationFilterTest {
|
||||
// We're happy as long as there's no exception
|
||||
final DynamicConfigurationManager dynamicConfigurationManager = mock(DynamicConfigurationManager.class);
|
||||
final DynamicConfiguration dynamicConfiguration = mock(DynamicConfiguration.class);
|
||||
final DynamicRemoteDeprecationConfiguration emptyConfiguration = new DynamicRemoteDeprecationConfiguration();
|
||||
final DynamicRemoteDeprecationConfiguration emptyConfiguration = DynamicRemoteDeprecationConfiguration.DEFAULT;
|
||||
|
||||
when(dynamicConfigurationManager.getConfiguration()).thenReturn(dynamicConfiguration);
|
||||
when(dynamicConfiguration.getRemoteDeprecationConfiguration()).thenReturn(emptyConfiguration);
|
||||
@@ -92,12 +92,13 @@ class RemoteDeprecationFilterTest {
|
||||
final EnumMap<ClientPlatform, Set<Semver>> versionsPendingBlockByPlatform = new EnumMap<>(ClientPlatform.class);
|
||||
versionsPendingBlockByPlatform.put(ClientPlatform.DESKTOP, Set.of(new Semver("8.0.0-beta.3")));
|
||||
|
||||
final DynamicRemoteDeprecationConfiguration remoteDeprecationConfiguration = new DynamicRemoteDeprecationConfiguration();
|
||||
remoteDeprecationConfiguration.setMinimumVersions(minimumVersionsByPlatform);
|
||||
remoteDeprecationConfiguration.setVersionsPendingDeprecation(versionsPendingDeprecationByPlatform);
|
||||
remoteDeprecationConfiguration.setBlockedVersions(blockedVersionsByPlatform);
|
||||
remoteDeprecationConfiguration.setVersionsPendingBlock(versionsPendingBlockByPlatform);
|
||||
remoteDeprecationConfiguration.setUnrecognizedUserAgentAllowed(true);
|
||||
final DynamicRemoteDeprecationConfiguration remoteDeprecationConfiguration =
|
||||
new DynamicRemoteDeprecationConfiguration(
|
||||
minimumVersionsByPlatform,
|
||||
versionsPendingDeprecationByPlatform,
|
||||
blockedVersionsByPlatform,
|
||||
versionsPendingBlockByPlatform,
|
||||
true);
|
||||
|
||||
final DynamicConfiguration dynamicConfiguration = mock(DynamicConfiguration.class);
|
||||
final DynamicConfigurationManager dynamicConfigurationManager = mock(DynamicConfigurationManager.class);
|
||||
|
||||
Reference in new issue
Block a user