Fix incorrect substitution of enumeration key names for capability names

This commit is contained in:
Jon Chambers 2024-10-30 16:44:59 -04:00 committed by Jon Chambers
parent f5a93574f6
commit 4af576668c
2 changed files with 3 additions and 3 deletions

View File

@ -492,6 +492,6 @@ public class ProfileController {
private static Map<String, Boolean> getAccountCapabilities(final Account account) {
return Arrays.stream(DeviceCapability.values())
.filter(DeviceCapability::includeInProfile)
.collect(Collectors.toMap(Enum::name, account::hasCapability));
.collect(Collectors.toMap(DeviceCapability::getName, account::hasCapability));
}
}

View File

@ -452,8 +452,8 @@ class ProfileControllerTest {
.header("Authorization", AuthHelper.getAuthHeader(AuthHelper.VALID_UUID, AuthHelper.VALID_PASSWORD))
.get(BaseProfileResponse.class);
assertEquals(isDeleteSyncSupported, profile.getCapabilities().get(DeviceCapability.DELETE_SYNC.name()));
assertEquals(isVersionedExpirationTimerSupported, profile.getCapabilities().get(DeviceCapability.VERSIONED_EXPIRATION_TIMER.name()));
assertEquals(isDeleteSyncSupported, profile.getCapabilities().get("deleteSync"));
assertEquals(isVersionedExpirationTimerSupported, profile.getCapabilities().get("versionedExpirationTimer"));
}
@Test