Merge pull request #6519 from volodymyr-babak/bug-edge-device-profile-non-default-transport
[3.4] [Bug] Device profile with non default transport is not propagated to edge
This commit is contained in:
		
						commit
						6173795580
					
				@ -58,6 +58,8 @@ import org.thingsboard.server.common.data.device.profile.AlarmRule;
 | 
			
		||||
import org.thingsboard.server.common.data.device.profile.AllowCreateNewDevicesDeviceProfileProvisionConfiguration;
 | 
			
		||||
import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm;
 | 
			
		||||
import org.thingsboard.server.common.data.device.profile.DeviceProfileData;
 | 
			
		||||
import org.thingsboard.server.common.data.device.profile.JsonTransportPayloadConfiguration;
 | 
			
		||||
import org.thingsboard.server.common.data.device.profile.MqttDeviceProfileTransportConfiguration;
 | 
			
		||||
import org.thingsboard.server.common.data.device.profile.SimpleAlarmConditionSpec;
 | 
			
		||||
import org.thingsboard.server.common.data.edge.Edge;
 | 
			
		||||
import org.thingsboard.server.common.data.edge.EdgeEvent;
 | 
			
		||||
@ -199,7 +201,11 @@ abstract public class BaseEdgeTest extends AbstractControllerTest {
 | 
			
		||||
    private void installation() throws Exception {
 | 
			
		||||
        edge = doPost("/api/edge", constructEdge("Test Edge", "test"), Edge.class);
 | 
			
		||||
 | 
			
		||||
        DeviceProfile deviceProfile = this.createDeviceProfile(CUSTOM_DEVICE_PROFILE_NAME);
 | 
			
		||||
        MqttDeviceProfileTransportConfiguration transportConfiguration = new MqttDeviceProfileTransportConfiguration();
 | 
			
		||||
        transportConfiguration.setTransportPayloadTypeConfiguration(new JsonTransportPayloadConfiguration());
 | 
			
		||||
 | 
			
		||||
        DeviceProfile deviceProfile = this.createDeviceProfile(CUSTOM_DEVICE_PROFILE_NAME, transportConfiguration);
 | 
			
		||||
 | 
			
		||||
        extendDeviceProfileData(deviceProfile);
 | 
			
		||||
        doPost("/api/deviceProfile", deviceProfile, DeviceProfile.class);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,8 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
 | 
			
		||||
import org.thingsboard.server.common.data.TransportPayloadType;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@JsonIgnoreProperties(ignoreUnknown = true)
 | 
			
		||||
@JsonTypeInfo(
 | 
			
		||||
        use = JsonTypeInfo.Id.NAME,
 | 
			
		||||
@ -29,7 +31,7 @@ import org.thingsboard.server.common.data.TransportPayloadType;
 | 
			
		||||
@JsonSubTypes({
 | 
			
		||||
        @JsonSubTypes.Type(value = JsonTransportPayloadConfiguration.class, name = "JSON"),
 | 
			
		||||
        @JsonSubTypes.Type(value = ProtoTransportPayloadConfiguration.class, name = "PROTOBUF")})
 | 
			
		||||
public interface TransportPayloadTypeConfiguration {
 | 
			
		||||
public interface TransportPayloadTypeConfiguration extends Serializable {
 | 
			
		||||
 | 
			
		||||
    @JsonIgnore
 | 
			
		||||
    TransportPayloadType getTransportPayloadType();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user