Commit bb1a03f5c852c0e2fe2fa9d0148f7a0aa1db3063
1 parent
2700c429
Device profile provision type set to DISABLED if not provided
Showing
2 changed files
with
5 additions
and
1 deletions
... | ... | @@ -30,6 +30,7 @@ import org.junit.Test; |
30 | 30 | import org.thingsboard.server.common.data.Device; |
31 | 31 | import org.thingsboard.server.common.data.DeviceProfile; |
32 | 32 | import org.thingsboard.server.common.data.DeviceProfileInfo; |
33 | +import org.thingsboard.server.common.data.DeviceProfileProvisionType; | |
33 | 34 | import org.thingsboard.server.common.data.DeviceProfileType; |
34 | 35 | import org.thingsboard.server.common.data.DeviceTransportType; |
35 | 36 | import org.thingsboard.server.common.data.Tenant; |
... | ... | @@ -101,6 +102,7 @@ public abstract class BaseDeviceProfileControllerTest extends AbstractController |
101 | 102 | Assert.assertEquals(deviceProfile.getProfileData(), savedDeviceProfile.getProfileData()); |
102 | 103 | Assert.assertEquals(deviceProfile.isDefault(), savedDeviceProfile.isDefault()); |
103 | 104 | Assert.assertEquals(deviceProfile.getDefaultRuleChainId(), savedDeviceProfile.getDefaultRuleChainId()); |
105 | + Assert.assertEquals(DeviceProfileProvisionType.DISABLED, savedDeviceProfile.getProvisionType()); | |
104 | 106 | savedDeviceProfile.setName("New device profile"); |
105 | 107 | doPost("/api/deviceProfile", savedDeviceProfile, DeviceProfile.class); |
106 | 108 | DeviceProfile foundDeviceProfile = doGet("/api/deviceProfile/"+savedDeviceProfile.getId().getId().toString(), DeviceProfile.class); | ... | ... |
... | ... | @@ -373,7 +373,9 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D |
373 | 373 | throw new DataValidationException("Another default device profile is present in scope of current tenant!"); |
374 | 374 | } |
375 | 375 | } |
376 | - | |
376 | + if (deviceProfile.getProvisionType() == null) { | |
377 | + deviceProfile.setProvisionType(DeviceProfileProvisionType.DISABLED); | |
378 | + } | |
377 | 379 | DeviceProfileTransportConfiguration transportConfiguration = deviceProfile.getProfileData().getTransportConfiguration(); |
378 | 380 | transportConfiguration.validate(); |
379 | 381 | if (transportConfiguration instanceof MqttDeviceProfileTransportConfiguration) { | ... | ... |