File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
src/test/java/com/microsoft/graph/serializer Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 22
33import static org .junit .Assert .*;
44
5- import org .junit .After ;
6- import org .junit .Before ;
75import org .junit .Test ;
86
97import com .microsoft .graph .models .extensions .Drive ;
8+ import com .microsoft .graph .models .extensions .User ;
109import com .microsoft .graph .models .generated .RecurrenceRangeType ;
1110import com .microsoft .graph .models .generated .BaseRecurrenceRange ;
11+ import com .google .gson .JsonElement ;
12+ import com .microsoft .graph .http .MockConnection ;
1213import com .microsoft .graph .logger .DefaultLogger ;
1314import com .microsoft .graph .models .extensions .DateOnly ;
1415
@@ -64,5 +65,20 @@ public void testRecurrenceRangeSerialization() throws Exception {
6465 assertNotNull (jsonOut );
6566 assertEquals (expected , jsonOut );
6667 }
68+
69+ @ Test
70+ public void testResponseHeaders () throws Exception {
71+ MockConnection connection = new MockConnection (null );
72+ final DefaultSerializer serializer = new DefaultSerializer (new DefaultLogger ());
73+ User user = serializer .deserializeObject ("{\" id\" :\" 1\" }" , User .class , connection .getResponseHeaders ());
74+
75+ JsonElement responseHeaders = user .additionalDataManager ().get ("graphResponseHeaders" );
76+ assertNotNull (responseHeaders );
77+
78+ JsonElement responseHeader = responseHeaders .getAsJsonObject ().get ("header1" );
79+ assertNotNull (responseHeader );
80+
81+ assertEquals ("value1" , responseHeader .getAsJsonArray ().get (0 ).getAsString ());
82+ }
6783
6884}
You can’t perform that action at this time.
0 commit comments