@Test
public void testNotificationSubscriptionUpdates() throws Throwable {
subscribe();
state.documentSelfLink = state.documentSelfLink;
doOperation(Action.PUT, state);
notification = getNotification();
assertNotNull(notification);
assertNotNull(notification.getResult());
assertTrue(notification.isUpdate());
updatedState = notification.getResult();
assertEquals(updatedTestId, updatedState.id);
assertEquals(updatedTestValue, updatedState.image);
state.id = updatedTestValue + updatedTestId;
doOperation(Action.PATCH, state);
notification = getNotification();
assertNotNull(notification.getResult());
assertTrue(notification.isUpdate());
updatedState = notification.getResult();
assertEquals(updatedTestValue + updatedTestId, updatedState.id);
assertEquals(updatedTestValue, updatedState.image);
doOperation(Action.DELETE, new ServiceDocument());
notification = getNotification();
assertNotNull(notification.getResult());
assertTrue(notification.isDelete());
assertFalse(subscriptionManager.isSubscribed());
}