File tree 1 file changed +35
-1
lines changed
1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,40 @@ namespace {
75
75
EXPECT_EQ (s.bundleVersion , " 1.1" );
76
76
}
77
77
78
+ TEST_F (TestMessagingProtocolJSON, readDesiredState_activityIdIsEmpty_throwsLogicError)
79
+ {
80
+ // clang-format off
81
+ const std::string input = R"(
82
+ {
83
+ "activityId": "",
84
+ "timestamp": 123456789,
85
+ "payload": {
86
+ "domains": [
87
+ {
88
+ "id": "self-update",
89
+ "components": [
90
+ {
91
+ "id": "os-image",
92
+ "version": "1.1",
93
+ "config": [
94
+ {
95
+ "key": "image",
96
+ "value": "http://example.com/downloads/os-image-1.1.bin"
97
+ }
98
+ ]
99
+ }
100
+ ]
101
+ }
102
+ ]
103
+ }
104
+ }
105
+ )" ;
106
+ // clang-format on
107
+
108
+ EXPECT_NO_THROW (validateJsonSyntax (input));
109
+ EXPECT_THROW (ProtocolJSON ().readDesiredState (input), std::logic_error);
110
+ }
111
+
78
112
TEST_F (TestMessagingProtocolJSON, readDesiredState_missingDomain_throwsRuntimeError)
79
113
{
80
114
// clang-format off
@@ -196,7 +230,7 @@ namespace {
196
230
"components": [
197
231
{
198
232
"id": "os-image",
199
- "version": "",
233
+ "version": "1.0 ",
200
234
"config": [
201
235
{
202
236
"key": "image",
You can’t perform that action at this time.
0 commit comments