@Override public NotificationSchemaDto findNotificationSchemaByAppIdAndTypeAndVersion( String appId, NotificationTypeDto type, int majorVersion) { validateId(appId, "Can't find notification schema. Invalid application id: " + appId); return getDto(notificationSchemaDao.findNotificationSchemasByAppIdAndTypeAndVersion( appId, type, majorVersion)); }
@Test public void testFindNotificationSchemasByAppIdAndTypeAndVersion() throws Exception { Application application = generateApplication(null); generateNotificationSchema(application, 1, 1, NotificationTypeDto.SYSTEM); List<NotificationSchema> userSchemas = generateNotificationSchema(application, 2, 3, NotificationTypeDto.USER); NotificationSchema expected = userSchemas.get(2); NotificationSchema found = notificationSchemaDao.findNotificationSchemasByAppIdAndTypeAndVersion(application.getStringId(), NotificationTypeDto.USER, expected.getVersion()); Assert.assertEquals(expected, found); }