|
|
|
@ -24,7 +24,6 @@ import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
import org.thingsboard.server.common.data.iot_hub.DeviceInstalledItemDescriptor; |
|
|
|
import org.thingsboard.server.common.data.iot_hub.IotHubInstalledItem; |
|
|
|
import org.thingsboard.server.common.data.iot_hub.RuleChainInstalledItemDescriptor; |
|
|
|
import org.thingsboard.server.dao.exception.DataValidationException; |
|
|
|
import org.thingsboard.server.dao.dashboard.DashboardService; |
|
|
|
import org.thingsboard.server.dao.device.DeviceProfileService; |
|
|
|
import org.thingsboard.server.dao.device.DeviceService; |
|
|
|
@ -711,7 +710,7 @@ class DefaultIotHubServiceTest { |
|
|
|
when(iotHubRestClient.getVersionInfo(newVersionId)) |
|
|
|
.thenReturn(version(newVersionId, item.getItemId().toString(), "DEVICE", "Gateway", "1.0.2")); |
|
|
|
when(deviceService.findDeviceById(tenantId, device.getId())).thenReturn(device); |
|
|
|
doThrow(new DataValidationException("invalid item")).when(iotHubInstalledItemService).save(tenantId, item); |
|
|
|
doThrow(new IllegalArgumentException("invalid item")).when(iotHubInstalledItemService).save(tenantId, item); |
|
|
|
|
|
|
|
// The device is already removed: the failure must not look like a refusal (a 400) to the wizard.
|
|
|
|
assertThatThrownBy(() -> service.removeDevicePackageEntities(user, item.getId(), newVersionId)) |
|
|
|
|