@@ -105,7 +105,13 @@ public void testSignalAllConnections() throws OpenTokException {
105
105
stubFor (post (urlEqualTo (path ))
106
106
.willReturn (aResponse ()
107
107
.withStatus (204 )));
108
- SignalProperties properties = new SignalProperties .Builder ().type ("test" ).data ("Signal test string" ).build ();
108
+ SignalProperties properties = new SignalProperties .Builder ()
109
+ .type ("test" )
110
+ .data ("Signal test string" )
111
+ .build ();
112
+
113
+ properties .toMap ();
114
+
109
115
sdk .signal (sessionId , properties );
110
116
verify (postRequestedFor (urlMatching (path )));
111
117
verify (postRequestedFor (urlMatching (path ))
@@ -560,6 +566,12 @@ public void testGetArchive() throws OpenTokException {
560
566
Archive archive = sdk .getArchive (archiveId );
561
567
562
568
assertNotNull (archive );
569
+ assertNotNull (archive .toString ());
570
+ assertNull (archive .getPassword ());
571
+ assertNotNull (archive .getStreamMode ());
572
+ assertNotNull (archive .getReason ());
573
+ assertTrue (archive .hasAudio ());
574
+ assertTrue (archive .hasVideo ());
563
575
assertEquals (apiKey , archive .getPartnerId ());
564
576
assertEquals (archiveId , archive .getId ());
565
577
assertEquals (1395187836000L , archive .getCreatedAt ());
@@ -948,7 +960,17 @@ public void testStartArchive() throws OpenTokException {
948
960
" \" status\" : \" started\" ,\n " +
949
961
" \" url\" : null\n " +
950
962
" }" )));
951
- ArchiveProperties properties = new ArchiveProperties .Builder ().name (null ).build ();
963
+ ArchiveProperties properties = new ArchiveProperties .Builder ()
964
+ .name (null )
965
+ .hasAudio (true )
966
+ .hasVideo (false )
967
+ .outputMode (OutputMode .COMPOSED )
968
+ .streamMode (Archive .StreamMode .AUTO )
969
+ .resolution ("1920x1080" )
970
+ .build ();
971
+
972
+ properties .toMap ();
973
+
952
974
Archive archive = sdk .startArchive (sessionId , properties );
953
975
assertNotNull (archive );
954
976
assertEquals (sessionId , archive .getSessionId ());
@@ -982,7 +1004,12 @@ public void testStartArchiveWithScreenshareType() throws OpenTokException {
982
1004
String expectedJson = String .format ("{\" sessionId\" :\" %s\" ,\" streamMode\" :\" auto\" ,\" hasVideo\" :true,\" hasAudio\" :true,\" outputMode\" :\" composed\" ,\" layout\" :{\" type\" :\" bestFit\" ,\" screenshareType\" :\" pip\" }}" ,sessionId );
983
1005
ValueMatchingStrategy valueMatchingStrategy = new ValueMatchingStrategy ();
984
1006
valueMatchingStrategy .setEqualToJson (expectedJson );
985
- ArchiveLayout layout = new ArchiveLayout (ScreenShareLayoutType .PIP );
1007
+
1008
+ ArchiveLayout layout = new ArchiveLayout (ScreenShareLayoutType .BESTFIT );
1009
+ assertEquals (ScreenShareLayoutType .BESTFIT , layout .getScreenshareType ());
1010
+ layout .setScreenshareType (ScreenShareLayoutType .PIP );
1011
+ assertEquals (ScreenShareLayoutType .PIP , layout .getScreenshareType ());
1012
+
986
1013
ArchiveProperties properties = new ArchiveProperties .Builder ().name (null ).layout (layout ).build ();
987
1014
Archive archive = sdk .startArchive (sessionId , properties );
988
1015
assertNotNull (archive );
@@ -1702,17 +1729,33 @@ public void testStartBroadcast() throws OpenTokException {
1702
1729
RtmpProperties rtmpProps = new RtmpProperties .Builder ().id ("foo" ).serverUrl ("rtmp://myfooserver/myfooapp" ).streamName ("myfoostream" ).build ();
1703
1730
RtmpProperties rtmpNextProps = new RtmpProperties .Builder ().id ("bar" ).serverUrl ("rtmp://mybarserver/mybarapp" ).streamName ("mybarstream" ).build ();
1704
1731
BroadcastLayout layout = new BroadcastLayout (BroadcastLayout .Type .PIP );
1732
+ new BroadcastLayout (ArchiveLayout .Type .BESTFIT , "style.css" );
1733
+
1705
1734
BroadcastProperties properties = new BroadcastProperties .Builder ()
1706
1735
.hasHls (true )
1707
1736
.addRtmpProperties (rtmpProps )
1708
1737
.addRtmpProperties (rtmpNextProps )
1709
1738
.maxDuration (1000 )
1710
1739
.resolution ("640x480" )
1711
1740
.layout (layout )
1741
+ .streamMode (Broadcast .StreamMode .AUTO )
1712
1742
.build ();
1743
+
1713
1744
Broadcast broadcast = sdk .startBroadcast (sessionId , properties );
1714
1745
assertNotNull (broadcast );
1746
+ Rtmp rtmp = broadcast .getRtmpList ().get (0 );
1747
+ assertNotNull (rtmp );
1748
+ assertNotNull (rtmp .getId ());
1749
+ assertNotNull (rtmp .getServerUrl ());
1750
+ assertNotNull (rtmp .getStreamName ());
1751
+ assertNotNull (broadcast .toString ());
1752
+ assertNotNull (broadcast .getStatus ());
1753
+ assertEquals ("1280x720" , broadcast .getResolution ());
1754
+ assertTrue (broadcast .getCreatedAt () > 0 );
1755
+ assertTrue (broadcast .getUpdatedAt () > -1 );
1756
+ assertTrue (broadcast .getProjectId () > -1 );
1715
1757
assertEquals (sessionId , broadcast .getSessionId ());
1758
+ assertEquals (Broadcast .StreamMode .AUTO , broadcast .getStreamMode ());
1716
1759
assertNotNull (broadcast .getId ());
1717
1760
verify (postRequestedFor (urlMatching (url )));
1718
1761
assertTrue (Helpers .verifyTokenAuth (apiKey , apiSecret ,
0 commit comments