@Override public void removeNotificationSchemasByAppId(String appId) { validateId(appId, "Can't remove notification schemas. Invalid application id: " + appId); LOG.debug("Cascade remove corresponding notification to application id [{}]", appId); unicastNotificationDao.removeNotificationsByAppId(appId); notificationSchemaDao.removeNotificationSchemasByAppId(appId); }
@Test public void testRemoveNotificationSchemasByAppId() throws Exception { Application application = generateApplication(null); generateNotificationSchema(application, 1, 1, null); notificationSchemaDao.removeNotificationSchemasByAppId(application.getStringId()); List<NotificationSchema> found = notificationSchemaDao.findNotificationSchemasByAppId(application.getStringId()); Assert.assertTrue(found.isEmpty()); }