use of com.google.api.services.calendar.model.EventAttendee in project camel by apache.
the class CalendarEventsIntegrationTest method testInsert.
@Test
public void testInsert() throws Exception {
Event event = new Event();
event.setSummary("Feed the Camel");
event.setLocation("Somewhere");
ArrayList<EventAttendee> attendees = new ArrayList<EventAttendee>();
attendees.add(new EventAttendee().setEmail("camel-google-calendar.janstey@gmail.com"));
event.setAttendees(attendees);
Date startDate = new Date();
Date endDate = new Date(startDate.getTime() + 3600000);
DateTime start = new DateTime(startDate, TimeZone.getTimeZone("UTC"));
event.setStart(new EventDateTime().setDateTime(start));
DateTime end = new DateTime(endDate, TimeZone.getTimeZone("UTC"));
event.setEnd(new EventDateTime().setDateTime(end));
final Map<String, Object> headers = new HashMap<String, Object>();
// parameter type is String
headers.put("CamelGoogleCalendar.calendarId", getCalendar().getId());
// parameter type is com.google.api.services.calendar.model.Event
headers.put("CamelGoogleCalendar.content", event);
final com.google.api.services.calendar.model.Event result = requestBodyAndHeaders("direct://INSERT", null, headers);
assertEquals("Feed the Camel", result.getSummary());
LOG.debug("insert: " + result);
}
Aggregations