View Source SmartCity.TestDataGenerator (smart_city_test v3.0.0)

Module that generates test data for Smart City project.

Link to this section Summary

Functions

Creates and returns a new SmartCity.AccessGroup example

Creates and returns a new SmartCity.Data example

Creates and returns a predefined number of SmartCity.Data examples

Creates and returns a new SmartCity.Dataset example

Creates and returns a new SmartCity.Ingestion example

Creates and returns a new SmartCity.Organization example

Creates a SmartCity.User with defined overrides. Overrides are a map which can contain the keys: subject_id, email, name. If an override is not provided for a particular property, a random one will be generated.

Link to this section Functions

Link to this function

add_system_name(dataset_map)

View Source
Link to this function

create_access_group(overrides)

View Source
@spec create_access_group(
  %{
    optional(:description) => String.t(),
    optional(:id) => String.t(),
    optional(:name) => String.t()
  }
  | Enumerable.t()
) :: SmartCity.Organization

Creates and returns a new SmartCity.AccessGroup example

@spec create_data(
  %{
    optional(:dataset_ids) => [String.t()],
    optional(:_metadata) => map(),
    optional(:operational) => map(),
    optional(:payload) => map()
  }
  | Enumerable.t()
) :: SmartCity.Data

Creates and returns a new SmartCity.Data example

Link to this function

create_data(overrides, number)

View Source
@spec create_data(
  %{
    optional(:dataset_ids) => [String.t()],
    optional(:_metadata) => map(),
    optional(:operational) => map(),
    optional(:payload) => map()
  }
  | Enumerable.t(),
  integer()
) :: SmartCity.Data

Creates and returns a predefined number of SmartCity.Data examples

Link to this function

create_dataset(overrides)

View Source
@spec create_dataset(
  %{
    optional(:id) => String.t(),
    optional(:business) => SmartCity.Dataset.Business,
    optional(:technical) => SmartCity.Dataset.Technical
  }
  | Enumerable.t()
) :: SmartCity.Dataset

Creates and returns a new SmartCity.Dataset example

Link to this function

create_ingestion(overrides)

View Source
@spec create_ingestion(
  %{
    optional(:id) => String.t(),
    optional(:allow_duplicates) => boolean(),
    optional(:cadence) => String.t(),
    optional(:extractSteps) => [map()],
    optional(:schema) => [map()],
    optional(:sourceFormat) => String.t(),
    optional(:targetDatasets) => [String.t()],
    optional(:topLevelSelector) => String.t(),
    optional(:transformations) => [SmartCity.Ingestion.Transformation.t()]
  }
  | Enumerable.t()
) :: SmartCity.Ingestion

Creates and returns a new SmartCity.Ingestion example

Link to this function

create_organization(overrides)

View Source
@spec create_organization(
  %{
    optional(:description) => String.t(),
    optional(:homepage) => String.t(),
    optional(:id) => String.t(),
    optional(:logoUrl) => String.t(),
    optional(:orgName) => String.t(),
    optional(:orgTitle) => String.t(),
    optional(:dn) => String.t()
  }
  | Enumerable.t()
) :: SmartCity.Organization

Creates and returns a new SmartCity.Organization example

Link to this function

create_transformation(overrides)

View Source
@spec create_transformation(
  %{
    optional(:type) => String.t(),
    optional(:parameters) => map(),
    optional(:id) => String.t(),
    optional(:sequence) => Integer.t()
  }
  | Enumerable.t()
) :: SmartCity.Ingestion.Transformation

Creates and returns a new SmartCity.Ingestion.Transformation example

@spec create_user(%{} | Enumberable.t()) :: SmartCity.User

Creates a SmartCity.User with defined overrides. Overrides are a map which can contain the keys: subject_id, email, name. If an override is not provided for a particular property, a random one will be generated.