mockServer
.expect(requestTo("https://www.googleapis.com/plus/v1/people/me/moments/vault"))
.andExpect(method(POST))
.andRespond(
withSuccess(jsonResource("moment"), APPLICATION_JSON));
Moment moment = google
.plusOperations()
.insertMoment(
new AddActivity(
"https://developers.google.com/+/plugins/snippet/examples/thing"));
assertTrue(moment instanceof AddActivity);
assertEquals(
"Eg0xNDAwNDE2MjQ1ODY2GJa6uYvcss-izgEpCHuQgEQo0AkyAhAUQgcY1OXS0c8e",
moment.getId());
assertEquals(
"https://developers.google.com/+/plugins/snippet/examples/thing",
moment.getTarget().getUrl());
}