@Override protected GenericModel<ConfigurationSchemaDto> newInstance(Long id) { return new ConfigurationSchema(id); }
/** * Instantiates the Configuration. */ public Configuration(ConfigurationDto dto) { super(dto); if (dto != null) { Long schemaId = getLongId(dto.getSchemaId()); this.configurationSchema = schemaId != null ? new ConfigurationSchema(schemaId) : null; this.configurationBody = stringToBinary(dto.getBody()); this.schemaVersion = dto.getSchemaVersion(); } }
new ConfigurationSchema(configurationSchema))); return configurationSchemaDto;
protected List<ConfigurationSchema> generateConfSchema(Application app, int count) { List<ConfigurationSchema> schemas = Collections.emptyList(); try { if (app == null) { app = generateApplication(null); } CtlSchema ctlSchema = generateCTLSchema(DEFAULT_FQN, 1, app.getTenant(), null); ConfigurationSchema schema; schemas = new ArrayList<>(count); for (int i = 0; i < count; i++) { schema = new ConfigurationSchema(); schema.setApplication(app); schema.setCreatedUsername("Test User"); schema.setCtlSchema(ctlSchema); schema.setVersion(i + 1); schema.setName("Test Name"); schema = configurationSchemaDao.save(schema); Assert.assertNotNull(schema); schemas.add(schema); } } catch (Exception ex) { LOG.error("Can't generate configuration schemas {}", ex); Assert.fail("Can't generate configuration schemas." + ex.getMessage()); } return schemas; }