Skip to content

Commit c59e095

Browse files
[MAE 167] breaking deserialization (#2474)
1 parent 491e660 commit c59e095

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

maestro-client/src/main/java/maestro/device/DeviceService.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ object DeviceService {
265265
return connectedIphoneList.filter {
266266
it.connectionProperties.tunnelState == DeviceCtlResponse.ConnectionProperties.CONNECTED
267267
}.map {
268-
val description = "${it.deviceProperties.name} - ${it.deviceProperties.osVersionNumber} - ${it.identifier}"
268+
val description = listOfNotNull(
269+
it.deviceProperties?.name,
270+
it.deviceProperties?.osVersionNumber,
271+
it.identifier
272+
).joinToString(" - ")
269273

270274
Device.Connected(
271275
instanceId = it.hardwareProperties.udid,

maestro-ios-driver/src/main/kotlin/util/IOSDevice.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data class DeviceCtlResponse(
1919
@JsonIgnoreProperties(ignoreUnknown = true)
2020
data class Device(
2121
val identifier: String,
22-
val deviceProperties: DeviceProperties,
22+
val deviceProperties: DeviceProperties?,
2323
val hardwareProperties: HardwareProperties,
2424
val connectionProperties: ConnectionProperties,
2525
)
@@ -35,8 +35,8 @@ data class DeviceCtlResponse(
3535

3636
@JsonIgnoreProperties(ignoreUnknown = true)
3737
data class DeviceProperties(
38-
val name: String,
39-
val osVersionNumber: String,
38+
val name: String?,
39+
val osVersionNumber: String?,
4040
)
4141

4242
@JsonIgnoreProperties(ignoreUnknown = true)

maestro-ios-driver/src/test/kotlin/DeviceCtlResponseTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class DeviceCtlResponseTest {
7272
"developerModeStatus" : "enabled",
7373
"hasInternalOSBuild" : false,
7474
"name" : "xx's iPhone ",
75-
"osVersionNumber" : "18.1.1",
7675
"rootFileSystemIsWritable" : false
7776
},
7877
"hardwareProperties" : {
@@ -147,7 +146,6 @@ class DeviceCtlResponseTest {
147146
"ddiServicesAvailable" : false,
148147
"developerModeStatus" : "disabled",
149148
"hasInternalOSBuild" : false,
150-
"name" : "S’s Apple's Watch",
151149
"osBuildUpdate" : "22S560",
152150
"osVersionNumber" : "11.3.1"
153151
},

0 commit comments

Comments
 (0)