@@ -18,14 +18,14 @@ public function testCouldSetGetNativeMessage()
1818
1919 public function testColdBeSerializedToJson ()
2020 {
21- $ message = new GpsMessage ('theBody ' , ['thePropFoo ' => 'thePropFooVal ' ], ['theHeaderFoo ' => 'theHeaderFooVal ' ]);
21+ $ message = new GpsMessage ('theBody ' , ['thePropFoo ' => 'thePropFooVal ' ], ['theHeaderFoo ' => 'theHeaderFooVal ' ], [ ' theAttributeFoo ' => ' theAttributeFooVal ' ] );
2222
23- $ this ->assertEquals ('{"body":"theBody","properties":{"thePropFoo":"thePropFooVal"},"headers":{"theHeaderFoo":"theHeaderFooVal"}} ' , json_encode ($ message ));
23+ $ this ->assertEquals ('{"body":"theBody","properties":{"thePropFoo":"thePropFooVal"},"headers":{"theHeaderFoo":"theHeaderFooVal"},"attributes":{"theAttributeFoo":"theAttributeFooVal"} } ' , json_encode ($ message ));
2424 }
2525
2626 public function testCouldBeUnserializedFromJson ()
2727 {
28- $ message = new GpsMessage ('theBody ' , ['thePropFoo ' => 'thePropFooVal ' ], ['theHeaderFoo ' => 'theHeaderFooVal ' ]);
28+ $ message = new GpsMessage ('theBody ' , ['thePropFoo ' => 'thePropFooVal ' ], ['theHeaderFoo ' => 'theHeaderFooVal ' ], [ ' theAttributeFoo ' => ' theAttributeFooVal ' ] );
2929
3030 $ json = json_encode ($ message );
3131
@@ -40,7 +40,7 @@ public function testCouldBeUnserializedFromJson()
4040
4141 public function testMessageEntityCouldBeUnserializedFromJson ()
4242 {
43- $ json = '{"body":"theBody","properties":{"thePropFoo":"thePropFooVal"},"headers":{"theHeaderFoo":"theHeaderFooVal"}} ' ;
43+ $ json = '{"body":"theBody","properties":{"thePropFoo":"thePropFooVal"},"headers":{"theHeaderFoo":"theHeaderFooVal"},"attributes":{"theAttributeFoo":"theAttributeFooVal"} } ' ;
4444
4545 $ unserializedMessage = GpsMessage::jsonUnserialize ($ json );
4646
@@ -49,6 +49,7 @@ public function testMessageEntityCouldBeUnserializedFromJson()
4949 $ this ->assertEquals ($ decoded ['body ' ], $ unserializedMessage ->getBody ());
5050 $ this ->assertEquals ($ decoded ['properties ' ], $ unserializedMessage ->getProperties ());
5151 $ this ->assertEquals ($ decoded ['headers ' ], $ unserializedMessage ->getHeaders ());
52+ $ this ->assertEquals ($ decoded ['attributes ' ], $ unserializedMessage ->getAttributes ());
5253 }
5354
5455 public function testMessagePayloadCouldBeUnserializedFromJson ()
@@ -61,6 +62,7 @@ public function testMessagePayloadCouldBeUnserializedFromJson()
6162 $ this ->assertEquals ($ json , $ unserializedMessage ->getBody ());
6263 $ this ->assertEquals ([], $ unserializedMessage ->getProperties ());
6364 $ this ->assertEquals ([], $ unserializedMessage ->getHeaders ());
65+ $ this ->assertEquals ([], $ unserializedMessage ->getAttributes ());
6466 }
6567
6668 public function testThrowIfMalformedJsonGivenOnUnsterilizedFromJson ()
0 commit comments