use of com.google.api.services.calendar.model.Calendar in project camel by apache.
the class AbstractGoogleCalendarTestSupport method createTestCalendar.
@Before
public void createTestCalendar() {
Calendar calendar = new Calendar();
Random rand = new Random();
calendar.setSummary("camel-calendar-" + rand.nextInt());
calendar.setTimeZone("America/St_Johns");
this.calendar = requestBody("google-calendar://calendars/insert?inBody=content", calendar);
}
use of com.google.api.services.calendar.model.Calendar in project camel by apache.
the class CalendarCalendarListIntegrationTest method testCalendarList.
@Test
public void testCalendarList() throws Exception {
Calendar calendar = getCalendar();
assertTrue("Test calendar should be in the list", isCalendarInList(calendar));
CalendarListEntry calendarFromGet = requestBody("direct://GET", calendar.getId());
assertTrue(calendar.getId().equals(calendarFromGet.getId()));
}
use of com.google.api.services.calendar.model.Calendar in project camel by apache.
the class CalendarCalendarsIntegrationTest method testCalendars.
@Test
public void testCalendars() throws Exception {
Calendar calendar = getCalendar();
Calendar calendarFromGet = requestBody("direct://GET", calendar.getId());
assertTrue(calendar.getId().equals(calendarFromGet.getId()));
final Map<String, Object> headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleCalendar.calendarId", calendar.getId());
// parameter type is com.google.api.services.calendar.model.Calendar
headers.put("CamelGoogleCalendar.content", calendar.setDescription("foo"));
Calendar result = requestBodyAndHeaders("direct://UPDATE", null, headers);
assertTrue("foo".equals(result.getDescription()));
requestBody("direct://DELETE", calendar.getId());
try {
calendarFromGet = requestBody("direct://GET", calendar.getId());
assertTrue("Should have not found deleted calendar.", false);
} catch (Exception e) {
e.printStackTrace();
}
}