diff --git a/lib/src/app/data.dart b/lib/src/app/data.dart index 81dce31c74a..83ca496307e 100644 --- a/lib/src/app/data.dart +++ b/lib/src/app/data.dart @@ -562,7 +562,6 @@ class DataClient { response.payload.toStruct().toMap(), ); } - } /// {@category Viam SDK} diff --git a/test/unit_test/app/data_client_test.dart b/test/unit_test/app/data_client_test.dart index 65488cf598b..8ea3ce0210d 100644 --- a/test/unit_test/app/data_client_test.dart +++ b/test/unit_test/app/data_client_test.dart @@ -411,27 +411,18 @@ void main() { }); }); }); - + test('getLatestTabularData', () async { final timeCaptured = DateTime(2023, 1, 1); final timeSynced = DateTime(2023, 1, 2); - final payload = Struct()..fields.addAll({ - 'key': Value()..stringValue = 'value' - }); + final payload = Struct()..fields.addAll({'key': Value()..stringValue = 'value'}); - when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value( - GetLatestTabularDataResponse() - ..timeCaptured = Timestamp.fromDateTime(timeCaptured) - ..timeSynced = Timestamp.fromDateTime(timeSynced) - ..payload = payload - )); + when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse() + ..timeCaptured = Timestamp.fromDateTime(timeCaptured) + ..timeSynced = Timestamp.fromDateTime(timeSynced) + ..payload = payload)); - final response = await dataClient.getLatestTabularData( - 'part-id', - 'resource-name', - 'resource-subtype', - 'method-name' - ); + final response = await dataClient.getLatestTabularData('part-id', 'resource-name', 'resource-subtype', 'method-name'); expect(response?.$1, equals(timeCaptured)); expect(response?.$2, equals(timeSynced)); @@ -440,15 +431,9 @@ void main() { verify(dataServiceClient.getLatestTabularData(any)).called(1); // Test null response - when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => - MockResponseFuture.value(GetLatestTabularDataResponse())); - - final nullResponse = await dataClient.getLatestTabularData( - 'part-id', - 'resource-name', - 'resource-subtype', - 'method-name' - ); + when(dataServiceClient.getLatestTabularData(any)).thenAnswer((_) => MockResponseFuture.value(GetLatestTabularDataResponse())); + + final nullResponse = await dataClient.getLatestTabularData('part-id', 'resource-name', 'resource-subtype', 'method-name'); expect(nullResponse, isNull); });