File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
main/java/com/twilio/twiml
test/java/com/twilio/twiml Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1111public class Task extends TwiML {
1212
1313 @ XmlAttribute
14- private final int priority ;
14+ private final Integer priority ;
1515
1616 @ XmlAttribute
17- private final int timeout ;
17+ private final Integer timeout ;
1818
1919 @ XmlValue
2020 private final String data ;
@@ -43,8 +43,8 @@ public String getData() {
4343 }
4444
4545 public static class Builder {
46- private int priority ;
47- private int timeout ;
46+ private Integer priority ;
47+ private Integer timeout ;
4848 private String data ;
4949
5050 public Builder priority (int priority ) {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public void testXml() throws TwiMLException {
1818 .workflowSid ("WF123" )
1919 .build ();
2020
21- Assert .assertEquals ("<Enqueue action=\" /enqueue\" method=\" GET\" waitUrl=\" /wait\" waitUrlMethod=\" POST\" workflowSid=\" WF123\" ><Task priority= \" 0 \" timeout= \" 0 \" /></Enqueue>" , enqueue .toXml ());
21+ Assert .assertEquals ("<Enqueue action=\" /enqueue\" method=\" GET\" waitUrl=\" /wait\" waitUrlMethod=\" POST\" workflowSid=\" WF123\" ><Task/></Enqueue>" , enqueue .toXml ());
2222 }
2323
2424 @ Test
@@ -31,6 +31,6 @@ public void testUrl() throws TwiMLException {
3131 .workflowSid ("WF123" )
3232 .build ();
3333
34- Assert .assertEquals ("%3CEnqueue+action%3D%22%2Fenqueue%22+method%3D%22GET%22+waitUrl%3D%22%2Fwait%22+waitUrlMethod%3D%22POST%22+workflowSid%3D%22WF123%22%3E%3CTask+priority%3D%220%22+timeout%3D%220%22 %2F%3E%3C%2FEnqueue%3E" , enqueue .toUrl ());
34+ Assert .assertEquals ("%3CEnqueue+action%3D%22%2Fenqueue%22+method%3D%22GET%22+waitUrl%3D%22%2Fwait%22+waitUrlMethod%3D%22POST%22+workflowSid%3D%22WF123%22%3E%3CTask%2F%3E%3C%2FEnqueue%3E" , enqueue .toUrl ());
3535 }
3636}
Original file line number Diff line number Diff line change @@ -19,6 +19,16 @@ public void testXml() throws TwiMLException {
1919 Assert .assertEquals ("<Task priority=\" 1\" timeout=\" 5\" >foobar</Task>" , task .toXml ());
2020 }
2121
22+ @ Test
23+ public void testXmlNoDefaults () throws TwiMLException {
24+ Task task = new Task .Builder ()
25+ .data ("foobar" )
26+ .timeout (5 )
27+ .build ();
28+
29+ Assert .assertEquals ("<Task timeout=\" 5\" >foobar</Task>" , task .toXml ());
30+ }
31+
2232 @ Test
2333 public void testUrl () throws TwiMLException {
2434 Task task = new Task .Builder ()
You can’t perform that action at this time.
0 commit comments