Просмотр исходного кода

fix device_crud test, actually update device

tags/v0.12.4
Jonathan Cobb 4 лет назад
Родитель
Сommit
6b9a05b3d9
2 измененных файлов: 18 добавлений и 15 удалений
  1. +1
    -0
      bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java
  2. +17
    -15
      bubble-server/src/test/resources/models/tests/auth/device_crud.json

+ 1
- 0
bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java Просмотреть файл

@@ -96,6 +96,7 @@ public class DeviceDAO extends AccountOwnedEntityDAO<Device> {
if (toUpdate == null) die("Cannot find device to update with uuid: " + updateRequest.getUuid());
if (toUpdate.uninitialized()) die("Cannot update special devices: " + updateRequest.getName());

toUpdate.update(updateRequest);
final var updated = super.update(toUpdate);
deviceIdService.setDeviceSecurityLevel(updated);
return updated;


+ 17
- 15
bubble-server/src/test/resources/models/tests/auth/device_crud.json Просмотреть файл

@@ -13,7 +13,7 @@
"response": {
"store": "userDevices",
"check": [
{"condition": "json.length == 0"}
{"condition": "json.length === 0"}
]
}
},
@@ -24,7 +24,8 @@
"uri": "users/{{userAccount.name}}/devices",
"method": "put",
"entity": {
"name": "root-added-device"
"name": "root-added-device",
"deviceType": "other"
}
},
"response": {
@@ -37,8 +38,8 @@
"request": { "uri": "users/{{userAccount.name}}/devices" },
"response": {
"check": [
{"condition": "json.length == 1"},
{"condition": "json[0].getName() == 'root-added-device'"}
{"condition": "json.length === 1"},
{"condition": "json[0].getName() === 'root-added-device'"}
]
}
},
@@ -48,7 +49,7 @@
"request": { "uri": "users/{{userAccount.name}}/devices/root-added-device" },
"response": {
"check": [
{"condition": "json.getName() == 'root-added-device'"}
{"condition": "json.getName() === 'root-added-device'"}
]
}
},
@@ -58,7 +59,7 @@
"request": { "uri": "users/{{userAccount.name}}/devices/{{device.uuid}}" },
"response": {
"check": [
{"condition": "json.getName() == 'root-added-device'"}
{"condition": "json.getName() === 'root-added-device'"}
]
}
},
@@ -80,8 +81,8 @@
},
"response": {
"check": [
{"condition": "json.length == 1"},
{"condition": "json[0].getName() == 'root-renamed-device'"}
{"condition": "json.length === 1"},
{"condition": "json[0].getName() === 'root-renamed-device'"}
]
}
},
@@ -92,7 +93,8 @@
"uri": "me/devices",
"method": "put",
"entity": {
"name": "user-added-device"
"name": "user-added-device",
"deviceType": "other"
}
},
"response": {
@@ -105,9 +107,9 @@
"request": { "uri": "me/devices" },
"response": {
"check": [
{"condition": "json.length == 2"},
{"condition": "json[0].getName() == 'root-renamed-device'"},
{"condition": "json[1].getName() == 'user-added-device'"}
{"condition": "json.length === 2"},
{"condition": "json[0].getName() === 'root-renamed-device'"},
{"condition": "json[1].getName() === 'user-added-device'"}
]
}
},
@@ -133,8 +135,8 @@
"request": { "uri": "me/devices" },
"response": {
"check": [
{"condition": "json.length == 1"},
{"condition": "json[0].getName() == 'user-added-device'"}
{"condition": "json.length === 1"},
{"condition": "json[0].getName() === 'user-added-device'"}
]
}
},
@@ -153,7 +155,7 @@
"request": { "uri": "users/{{userAccount.name}}/devices" },
"response": {
"check": [
{"condition": "json.length == 0"}
{"condition": "json.length === 0"}
]
}
}

Загрузка…
Отмена
Сохранить