public static Catalog createRandomCatalog()

in component-test/src/main/java/org/apache/fineract/cn/customer/catalog/util/CatalogGenerator.java [34:66]


  public static Catalog createRandomCatalog() {
    final Catalog catalog = new Catalog();
    catalog.setIdentifier(RandomStringUtils.randomAlphanumeric(32));
    catalog.setName(RandomStringUtils.randomAlphanumeric(256));
    catalog.setDescription(RandomStringUtils.randomAlphanumeric(4096));

    final Field simpleField = new Field();
    simpleField.setDataType(Field.DataType.NUMBER.name());
    simpleField.setIdentifier(RandomStringUtils.randomAlphanumeric(32));
    simpleField.setLabel(RandomStringUtils.randomAlphanumeric(256));
    simpleField.setHint(RandomStringUtils.randomAlphanumeric(512));
    simpleField.setDescription(RandomStringUtils.randomAlphanumeric(4096));
    simpleField.setMandatory(Boolean.FALSE);
    simpleField.setLength(10);
    simpleField.setPrecision(2);
    simpleField.setMinValue(0.00D);
    simpleField.setMaxValue(99999999.99D);

    final Field optionField = new Field();
    optionField.setDataType(Field.DataType.SINGLE_SELECTION.name());
    optionField.setIdentifier(RandomStringUtils.randomAlphanumeric(32));
    optionField.setLabel(RandomStringUtils.randomAlphanumeric(256));
    optionField.setHint(RandomStringUtils.randomAlphanumeric(512));
    optionField.setDescription(RandomStringUtils.randomAlphanumeric(4096));
    optionField.setMandatory(Boolean.FALSE);
    final Option option = new Option();
    option.setLabel(RandomStringUtils.randomAlphanumeric(256));
    option.setValue(1);
    optionField.setOptions(Arrays.asList(option));

    catalog.setFields(Arrays.asList(simpleField, optionField));
    return catalog;
  }