Skip to content

Commit b3d1934

Browse files
committed
adds test for paused status in archive
1 parent c9c29fa commit b3d1934

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/main/java/com/opentok/Archive.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public enum Status {
3232
* The recording of the archive failed.
3333
*/
3434
FAILED,
35+
36+
PAUSED,
37+
3538
/**
3639
* The archive recording has started and is in progress.
3740
*/

src/test/java/com/opentok/test/OpenTokTest.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,31 @@ public void testDeleteArchive() throws OpenTokException {
730730
assertEquals(Archive.Status.EXPIRED, archive.getStatus());
731731
}
732732

733+
// NOTE: this test is pretty sloppy
734+
@Test public void testGetPausedArchive() throws OpenTokException {
735+
String archiveId = "ARCHIVEID";
736+
stubFor(get(urlEqualTo("/v2/partner/"+this.apiKey+"/archive/"+archiveId))
737+
.willReturn(aResponse()
738+
.withStatus(200)
739+
.withHeader("Content-Type", "application/json")
740+
.withBody("{\n" +
741+
" \"createdAt\" : 1395187836000,\n" +
742+
" \"duration\" : 62,\n" +
743+
" \"id\" : \"" + archiveId + "\",\n" +
744+
" \"name\" : \"\",\n" +
745+
" \"partnerId\" : 123456,\n" +
746+
" \"reason\" : \"\",\n" +
747+
" \"sessionId\" : \"SESSIONID\",\n" +
748+
" \"size\" : 8347554,\n" +
749+
" \"status\" : \"paused\",\n" +
750+
" \"url\" : null\n" +
751+
" }")));
752+
753+
Archive archive = sdk.getArchive(archiveId);
754+
assertNotNull(archive);
755+
assertEquals(Archive.Status.PAUSED, archive.getStatus());
756+
}
757+
733758
@Test public void testGetArchiveWithUnknownProperties() throws OpenTokException {
734759
String archiveId = "ARCHIVEID";
735760
stubFor(get(urlEqualTo("/v2/partner/"+this.apiKey+"/archive/"+archiveId))

0 commit comments

Comments
 (0)