@@ -103,7 +103,7 @@ func TestUndisplayedFieldsInVehicleStatus(t *testing.T) {
103103 // DriveInformation.OdoDispValue
104104 remoteInfos , ok := getMapSlice (responseData , "remoteInfos" )
105105 require .True (t , ok , "remoteInfos not found in response" )
106- require .False (t , len ( remoteInfos ) == 0 , "remoteInfos is empty" )
106+ require .NotEmpty (t , remoteInfos )
107107 driveInfo , ok := getMap (remoteInfos [0 ], "DriveInformation" )
108108 require .True (t , ok , "DriveInformation not found in response" )
109109 odometer , ok := getFloat64 (driveInfo , "OdoDispValue" )
@@ -115,7 +115,7 @@ func TestUndisplayedFieldsInVehicleStatus(t *testing.T) {
115115 // alertInfos[].Door.DrStatHood
116116 alertInfos , ok := getMapSlice (responseData , "alertInfos" )
117117 require .True (t , ok , "alertInfos not found in response" )
118- require .False (t , len ( alertInfos ) == 0 , "alertInfos is empty" )
118+ require .NotEmpty (t , alertInfos )
119119 door , ok := getMap (alertInfos [0 ], "Door" )
120120 require .True (t , ok , "Door not found in response" )
121121 hoodStatus , ok := getFloat64 (door , "DrStatHood" )
@@ -127,7 +127,7 @@ func TestUndisplayedFieldsInVehicleStatus(t *testing.T) {
127127 // alertInfos[].Door.FuelLidOpenStatus
128128 alertInfos , ok := getMapSlice (responseData , "alertInfos" )
129129 require .True (t , ok , "alertInfos not found in response" )
130- require .False (t , len ( alertInfos ) == 0 , "alertInfos is empty" )
130+ require .NotEmpty (t , alertInfos )
131131 door , ok := getMap (alertInfos [0 ], "Door" )
132132 require .True (t , ok , "Door not found in response" )
133133 fuelLid , ok := getFloat64 (door , "FuelLidOpenStatus" )
@@ -139,7 +139,7 @@ func TestUndisplayedFieldsInVehicleStatus(t *testing.T) {
139139 // alertInfos[].Door.LockLinkSwDrv/Psngr/Rl/Rr
140140 alertInfos , ok := getMapSlice (responseData , "alertInfos" )
141141 require .True (t , ok , "alertInfos not found in response" )
142- require .False (t , len ( alertInfos ) == 0 , "alertInfos is empty" )
142+ require .NotEmpty (t , alertInfos )
143143 door , ok := getMap (alertInfos [0 ], "Door" )
144144 require .True (t , ok , "Door not found in response" )
145145
@@ -155,7 +155,7 @@ func TestUndisplayedFieldsInVehicleStatus(t *testing.T) {
155155 // alertInfos[].Pw.PwPosDrv/Psngr/Rl/Rr
156156 alertInfos , ok := getMapSlice (responseData , "alertInfos" )
157157 require .True (t , ok , "alertInfos not found in response" )
158- require .False (t , len ( alertInfos ) == 0 , "alertInfos is empty" )
158+ require .NotEmpty (t , alertInfos )
159159 pw , ok := getMap (alertInfos [0 ], "Pw" )
160160 require .True (t , ok , "Pw not found in response" )
161161
@@ -171,7 +171,7 @@ func TestUndisplayedFieldsInVehicleStatus(t *testing.T) {
171171 // alertInfos[].HazardLamp.HazardSw
172172 alertInfos , ok := getMapSlice (responseData , "alertInfos" )
173173 require .True (t , ok , "alertInfos not found in response" )
174- require .False (t , len ( alertInfos ) == 0 , "alertInfos is empty" )
174+ require .NotEmpty (t , alertInfos )
175175 hazard , ok := getMap (alertInfos [0 ], "HazardLamp" )
176176 require .True (t , ok , "HazardLamp not found in response" )
177177 hazardSw , ok := getFloat64 (hazard , "HazardSw" )
@@ -238,7 +238,8 @@ func TestUndisplayedFieldsInEVVehicleStatus(t *testing.T) {
238238 t .Run ("VerifyACChargeTimeField" , func (t * testing.T ) {
239239 // ChargeInfo.MaxChargeMinuteAC
240240 resultData , ok := getMapSlice (responseData , "resultData" )
241- require .False (t , ! ok || len (resultData ) == 0 , "resultData not found in response" )
241+ require .True (t , ok , "resultData not found in response" )
242+ require .NotEmpty (t , resultData )
242243 plusBInfo , ok := getMap (resultData [0 ], "PlusBInformation" )
243244 require .True (t , ok , "PlusBInformation not found in response" )
244245 vehicleInfo , ok := getMap (plusBInfo , "VehicleInfo" )
@@ -253,7 +254,8 @@ func TestUndisplayedFieldsInEVVehicleStatus(t *testing.T) {
253254 t .Run ("VerifyQuickChargeTimeField" , func (t * testing.T ) {
254255 // ChargeInfo.MaxChargeMinuteQBC
255256 resultData , ok := getMapSlice (responseData , "resultData" )
256- require .False (t , ! ok || len (resultData ) == 0 , "resultData not found in response" )
257+ require .True (t , ok , "resultData not found in response" )
258+ require .NotEmpty (t , resultData )
257259 plusBInfo , ok := getMap (resultData [0 ], "PlusBInformation" )
258260 require .True (t , ok , "PlusBInformation not found in response" )
259261 vehicleInfo , ok := getMap (plusBInfo , "VehicleInfo" )
@@ -268,7 +270,8 @@ func TestUndisplayedFieldsInEVVehicleStatus(t *testing.T) {
268270 t .Run ("VerifyBatteryHeaterAutoField" , func (t * testing.T ) {
269271 // ChargeInfo.CstmzStatBatHeatAutoSW
270272 resultData , ok := getMapSlice (responseData , "resultData" )
271- require .False (t , ! ok || len (resultData ) == 0 , "resultData not found in response" )
273+ require .True (t , ok , "resultData not found in response" )
274+ require .NotEmpty (t , resultData )
272275 plusBInfo , ok := getMap (resultData [0 ], "PlusBInformation" )
273276 require .True (t , ok , "PlusBInformation not found in response" )
274277 vehicleInfo , ok := getMap (plusBInfo , "VehicleInfo" )
@@ -283,7 +286,8 @@ func TestUndisplayedFieldsInEVVehicleStatus(t *testing.T) {
283286 t .Run ("VerifyBatteryHeaterOnField" , func (t * testing.T ) {
284287 // ChargeInfo.BatteryHeaterON
285288 resultData , ok := getMapSlice (responseData , "resultData" )
286- require .False (t , ! ok || len (resultData ) == 0 , "resultData not found in response" )
289+ require .True (t , ok , "resultData not found in response" )
290+ require .NotEmpty (t , resultData )
287291 plusBInfo , ok := getMap (resultData [0 ], "PlusBInformation" )
288292 require .True (t , ok , "PlusBInformation not found in response" )
289293 vehicleInfo , ok := getMap (plusBInfo , "VehicleInfo" )
@@ -298,7 +302,8 @@ func TestUndisplayedFieldsInEVVehicleStatus(t *testing.T) {
298302 t .Run ("VerifyInteriorTempField" , func (t * testing.T ) {
299303 // RemoteHvacInfo.InteriorTemp
300304 resultData , ok := getMapSlice (responseData , "resultData" )
301- require .False (t , ! ok || len (resultData ) == 0 , "resultData not found in response" )
305+ require .True (t , ok , "resultData not found in response" )
306+ require .NotEmpty (t , resultData )
302307 plusBInfo , ok := getMap (resultData [0 ], "PlusBInformation" )
303308 require .True (t , ok , "PlusBInformation not found in response" )
304309 vehicleInfo , ok := getMap (plusBInfo , "VehicleInfo" )
@@ -313,7 +318,8 @@ func TestUndisplayedFieldsInEVVehicleStatus(t *testing.T) {
313318 t .Run ("VerifyTargetTempField" , func (t * testing.T ) {
314319 // RemoteHvacInfo.TargetTemp
315320 resultData , ok := getMapSlice (responseData , "resultData" )
316- require .False (t , ! ok || len (resultData ) == 0 , "resultData not found in response" )
321+ require .True (t , ok , "resultData not found in response" )
322+ require .NotEmpty (t , resultData )
317323 plusBInfo , ok := getMap (resultData [0 ], "PlusBInformation" )
318324 require .True (t , ok , "PlusBInformation not found in response" )
319325 vehicleInfo , ok := getMap (plusBInfo , "VehicleInfo" )
@@ -394,7 +400,8 @@ func TestVehicleStatusWithVariedValues(t *testing.T) {
394400
395401 // Verify varied values
396402 alertInfos , ok := getMapSlice (responseData , "alertInfos" )
397- require .False (t , ! ok || len (alertInfos ) == 0 , "alertInfos not found in response" )
403+ require .True (t , ok , "alertInfos not found in response" )
404+ require .NotEmpty (t , alertInfos )
398405 door , ok := getMap (alertInfos [0 ], "Door" )
399406 require .True (t , ok , "Door not found" )
400407 hoodStatus , ok := getFloat64 (door , "DrStatHood" )
@@ -422,7 +429,8 @@ func TestVehicleStatusWithVariedValues(t *testing.T) {
422429 assert .EqualValues (t , 1 , hazardSw )
423430
424431 remoteInfos , ok := getMapSlice (responseData , "remoteInfos" )
425- require .False (t , ! ok || len (remoteInfos ) == 0 , "remoteInfos not found in response" )
432+ require .True (t , ok , "remoteInfos not found in response" )
433+ require .NotEmpty (t , remoteInfos )
426434 driveInfo , ok := getMap (remoteInfos [0 ], "DriveInformation" )
427435 require .True (t , ok , "DriveInformation not found" )
428436 odometer , ok := getFloat64 (driveInfo , "OdoDispValue" )
@@ -477,7 +485,8 @@ func TestEVVehicleStatusWithVariedValues(t *testing.T) {
477485
478486 // Verify varied values
479487 resultData , ok := getMapSlice (responseData , "resultData" )
480- require .False (t , ! ok || len (resultData ) == 0 , "resultData not found in response" )
488+ require .True (t , ok , "resultData not found in response" )
489+ require .NotEmpty (t , resultData )
481490 plusBInfo , ok := getMap (resultData [0 ], "PlusBInformation" )
482491 require .True (t , ok , "PlusBInformation not found in response" )
483492 vehicleInfo , ok := getMap (plusBInfo , "VehicleInfo" )
0 commit comments