Represent device names as byte arrays

This commit is contained in:
Jon Chambers
2023-08-14 09:57:19 -04:00
committed by Jon Chambers
parent 34a943832a
commit 5ae2e5281a
17 changed files with 177 additions and 46 deletions

View File

@@ -221,7 +221,10 @@ class AuthEnablementRefreshRequirementProviderTest {
final int initialDeviceCount = account.getDevices().size();
final List<String> addedDeviceNames = List.of("newDevice1", "newDevice2");
final List<String> addedDeviceNames = List.of(
Base64.getEncoder().encodeToString("newDevice1".getBytes(StandardCharsets.UTF_8)),
Base64.getEncoder().encodeToString("newDevice2".getBytes(StandardCharsets.UTF_8)));
final Response response = resources.getJerseyTest()
.target("/v1/test/account/devices")
.request()
@@ -450,7 +453,7 @@ class AuthEnablementRefreshRequirementProviderTest {
@PUT
@Path("/account/devices")
@ChangesDeviceEnabledState
public String addDevices(@Auth TestPrincipal auth, List<String> deviceNames) {
public String addDevices(@Auth TestPrincipal auth, List<byte[]> deviceNames) {
deviceNames.forEach(name -> {
final Device device = DevicesHelper.createDevice(auth.getAccount().getNextDeviceId());