Skip to content

Commit e1748e6

Browse files
committed
Add missing playBeep parameter to the Record verb
Also clean up setTranscribe() and add a unit test.
1 parent 8d4d92e commit e1748e6

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

src/main/java/com/twilio/sdk/verbs/Record.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,10 @@ public void setMaxLength(int i){
8888
/**
8989
* Sets the transcribe.
9090
*
91-
* @param f the new transcribe
91+
* @param transcribe the new transcribe
9292
*/
93-
public void setTranscribe(boolean f){
94-
if(f)
95-
this.set("transcribe", "true");
96-
else
97-
this.set("transcribe", "false");
93+
public void setTranscribe(boolean transcribe){
94+
this.set("transcribe", String.valueOf(transcribe));
9895
}
9996

10097
/**
@@ -106,5 +103,14 @@ public void setTranscribeCallback(String url){
106103
this.set("transcribeCallback", url);
107104
}
108105

106+
/**
107+
* Sets the playBeep parameter
108+
*
109+
* @param playBeep
110+
*/
111+
public void setPlayBeep(final boolean playBeep) {
112+
this.set("playBeep", String.valueOf(playBeep));
113+
}
114+
109115
}
110116

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.twilio.sdk.verbs;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.assertEquals;
6+
7+
public class RecordTest {
8+
9+
@Test
10+
public void testRecord() {
11+
final Record record = new Record();
12+
record.setTranscribe(false);
13+
record.setAction("http://action.url.com");
14+
record.setPlayBeep(true);
15+
assertEquals("<Record transcribe=\"false\" action=\"http://action.url.com\" playBeep=\"true\"></Record>",
16+
record.toXML());
17+
}
18+
}

0 commit comments

Comments
 (0)