@Test
public void canDeleteNotificationEndPointById() throws Exception {
String testNotificationEndPointName = testNotificationEndPointPrefix
+ "ToDelete";
NotificationEndPointInfo notificationEndPointToBeDeleted = service
.create(NotificationEndPoint.create(
testNotificationEndPointName, EndPointType.AzureQueue,
testEndPointAddress));
List<NotificationEndPointInfo> listNotificationEndPointsResult = service
.list(NotificationEndPoint.list());
int notificationEndPointBaseline = listNotificationEndPointsResult.size();
service.delete(NotificationEndPoint
.delete(notificationEndPointToBeDeleted.getId()));
listNotificationEndPointsResult = service.list(NotificationEndPoint.list());
assertEquals("listNotificationEndPointResult.size", notificationEndPointBaseline - 1,
listNotificationEndPointsResult.size());
for (NotificationEndPointInfo policy : service
.list(NotificationEndPoint.list())) {
assertFalse(notificationEndPointToBeDeleted.getId().equals(
policy.getId()));
}
expectedException.expect(ServiceException.class);
expectedException.expect(new ServiceExceptionMatcher(404));
service.get(NotificationEndPoint.get(notificationEndPointToBeDeleted
.getId()));
}