diff --git a/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java b/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java index d3c262f27b..742726db2a 100644 --- a/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java +++ b/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java @@ -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))