@Override protected GenericModel<NotificationSchemaDto> newInstance(Long id) { return new NotificationSchema(id); }
return getDto(notificationSchemaDao.save(new NotificationSchema(notificationSchemaDto)));
protected List<NotificationSchema> generateNotificationSchema(Application app, int ctlVersion, int count, NotificationTypeDto type) { List<NotificationSchema> schemas = Collections.emptyList(); try { if (app == null) { app = generateApplication(null); } CtlSchema ctlSchema = generateCTLSchema(DEFAULT_FQN, ctlVersion, app.getTenant(), null); NotificationSchema schemaDto; schemas = new ArrayList<>(count); for (int i = 0; i < count; i++) { schemaDto = new NotificationSchema(); schemaDto.setApplication(app); schemaDto.setCreatedUsername("Test User"); schemaDto.setCtlSchema(ctlSchema); schemaDto.setVersion(i + 1); schemaDto.setName("Test Name"); schemaDto.setType(type); schemaDto = notificationSchemaDao.save(schemaDto); Assert.assertNotNull(schemaDto); schemas.add(schemaDto); } } catch (Exception ex) { LOG.error("Can't generate profile schema {}", ex); Assert.fail("Can't generate profile schema." + ex.getMessage()); } return schemas; }