Skip to content

Commit

Permalink
Fixing tests: There were two types of errors
Browse files Browse the repository at this point in the history
 * Some tests had nonutf-8 characters but expected a UTF-8 decoding
 * Some tests expected certain things query params to be in order
 * Code was not properly escaping to UTF-8.
  • Loading branch information
secondsun committed Aug 23, 2015
1 parent a4078a2 commit 5d1b432
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Expand Up @@ -167,7 +167,7 @@ public void getCalendar_escaped() {
.andRespond(
withSuccess(jsonResource("mock_get_calendar_primary"), APPLICATION_JSON));

Calendar cal = google.calendarOperations().getCalendar("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?");
Calendar cal = google.calendarOperations().getCalendar("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?");

assertNotNull(cal);
// NB queried for "primary" but actually get back the real ID.
Expand Down
Expand Up @@ -96,7 +96,7 @@ public void listEvents_primary_fromPage_escaping() {

EventPage eventPage = google.calendarOperations()
.eventListQuery(CalendarOperations.PRIMARY_CALENDAR_ID)
.fromPage("abc123_¬!£$%^&*()_+-=[]{};'#:@~,./<>?")
.fromPage("abc123_¬!£$%^&*()_+-=[]{};'#:@~,./<>?")
.getPage();

assertNotNull(eventPage);
Expand Down Expand Up @@ -436,18 +436,18 @@ public void listEvents_primary_combined_options() {

EventPage eventPage = google.calendarOperations()
.eventListQuery(CalendarOperations.PRIMARY_CALENDAR_ID)
.fromPage("pretendPageToken")
.alwaysIncludeEmail(true)
.iCalUID("test-iCalUID")
.maxAttendees(9)
.maxResultsNumber(50)
.orderBy(OrderBy.START_TIME)
.alwaysIncludeEmail(true)
.orderBy(OrderBy.START_TIME)
.timeZone(TEST_TIMEZONE)
.fromPage("pretendPageToken")
.singleEvents(true)
.showHiddenInvitations(true)
.maxResultsNumber(50)
.maxAttendees(9)
.timeMin(TEST_TIME_MIN)
.iCalUID("test-iCalUID")
.showDeleted(true)
.showHiddenInvitations(true)
.singleEvents(true)
.timeMax(TEST_TIME_MAX)
.timeMin(TEST_TIME_MIN)
.timeZone(TEST_TIMEZONE)
.timeMax(TEST_TIME_MAX)
.updatedMin(TEST_UPDATED_MIN)
.getPage();

Expand All @@ -464,7 +464,7 @@ public void listEvents_escape_calendarId() {
withSuccess(jsonResource("mock_get_event"), APPLICATION_JSON));

EventPage eventPage = google.calendarOperations()
.eventListQuery("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?")
.eventListQuery("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?")
.getPage();

assertNotNull(eventPage);
Expand All @@ -480,8 +480,8 @@ public void listEvents_escape_pageToken() {
withSuccess(jsonResource("mock_list_events_empty"), APPLICATION_JSON));

EventPage eventPage = google.calendarOperations()
.eventListQuery("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?")
.fromPage("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?")
.eventListQuery("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?")
.fromPage("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?")
.getPage();

assertNotNull(eventPage);
Expand Down Expand Up @@ -512,7 +512,7 @@ public void getEvent_escape_calendarId() {
.andRespond(
withSuccess(jsonResource("mock_get_event"), APPLICATION_JSON));

Event event = google.calendarOperations().getEvent("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?", "abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?");
Event event = google.calendarOperations().getEvent("abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?", "abc123!\"£$%^&*()_+-=[]{};'#:@~,./<>?");

assertNotNull(event);
}
Expand Down

0 comments on commit 5d1b432

Please sign in to comment.