Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/twilio/http/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Request {

private static final String DEFAULT_REGION = "us1";

public static final String QUERY_STRING_DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
public static final String QUERY_STRING_DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssXXX";
public static final String QUERY_STRING_DATE_FORMAT = "yyyy-MM-dd";

private final HttpMethod method;
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/twilio/http/RequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void testAddQueryDateTimeRangeLowerBound() throws MalformedURLException {
Request r = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/foobar");
r.addQueryDateTimeRange("baz", ZonedDateTime.of(2014, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC), null);
URL url = r.constructURL();
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz>=2014-01-01T00:00:00");
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz>=2014-01-01T00:00:00Z");
assertUrlsEqual(expected, url);
}

Expand All @@ -185,7 +185,7 @@ public void testAddQueryDateTimeRangeUpperBound() throws MalformedURLException {
Request r = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/foobar");
r.addQueryDateTimeRange("baz", null, ZonedDateTime.of(2014, 1, 1, 22, 0, 0, 0, ZoneOffset.UTC));
URL url = r.constructURL();
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz<=2014-01-01T22:00:00");
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz<=2014-01-01T22:00:00Z");
assertUrlsEqual(expected, url);
}

Expand All @@ -195,7 +195,7 @@ public void testAddQueryDateTimeRangeClosed() throws MalformedURLException {
r.addQueryDateTimeRange("baz", ZonedDateTime.of(2014, 1, 10, 14, 0, 0, 0, ZoneOffset.UTC),
ZonedDateTime.of(2014, 6, 1, 16, 0, 0, 0, ZoneOffset.UTC));
URL url = r.constructURL();
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz>=2014-01-10T14:00:00&baz<=2014-06-01T16:00:00");
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz>=2014-01-10T14:00:00Z&baz<=2014-06-01T16:00:00Z");
assertUrlsEqual(expected, url);
}

Expand All @@ -207,7 +207,7 @@ public void testAddQueryDateTimeRangeClosedNotUTC() throws MalformedURLException
ZonedDateTime end = ZonedDateTime.of(2014, 6, 1, 16, 0, 0, 0, z);
r.addQueryDateTimeRange("baz", begin, end);
URL url = r.constructURL();
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz>=2014-01-10T20:00:00&baz<=2014-06-01T21:00:00");
URL expected = new URL("https://api.twilio.com/2010-04-01/foobar?baz>=2014-01-10T20:00:00Z&baz<=2014-06-01T21:00:00Z");
assertUrlsEqual(expected, url);
}

Expand Down