Convert DynamicRemoteDeprecationConfiguration to a record

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2026-03-24 14:10:51 -04:00
1 parent 71bc23ed02
commit 04c102e51f
5 files changed
+47 -73

No files matched your search

@@ -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());
}
}
@@ -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);