@@ -103,10 +103,11 @@ public void testCreateDefaultSession() throws OpenTokException {
103
103
stubFor (post (urlEqualTo (SESSION_CREATE ))
104
104
.willReturn (aResponse ()
105
105
.withStatus (200 )
106
- .withHeader ("Content-Type" , "text/xml" )
107
- .withBody ("<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" yes\" ?><sessions><Session><" +
108
- "session_id>" + sessionId + "</session_id><partner_id>123456</partner_id><create_dt>" +
109
- "Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>" )));
106
+ .withHeader ("Content-Type" , "application/json" )
107
+ .withBody ("[{\" session_id\" :\" " + sessionId + "\" ,\" project_id\" :\" 00000000\" ," +
108
+ "\" partner_id\" :\" 123456\" ," +
109
+ "\" create_dt\" :\" Mon Mar 17 00:41:31 PDT 2014\" ," +
110
+ "\" media_server_url\" :\" \" }]" )));
110
111
111
112
Session session = sdk .createSession ();
112
113
@@ -131,10 +132,11 @@ public void testCreateRoutedSession() throws OpenTokException {
131
132
stubFor (post (urlEqualTo (SESSION_CREATE ))
132
133
.willReturn (aResponse ()
133
134
.withStatus (200 )
134
- .withHeader ("Content-Type" , "text/xml" )
135
- .withBody ("<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" yes\" ?><sessions><Session><" +
136
- "session_id>" + sessionId + "</session_id><partner_id>123456</partner_id><create_dt>" +
137
- "Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>" )));
135
+ .withHeader ("Content-Type" , "application/json" )
136
+ .withBody ("[{\" session_id\" :\" " + sessionId + "\" ,\" project_id\" :\" 00000000\" ," +
137
+ "\" partner_id\" :\" 123456\" ," +
138
+ "\" create_dt\" :\" Mon Mar 17 00:41:31 PDT 2014\" ," +
139
+ "\" media_server_url\" :\" \" }]" )));
138
140
139
141
SessionProperties properties = new SessionProperties .Builder ()
140
142
.mediaMode (MediaMode .ROUTED )
@@ -162,10 +164,11 @@ public void testCreateLocationHintSession() throws OpenTokException {
162
164
stubFor (post (urlEqualTo (SESSION_CREATE ))
163
165
.willReturn (aResponse ()
164
166
.withStatus (200 )
165
- .withHeader ("Content-Type" , "text/xml" )
166
- .withBody ("<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" yes\" ?><sessions><Session><" +
167
- "session_id>" + sessionId + "</session_id><partner_id>123456</partner_id><create_dt>" +
168
- "Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>" )));
167
+ .withHeader ("Content-Type" , "application/json" )
168
+ .withBody ("[{\" session_id\" :\" " + sessionId + "\" ,\" project_id\" :\" 00000000\" ," +
169
+ "\" partner_id\" :\" 123456\" ," +
170
+ "\" create_dt\" :\" Mon Mar 17 00:41:31 PDT 2014\" ," +
171
+ "\" media_server_url\" :\" \" }]" )));
169
172
170
173
SessionProperties properties = new SessionProperties .Builder ()
171
174
.location (locationHint )
@@ -193,10 +196,11 @@ public void testCreateAlwaysArchivedSession() throws OpenTokException {
193
196
stubFor (post (urlEqualTo (SESSION_CREATE ))
194
197
.willReturn (aResponse ()
195
198
.withStatus (200 )
196
- .withHeader ("Content-Type" , "text/xml" )
197
- .withBody ("<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" yes\" ?><sessions><Session><" +
198
- "session_id>" + sessionId + "</session_id><partner_id>123456</partner_id><create_dt>" +
199
- "Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>" )));
199
+ .withHeader ("Content-Type" , "application/json" )
200
+ .withBody ("[{\" session_id\" :\" " + sessionId + "\" ,\" project_id\" :\" 00000000\" ," +
201
+ "\" partner_id\" :\" 123456\" ," +
202
+ "\" create_dt\" :\" Mon Mar 17 00:41:31 PDT 2014\" ," +
203
+ "\" media_server_url\" :\" \" }]" )));
200
204
201
205
SessionProperties properties = new SessionProperties .Builder ()
202
206
.archiveMode (ArchiveMode .ALWAYS )
@@ -885,11 +889,11 @@ public void testCreateSessionWithProxy() throws OpenTokException, UnknownHostExc
885
889
stubFor (post (urlEqualTo ("/session/create" ))
886
890
.willReturn (aResponse ()
887
891
.withStatus (200 )
888
- .withHeader ("Content-Type" , "text/xml " )
889
- .withBody ("<?xml version= \" 1.0 \" encoding= \" UTF-8 \" standalone= \" yes \" ?><sessions><Session>< " +
890
- "session_id>" + sessionId + "</session_id>< partner_id> 123456</partner_id><create_dt> " +
891
- "Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>" )
892
- ));
892
+ .withHeader ("Content-Type" , "application/json " )
893
+ .withBody ("[{ \" session_id \" : \" " + sessionId + " \" , \" project_id \" : \" 00000000 \" , " +
894
+ "\" partner_id\" : \" 123456\" , " +
895
+ "\" create_dt \" : \" Mon Mar 17 00:41:31 PDT 2014\" ," +
896
+ " \" media_server_url \" : \" \" }]" ) ));
893
897
894
898
Session session = sdk .createSession ();
895
899
0 commit comments