Skip to content

Commit d572074

Browse files
committed
fixes #36, stop archive URI was incorrect
1 parent c27adfd commit d572074

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/opentok/util/HttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public String stopArchive(String archiveId) throws RequestException {
217217
String responseString = null;
218218
Future<Response> request = null;
219219
// TODO: maybe use a StringBuilder?
220-
String url = this.apiUrl + "/v2/partner/" + this.apiKey + "/archive/stop";
220+
String url = this.apiUrl + "/v2/partner/" + this.apiKey + "/archive/" + archiveId + "/stop";
221221

222222
try {
223223
request = this.preparePost(url).execute();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ public void testStartArchive() throws OpenTokException {
508508
public void testStopArchive() throws OpenTokException {
509509
String archiveId = "ARCHIVEID";
510510

511-
stubFor(post(urlEqualTo("/v2/partner/"+this.apiKey+"/archive/stop"))
511+
stubFor(post(urlEqualTo("/v2/partner/"+this.apiKey+"/archive/"+archiveId+"/stop"))
512512
.willReturn(aResponse()
513513
.withStatus(200)
514514
.withHeader("Content-Type", "application/json")
@@ -530,7 +530,7 @@ public void testStopArchive() throws OpenTokException {
530530
assertEquals("SESSIONID", archive.getSessionId());
531531
assertEquals(archiveId, archive.getId());
532532

533-
verify(postRequestedFor(urlMatching("/v2/partner/"+this.apiKey+"/archive/stop"))
533+
verify(postRequestedFor(urlMatching("/v2/partner/"+this.apiKey+"/archive/"+archiveId+"/stop"))
534534
.withHeader("X-TB-PARTNER-AUTH", matching(this.apiKey+":"+this.apiSecret))
535535
.withHeader("User-Agent", matching(".*Opentok-Java-SDK/"+ Version.VERSION+".*")));
536536
}

0 commit comments

Comments
 (0)