private static final String MYSPACE_ID = "495184236";
@Test
public void create() {
try {
Client client = new Client(new MySpaceProvider(),
new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));
MediaItem mediaItem = new MediaItem();
mediaItem.setUrl("http://api.myspace.com/v1/users/63129100");
Notification notification = new Notification();
notification.setContent("Hi ${recipient}, here's a notification from " +
"${canvasUrl}");
notification.addRecipient("495184236");
notification.addMediaItem(mediaItem);
Request request = NotificationsService.createNotification(notification);
Response response = client.send(request);
assertTrue(response.getStatusLink() != null);
} catch (Exception e) {
fail("Exception occurred while processing request");
}