topics.add("Google");
topics.add("Cloud");
topics.add("Platform");
ConferenceForm conferenceForm = new ConferenceForm(
NAME, DESCRIPTION, topics, CITY, startDate, endDate, CAP);
Conference conference = conferenceApi.createConference(user, conferenceForm);
// Check the return value.
assertEquals(NAME, conference.getName());
assertEquals(DESCRIPTION, conference.getDescription());
assertEquals(topics, conference.getTopics());
assertEquals(USER_ID, conference.getOrganizerUserId());
assertEquals(CITY, conference.getCity());
assertEquals(startDate, conference.getStartDate());
assertEquals(endDate, conference.getEndDate());
assertEquals(CAP, conference.getMaxAttendees());
assertEquals(CAP, conference.getSeatsAvailable());
assertEquals(MONTH, conference.getMonth());
// Update it with new values.
String newName = "Google I/O";
String newDescription = "Google's annual developer event.";
String newCity = "San Francisco";
startDate = dateFormat.parse("06/25/2014");
endDate = dateFormat.parse("06/26/2014");
topics = new ArrayList<>();
topics.add("Google");
topics.add("Developers");
int newCap = 5000;
conferenceForm = new ConferenceForm(newName, newDescription, topics, newCity, startDate,
endDate, newCap);
conference = conferenceApi.updateConference(
user, conferenceForm, conference.getWebsafeKey());
assertEquals(newName, conference.getName());
assertEquals(newDescription, conference.getDescription());
assertEquals(topics, conference.getTopics());
assertEquals(USER_ID, conference.getOrganizerUserId());
assertEquals(newCity, conference.getCity());
assertEquals(startDate, conference.getStartDate());
assertEquals(endDate, conference.getEndDate());
assertEquals(newCap, conference.getMaxAttendees());
assertEquals(newCap, conference.getSeatsAvailable());
assertEquals(6, conference.getMonth());
}