zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

commit 5d8809def2fa5627956fd75a99453b0a6ed303ba
parent 516e210ac7a3d2250131d2d4edd9e2bb52f8dec4
Author: srfsh <dev@srf.sh>
Date:   Tue, 23 Aug 2022 12:25:13 +0300

ZenflowsTest.{Help,VF}: switch to str and str_list

Diffstat:
Mtest/help/factory.ex | 149+++++++++++++++++++++++++++++++++++--------------------------------------------
Mtest/vf/agent_relationship/domain.test.exs | 2+-
Mtest/vf/agent_relationship/type.test.exs | 2+-
Mtest/vf/agent_relationship_role/domain.test.exs | 6+++---
Mtest/vf/agent_relationship_role/type.test.exs | 6+++---
Mtest/vf/appreciation.test.exs | 2+-
Mtest/vf/claim.test.exs | 6+++---
Mtest/vf/commitment.test.exs | 6+++---
Mtest/vf/economic_resource/domain.test.exs | 8++++----
Mtest/vf/economic_resource/type.test.exs | 4++--
Mtest/vf/fulfillment.test.exs | 2+-
Mtest/vf/intent/domain.test.exs | 8++++----
Mtest/vf/intent/type.test.exs | 8++++----
Mtest/vf/organization/domain.test.exs | 6+++---
Mtest/vf/organization/type.test.exs | 6+++---
Mtest/vf/person/domain.test.exs | 8++++----
Mtest/vf/person/type.test.exs | 8++++----
Mtest/vf/plan/type.test.exs | 4++--
Mtest/vf/process/domain.test.exs | 6+++---
Mtest/vf/process/type.test.exs | 6+++---
Mtest/vf/process_specification/domain.test.exs | 4++--
Mtest/vf/process_specification/type.test.exs | 4++--
Mtest/vf/product_batch/domain.test.exs | 2+-
Mtest/vf/product_batch/type.test.exs | 2+-
Mtest/vf/proposal.test.exs | 4++--
Mtest/vf/recipe_exchange/domain.test.exs | 4++--
Mtest/vf/recipe_exchange/type.test.exs | 4++--
Mtest/vf/recipe_flow/domain.test.exs | 2+-
Mtest/vf/recipe_flow/type.test.exs | 2+-
Mtest/vf/recipe_process/domain.test.exs | 6+++---
Mtest/vf/recipe_process/type.test.exs | 6+++---
Mtest/vf/recipe_resource/domain.test.exs | 6+++---
Mtest/vf/recipe_resource/type.test.exs | 6+++---
Mtest/vf/resource_specification/domain.test.exs | 6+++---
Mtest/vf/resource_specification/type.test.exs | 6+++---
Mtest/vf/role_behavior/domain.test.exs | 4++--
Mtest/vf/role_behavior/type.test.exs | 4++--
Mtest/vf/satisfaction.test.exs | 2+-
Mtest/vf/scenario/domain.test.exs | 4++--
Mtest/vf/scenario_definition/domain.test.exs | 4++--
Mtest/vf/settlement.test.exs | 2+-
Mtest/vf/unit/type.test.exs | 4++--
42 files changed, 161 insertions(+), 180 deletions(-)

diff --git a/test/help/factory.ex b/test/help/factory.ex @@ -41,15 +41,6 @@ end Returns the same string with a unique positive integer attached at the end. """ -@spec uniq(String.t()) :: String.t() -def uniq(str) do - str <> "#{System.unique_integer([:positive])}" -end - -@doc """ -Returns the same string with a unique positive integer attached at -the end. -""" @spec str(String.t()) :: String.t() def str(s) do "#{s}#{System.unique_integer([:positive])}" @@ -65,16 +56,6 @@ def str_list(s, min \\ 1, max \\ 10) do end @doc """ -Returns a list of string composed of one or ten items. Each item is -generated by piping `str` to `uniq/1` -""" -@spec uniq_list(String.t()) :: list(String.t()) -def uniq_list(str) do - max = Enum.random(1..10) - Enum.map(1..max, fn _ -> uniq(str) end) -end - -@doc """ Returns a random integer between 0 (inclusive) and `max` (exclusive). """ @spec int() :: integer() @@ -100,7 +81,7 @@ end @doc "Returns a unique URI string." @spec uri() :: String.t() def uri() do - uniq("schema://user@host:port/path") + str("schema://user@host:port/path") end @doc "Returns a unique base64 encoded string (mock-up of image data)" @@ -144,8 +125,8 @@ end def build(:unit) do %VF.Unit{ - label: uniq("some label"), - symbol: uniq("some symbol"), + label: str("some label"), + symbol: str("some symbol"), } end @@ -158,12 +139,12 @@ end def build(:spatial_thing) do %VF.SpatialThing{ - name: uniq("some name"), - mappable_address: uniq("some mappable_address"), + name: str("some name"), + mappable_address: str("some mappable_address"), lat: float(), long: float(), alt: float(), - note: uniq("some note"), + note: str("some note"), } end @@ -173,16 +154,16 @@ end def build(:process_specification) do %VF.ProcessSpecification{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), } end def build(:resource_specification) do %VF.ResourceSpecification{ - name: uniq("some name"), - resource_classified_as: uniq_list("some uri"), - note: uniq("some note"), + name: str("some name"), + resource_classified_as: str_list("some uri"), + note: str("some note"), image: img(), default_unit_of_effort: build(:unit), default_unit_of_resource: build(:unit), @@ -191,13 +172,13 @@ end def build(:recipe_resource) do %VF.RecipeResource{ - name: uniq("some name"), + name: str("some name"), unit_of_resource: build(:unit), unit_of_effort: build(:unit), - resource_classified_as: uniq_list("some uri"), + resource_classified_as: str_list("some uri"), resource_conforms_to: build(:resource_specification), substitutable: bool(), - note: uniq("some note"), + note: str("some note"), image: img(), } end @@ -205,9 +186,9 @@ end def build(:recipe_process) do dur = build(:iduration) %VF.RecipeProcess{ - name: uniq("some name"), - note: uniq("some note"), - process_classified_as: uniq_list("some uri"), + name: str("some name"), + note: str("some note"), + process_classified_as: str_list("some uri"), process_conforms_to: build(:process_specification), has_duration_unit_type: dur.unit_type, has_duration_numeric_duration: dur.numeric_duration, @@ -216,8 +197,8 @@ end def build(:recipe_exchange) do %VF.RecipeExchange{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), } end @@ -234,19 +215,19 @@ def build(:recipe_flow) do effort_quantity_has_unit: effqty.has_unit, effort_quantity_has_numerical_value: effqty.has_numerical_value, recipe_clause_of: build(:recipe_exchange), - note: uniq("some note"), + note: str("some note"), } end def build(:person) do %VF.Person{ type: :per, - name: uniq("some name"), + name: str("some name"), image: img(), - note: uniq("some note"), + note: str("some note"), primary_location: build(:spatial_thing), - user: uniq("some user"), - email: "#{uniq("user")}@example.com", + user: str("some user"), + email: "#{str("user")}@example.com", # Normally, these are encoded by zenroom (with whatever # encodings it chooses to use), but for testing, this'll # work alright. @@ -261,10 +242,10 @@ end def build(:organization) do %VF.Organization{ type: :org, - name: uniq("some name"), + name: str("some name"), image: img(), - classified_as: uniq_list("some uri"), - note: uniq("some note"), + classified_as: str_list("some uri"), + note: str("some note"), primary_location: build(:spatial_thing), } end @@ -276,17 +257,17 @@ end def build(:role_behavior) do %VF.RoleBehavior{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), } end def build(:agent_relationship_role) do %VF.AgentRelationshipRole{ role_behavior: build(:role_behavior), - role_label: uniq("some role label"), - inverse_role_label: uniq("some role label"), - note: uniq("some note"), + role_label: str("some role label"), + inverse_role_label: str("some role label"), + note: str("some note"), } end @@ -296,22 +277,22 @@ def build(:agent_relationship) do object: build(:agent), relationship: build(:agent_relationship_role), # in_scope_of: - note: uniq("some note"), + note: str("some note"), } end def build(:agreement) do %VF.Agreement{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), } end def build(:scenario_definition) do dur = build(:iduration) %VF.ScenarioDefinition{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), has_duration_unit_type: dur.unit_type, has_duration_numeric_duration: dur.numeric_duration, } @@ -321,8 +302,8 @@ def build(:scenario) do recurse? = bool() %VF.Scenario{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), has_beginning: now(), has_end: now(), defined_as: build(:scenario_definition), @@ -332,21 +313,21 @@ end def build(:plan) do %VF.Plan{ - name: uniq("some name"), + name: str("some name"), due: now(), - note: uniq("some note"), + note: str("some note"), refinement_of: build(:scenario), } end def build(:process) do %VF.Process{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), has_beginning: now(), has_end: now(), finished: bool(), - classified_as: uniq_list("some uri"), + classified_as: str_list("some uri"), based_on: build(:process_specification), # in_scope_of: planned_within: build(:plan), @@ -356,7 +337,7 @@ end def build(:product_batch) do %VF.ProductBatch{ - batch_number: uniq("some batch number"), + batch_number: str("some batch number"), expiry_date: now(), production_date: now(), } @@ -367,11 +348,11 @@ def build(:economic_resource) do qty = build(:imeasure) %VF.EconomicResource{ - name: uniq("some name"), - note: uniq("some note"), + name: str("some name"), + note: str("some note"), image: img(), - tracking_identifier: uniq("some tracking identifier"), - classified_as: uniq_list("some uri"), + tracking_identifier: str("some tracking identifier"), + classified_as: str_list("some uri"), conforms_to: build(:resource_specification), accounting_quantity_has_unit: qty.has_unit, accounting_quantity_has_numerical_value: qty.has_numerical_value, @@ -396,7 +377,7 @@ def build(:appreciation) do %VF.Appreciation{ appreciation_of: build(:economic_event), appreciation_with: build(:economic_event), - note: uniq("some note"), + note: str("some note"), } end @@ -407,13 +388,13 @@ def build(:intent) do availqty = build(:imeasure) %VF.Intent{ - name: uniq("some name"), + name: str("some name"), action_id: build(:action_id), provider: if(agent_mutex?, do: build(:agent)), receiver: unless(agent_mutex?, do: build(:agent)), input_of: build(:process), output_of: build(:process), - resource_classified_as: uniq_list("some uri"), + resource_classified_as: str_list("some uri"), resource_conforms_to: build(:resource_specification), resource_inventoried_as: build(:economic_resource), resource_quantity_has_unit: resqty.has_unit, @@ -429,9 +410,9 @@ def build(:intent) do due: now(), finished: bool(), image: img(), - note: uniq("some note"), + note: str("some note"), # in_scope_of: - agreed_in: uniq("some uri"), + agreed_in: str("some uri"), } end @@ -447,7 +428,7 @@ def build(:commitment) do receiver: build(:agent), input_of: build(:process), output_of: build(:process), - resource_classified_as: uniq_list("some uri"), + resource_classified_as: str_list("some uri"), resource_conforms_to: if(resource_mutex?, do: build(:resource_specification)), resource_inventoried_as: unless(resource_mutex?, do: build(:economic_resource)), resource_quantity_has_unit: resqty.has_unit, @@ -459,9 +440,9 @@ def build(:commitment) do has_point_in_time: unless(datetime_mutex?, do: now()), due: now(), finished: bool(), - note: uniq("some note"), + note: str("some note"), # in_scope_of: - agreed_in: uniq("some uri"), + agreed_in: str("some uri"), independent_demand_of: build(:plan), at_location: build(:spatial_thing), clause_of: build(:agreement), @@ -473,7 +454,7 @@ def build(:fulfillment) do effqty = build(:imeasure) %VF.Fulfillment{ - note: uniq("some note"), + note: str("some note"), fulfilled_by: build(:economic_event), fulfills: build(:commitment), resource_quantity_has_unit: resqty.has_unit, @@ -503,7 +484,7 @@ def build(:satisfaction) do resource_quantity_has_numerical_value: resqty.has_numerical_value, effort_quantity_has_unit: effqty.has_unit, effort_quantity_has_numerical_value: effqty.has_numerical_value, - note: uniq("some note"), + note: str("some note"), } end @@ -515,7 +496,7 @@ def build(:claim) do action_id: build(:action_id), provider: build(:agent), receiver: build(:agent), - resource_classified_as: uniq_list("some uri"), + resource_classified_as: str_list("some uri"), resource_conforms_to: build(:resource_specification), resource_quantity_has_unit: resqty.has_unit, resource_quantity_has_numerical_value: resqty.has_numerical_value, @@ -524,8 +505,8 @@ def build(:claim) do triggered_by: if(bool(), do: build(:economic_event), else: nil), due: now(), finished: bool(), - agreed_in: uniq("some uri"), - note: uniq("some note"), + agreed_in: str("some uri"), + note: str("some note"), # in_scope_of: } end @@ -541,17 +522,17 @@ def build(:settlement) do resource_quantity_has_numerical_value: resqty.has_numerical_value, effort_quantity_has_unit: effqty.has_unit, effort_quantity_has_numerical_value: effqty.has_numerical_value, - note: uniq("some note"), + note: str("some note"), } end def build(:proposal) do %VF.Proposal{ - name: uniq("some name"), + name: str("some name"), has_beginning: now(), has_end: now(), unit_based: bool(), - note: uniq("some note"), + note: str("some note"), eligible_location: build(:spatial_thing), } end diff --git a/test/vf/agent_relationship/domain.test.exs b/test/vf/agent_relationship/domain.test.exs @@ -28,7 +28,7 @@ setup do object_id: Factory.insert!(:agent).id, relationship_id: Factory.insert!(:agent_relationship_role).id, # in_scope_of: - note: Factory.uniq("note"), + note: Factory.str("note"), }, inserted: Factory.insert!(:agent_relationship), } diff --git a/test/vf/agent_relationship/type.test.exs b/test/vf/agent_relationship/type.test.exs @@ -25,7 +25,7 @@ setup do "object" => Factory.insert!(:agent).id, "relationship" => Factory.insert!(:agent_relationship_role).id, # inScopeOf: - "note" => Factory.uniq("note"), + "note" => Factory.str("note"), }, inserted: Factory.insert!(:agent_relationship), } diff --git a/test/vf/agent_relationship_role/domain.test.exs b/test/vf/agent_relationship_role/domain.test.exs @@ -25,9 +25,9 @@ setup do %{ params: %{ role_behavior_id: Factory.insert!(:role_behavior).id, - role_label: Factory.uniq("role label"), - inverse_role_label: Factory.uniq("inverse role label"), - note: Factory.uniq("note"), + role_label: Factory.str("role label"), + inverse_role_label: Factory.str("inverse role label"), + note: Factory.str("note"), }, inserted: Factory.insert!(:agent_relationship_role), } diff --git a/test/vf/agent_relationship_role/type.test.exs b/test/vf/agent_relationship_role/type.test.exs @@ -22,9 +22,9 @@ setup do %{ params: %{ "roleBehavior" => Factory.insert!(:role_behavior).id, - "roleLabel" => Factory.uniq("role label"), - "inverseRoleLabel" => Factory.uniq("inverse role label"), - "note" => Factory.uniq("note"), + "roleLabel" => Factory.str("role label"), + "inverseRoleLabel" => Factory.str("inverse role label"), + "note" => Factory.str("note"), }, inserted: Factory.insert!(:agent_relationship_role), } diff --git a/test/vf/appreciation.test.exs b/test/vf/appreciation.test.exs @@ -24,7 +24,7 @@ setup do %{params: %{ appreciation_of_id: Factory.insert!(:economic_event).id, appreciation_with_id: Factory.insert!(:economic_event).id, - note: Factory.uniq("note"), + note: Factory.str("note"), }} end diff --git a/test/vf/claim.test.exs b/test/vf/claim.test.exs @@ -25,7 +25,7 @@ setup do action_id: Factory.build(:action_id), provider_id: Factory.insert!(:agent).id, receiver_id: Factory.insert!(:agent).id, - resource_classified_as: Factory.uniq_list("uri"), + resource_classified_as: Factory.str_list("uri"), resource_conforms_to_id: Factory.insert!(:resource_specification).id, resource_quantity: %{ has_unit_id: Factory.insert!(:unit).id, @@ -38,8 +38,8 @@ setup do triggered_by_id: Factory.insert!(:economic_event).id, due: Factory.now(), finished: Factory.bool(), - note: Factory.uniq("note"), - agreed_in: Factory.uniq("uri"), + note: Factory.str("note"), + agreed_in: Factory.str("uri"), # in_scope_of_id: }} end diff --git a/test/vf/commitment.test.exs b/test/vf/commitment.test.exs @@ -28,7 +28,7 @@ setup do receiver_id: Factory.insert!(:agent).id, input_of_id: Factory.insert!(:process).id, output_of_id: Factory.insert!(:process).id, - resource_classified_as: Factory.uniq_list("uri"), + resource_classified_as: Factory.str_list("uri"), resource_quantity: %{ has_unit_id: Factory.insert!(:unit).id, has_numerical_value: Factory.float(), @@ -39,9 +39,9 @@ setup do }, due: DateTime.utc_now(), finished: Factory.bool(), - note: Factory.uniq("note"), + note: Factory.str("note"), # in_scope_of_id: - agreed_in: Factory.uniq("uri"), + agreed_in: Factory.str("uri"), independent_demand_of_id: Factory.insert!(:plan).id, at_location_id: Factory.insert!(:spatial_thing).id, clause_of_id: Factory.insert!(:agreement).id, diff --git a/test/vf/economic_resource/domain.test.exs b/test/vf/economic_resource/domain.test.exs @@ -35,11 +35,11 @@ setup ctx do %{id: unit_id} = Factory.insert!(:unit) num_val = Factory.float() params = %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), image: Factory.img(), - tracking_identifier: Factory.uniq("tracking identifier"), - classified_as: Factory.uniq_list("uri"), + tracking_identifier: Factory.str("tracking identifier"), + classified_as: Factory.str_list("uri"), conforms_to_id: Factory.insert!(:resource_specification).id, accounting_quantity: %{ has_unit_id: unit_id, diff --git a/test/vf/economic_resource/type.test.exs b/test/vf/economic_resource/type.test.exs @@ -21,8 +21,8 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "note" => Factory.str("note"), "image" => Factory.img(), }, inserted: Factory.insert!(:economic_resource), diff --git a/test/vf/fulfillment.test.exs b/test/vf/fulfillment.test.exs @@ -22,7 +22,7 @@ alias Zenflows.VF.Fulfillment setup do %{params: %{ - note: Factory.uniq("note"), + note: Factory.str("note"), fulfilled_by_id: Factory.insert!(:economic_event).id, fulfills_id: Factory.insert!(:commitment).id, resource_quantity: %{ diff --git a/test/vf/intent/domain.test.exs b/test/vf/intent/domain.test.exs @@ -41,7 +41,7 @@ setup do receiver_id: Factory.insert!(:agent).id, resource_inventoried_as_id: Factory.insert!(:economic_resource).id, resource_conforms_to_id: Factory.insert!(:resource_specification).id, - resource_classified_as: Factory.uniq_list("uri"), + resource_classified_as: Factory.str_list("uri"), resource_quantity: %{ has_unit_id: Factory.insert!(:unit).id, has_numerical_value: Factory.float(), @@ -61,10 +61,10 @@ setup do finished: Factory.bool(), at_location_id: Factory.insert!(:spatial_thing).id, image: Factory.img(), - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), # in_scope_of_id: - agreed_in: Factory.uniq("uri"), + agreed_in: Factory.str("uri"), }, inserted: Factory.insert!(:intent), } diff --git a/test/vf/intent/type.test.exs b/test/vf/intent/type.test.exs @@ -30,7 +30,7 @@ setup do "receiver" => Factory.insert!(:agent).id, "resourceInventoriedAs" => Factory.insert!(:economic_resource).id, "resourceConformsTo" => Factory.insert!(:resource_specification).id, - "resourceClassifiedAs" => Factory.uniq_list("uri"), + "resourceClassifiedAs" => Factory.str_list("uri"), "resourceQuantity" => %{ "hasUnit" => Factory.insert!(:unit).id, "hasNumericalValue" => Factory.float(), @@ -50,10 +50,10 @@ setup do "finished" => Factory.bool(), "atLocation" => Factory.insert!(:spatial_thing).id, "image" => Factory.img(), - "name" => Factory.uniq("name"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "note" => Factory.str("note"), # inScopeOf: - "agreedIn" => Factory.uniq("uri"), + "agreedIn" => Factory.str("uri"), }, inserted: Factory.insert!(:intent), id: Factory.id(), diff --git a/test/vf/organization/domain.test.exs b/test/vf/organization/domain.test.exs @@ -24,10 +24,10 @@ alias Zenflows.VF.{Organization, Organization.Domain} setup do %{ params: %{ - name: Factory.uniq("name"), + name: Factory.str("name"), image: Factory.img(), - classified_as: Factory.uniq_list("uri"), - note: Factory.uniq("note"), + classified_as: Factory.str_list("uri"), + note: Factory.str("note"), primary_location_id: Factory.insert!(:spatial_thing).id, }, inserted: Factory.insert!(:organization), diff --git a/test/vf/organization/type.test.exs b/test/vf/organization/type.test.exs @@ -21,10 +21,10 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), + "name" => Factory.str("name"), "image" => Factory.img(), - "classifiedAs" => Factory.uniq_list("uri"), - "note" => Factory.uniq("note"), + "classifiedAs" => Factory.str_list("uri"), + "note" => Factory.str("note"), "primaryLocation" => Factory.insert!(:spatial_thing).id, }, inserted: Factory.insert!(:organization), diff --git a/test/vf/person/domain.test.exs b/test/vf/person/domain.test.exs @@ -24,12 +24,12 @@ alias Zenflows.VF.{Person, Person.Domain} setup do %{ params: %{ - name: Factory.uniq("name"), + name: Factory.str("name"), image: Factory.img(), - note: Factory.uniq("note"), + note: Factory.str("note"), primary_location_id: Factory.insert!(:spatial_thing).id, - user: Factory.uniq("user"), - email: "#{Factory.uniq("user")}@example.com", + user: Factory.str("user"), + email: "#{Factory.str("user")}@example.com", ecdh_public_key: Base.encode64("ecdh_public_key"), eddsa_public_key: Base.encode64("eddsa_public_key"), ethereum_address: Base.encode64("ethereum_address"), diff --git a/test/vf/person/type.test.exs b/test/vf/person/type.test.exs @@ -21,12 +21,12 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), + "name" => Factory.str("name"), "image" => Factory.img(), - "note" => Factory.uniq("note"), + "note" => Factory.str("note"), "primaryLocation" => Factory.insert!(:spatial_thing).id, - "user" => Factory.uniq("user"), - "email" => "#{Factory.uniq("user")}@example.com", + "user" => Factory.str("user"), + "email" => "#{Factory.str("user")}@example.com", "ecdhPublicKey" => Base.encode64("ecdh_public_key"), "eddsaPublicKey" => Base.encode64("eddsa_public_key"), "ethereumAddress" => Base.encode64("ethereum_address"), diff --git a/test/vf/plan/type.test.exs b/test/vf/plan/type.test.exs @@ -23,8 +23,8 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "note" => Factory.str("note"), "due" => Factory.iso_now(), "refinementOf" => Factory.insert!(:scenario).id, }, diff --git a/test/vf/process/domain.test.exs b/test/vf/process/domain.test.exs @@ -30,12 +30,12 @@ alias Zenflows.VF.{ setup do %{ params: %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), has_beginning: DateTime.utc_now(), has_end: DateTime.utc_now(), finished: Factory.bool(), - classified_as: Factory.uniq_list("class"), + classified_as: Factory.str_list("class"), based_on_id: Factory.insert!(:process_specification).id, planned_within_id: Factory.insert!(:plan).id, nested_in_id: Factory.insert!(:scenario).id, diff --git a/test/vf/process/type.test.exs b/test/vf/process/type.test.exs @@ -21,12 +21,12 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "note" => Factory.str("note"), "hasBeginning" => Factory.iso_now(), "hasEnd" => Factory.iso_now(), "finished" => Factory.bool(), - "classifiedAs" => Factory.uniq_list("class"), + "classifiedAs" => Factory.str_list("class"), "basedOn" => Factory.insert!(:process_specification).id, "plannedWithin" => Factory.insert!(:plan).id, "nestedIn" => Factory.insert!(:scenario).id, diff --git a/test/vf/process_specification/domain.test.exs b/test/vf/process_specification/domain.test.exs @@ -24,8 +24,8 @@ alias Zenflows.VF.{ProcessSpecification, ProcessSpecification.Domain} setup do %{ params: %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), }, inserted: Factory.insert!(:process_specification), } diff --git a/test/vf/process_specification/type.test.exs b/test/vf/process_specification/type.test.exs @@ -21,8 +21,8 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "note" => Factory.str("note"), }, inserted: Factory.insert!(:process_specification), } diff --git a/test/vf/product_batch/domain.test.exs b/test/vf/product_batch/domain.test.exs @@ -24,7 +24,7 @@ alias Zenflows.VF.{ProductBatch, ProductBatch.Domain} setup do %{ params: %{ - batch_number: Factory.uniq("batch number"), + batch_number: Factory.str("batch number"), expiry_date: DateTime.utc_now(), production_date: DateTime.utc_now(), }, diff --git a/test/vf/product_batch/type.test.exs b/test/vf/product_batch/type.test.exs @@ -21,7 +21,7 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "batchNumber" => Factory.uniq("batch number"), + "batchNumber" => Factory.str("batch number"), "expiryDate" => Factory.iso_now(), "productionDate" => Factory.iso_now(), }, diff --git a/test/vf/proposal.test.exs b/test/vf/proposal.test.exs @@ -22,11 +22,11 @@ alias Zenflows.VF.Proposal setup do %{params: %{ - name: Factory.uniq("name"), + name: Factory.str("name"), has_beginning: DateTime.utc_now(), has_end: DateTime.utc_now(), unit_based: Factory.bool(), - note: Factory.uniq("note"), + note: Factory.str("note"), eligible_location_id: Factory.build(:spatial_thing).id, }} end diff --git a/test/vf/recipe_exchange/domain.test.exs b/test/vf/recipe_exchange/domain.test.exs @@ -24,8 +24,8 @@ alias Zenflows.VF.{RecipeExchange, RecipeExchange.Domain} setup do %{ params: %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), }, inserted: Factory.insert!(:recipe_exchange), } diff --git a/test/vf/recipe_exchange/type.test.exs b/test/vf/recipe_exchange/type.test.exs @@ -21,8 +21,8 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "note" => Factory.str("note"), }, inserted: Factory.insert!(:recipe_exchange), } diff --git a/test/vf/recipe_flow/domain.test.exs b/test/vf/recipe_flow/domain.test.exs @@ -45,7 +45,7 @@ setup do has_numerical_value: Factory.float(), }, recipe_clause_of_id: Factory.insert!(:recipe_exchange).id, - note: Factory.uniq("some note"), + note: Factory.str("some note"), }, inserted: Factory.insert!(:recipe_flow), } diff --git a/test/vf/recipe_flow/type.test.exs b/test/vf/recipe_flow/type.test.exs @@ -21,7 +21,7 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "note" => Factory.uniq("some note"), + "note" => Factory.str("some note"), "action" => Factory.build(:action_id), "recipeInputOf" => Factory.insert!(:recipe_process).id, "recipeOutputOf" => Factory.insert!(:recipe_process).id, diff --git a/test/vf/recipe_process/domain.test.exs b/test/vf/recipe_process/domain.test.exs @@ -29,9 +29,9 @@ alias Zenflows.VF.{ setup do %{ params: %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), - process_classified_as: Factory.uniq_list("uri"), + name: Factory.str("name"), + note: Factory.str("note"), + process_classified_as: Factory.str_list("uri"), process_conforms_to_id: Factory.insert!(:process_specification).id, has_duration: Factory.build(:iduration), }, diff --git a/test/vf/recipe_process/type.test.exs b/test/vf/recipe_process/type.test.exs @@ -21,14 +21,14 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), + "name" => Factory.str("name"), "hasDuration" => %{ "unitType" => Factory.build(:time_unit) |> to_string(), "numericDuration" => Factory.float(), }, - "processClassifiedAs" => Factory.uniq_list("uri"), + "processClassifiedAs" => Factory.str_list("uri"), "processConformsTo" => Factory.insert!(:process_specification).id, - "note" => Factory.uniq("note"), + "note" => Factory.str("note"), }, inserted: Factory.insert!(:recipe_process), } diff --git a/test/vf/recipe_resource/domain.test.exs b/test/vf/recipe_resource/domain.test.exs @@ -28,13 +28,13 @@ alias Zenflows.VF.{ setup do %{ params: %{ - name: Factory.uniq("name"), - resource_classified_as: Factory.uniq_list("uri"), + name: Factory.str("name"), + resource_classified_as: Factory.str_list("uri"), unit_of_effort_id: Factory.insert!(:unit).id, unit_of_resource_id: Factory.insert!(:unit).id, resource_conforms_to_id: Factory.insert!(:resource_specification).id, substitutable: Factory.bool(), - note: Factory.uniq("note"), + note: Factory.str("note"), image: Factory.img(), }, inserted: Factory.insert!(:recipe_resource), diff --git a/test/vf/recipe_resource/type.test.exs b/test/vf/recipe_resource/type.test.exs @@ -21,13 +21,13 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "resourceClassifiedAs" => Factory.uniq_list("uri"), + "name" => Factory.str("name"), + "resourceClassifiedAs" => Factory.str_list("uri"), "unitOfEffort" => Factory.insert!(:unit).id, "unitOfResource" => Factory.insert!(:unit).id, "resourceConformsTo" => Factory.insert!(:resource_specification).id, "substitutable" => Factory.bool(), - "note" => Factory.uniq("note"), + "note" => Factory.str("note"), "image" => Factory.img(), }, inserted: Factory.insert!(:recipe_resource), diff --git a/test/vf/resource_specification/domain.test.exs b/test/vf/resource_specification/domain.test.exs @@ -28,9 +28,9 @@ alias Zenflows.VF.{ setup do %{ params: %{ - name: Factory.uniq("name"), - resource_classified_as: Factory.uniq_list("uri"), - note: Factory.uniq("note"), + name: Factory.str("name"), + resource_classified_as: Factory.str_list("uri"), + note: Factory.str("note"), image: Factory.img(), default_unit_of_effort_id: Factory.insert!(:unit).id, default_unit_of_resource_id: Factory.insert!(:unit).id, diff --git a/test/vf/resource_specification/type.test.exs b/test/vf/resource_specification/type.test.exs @@ -21,9 +21,9 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "resourceClassifiedAs" => Factory.uniq_list("uri"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "resourceClassifiedAs" => Factory.str_list("uri"), + "note" => Factory.str("note"), "image" => Factory.img(), "defaultUnitOfEffort" => Factory.insert!(:unit).id, "defaultUnitOfResource" => Factory.insert!(:unit).id, diff --git a/test/vf/role_behavior/domain.test.exs b/test/vf/role_behavior/domain.test.exs @@ -24,8 +24,8 @@ alias Zenflows.VF.{RoleBehavior, RoleBehavior.Domain} setup do %{ params: %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), }, inserted: Factory.insert!(:role_behavior), } diff --git a/test/vf/role_behavior/type.test.exs b/test/vf/role_behavior/type.test.exs @@ -21,8 +21,8 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "name" => Factory.uniq("name"), - "note" => Factory.uniq("note"), + "name" => Factory.str("name"), + "note" => Factory.str("note"), }, inserted: Factory.insert!(:role_behavior), } diff --git a/test/vf/satisfaction.test.exs b/test/vf/satisfaction.test.exs @@ -22,7 +22,7 @@ alias Zenflows.VF.Satisfaction setup do %{params: %{ - note: Factory.uniq("note"), + note: Factory.str("note"), satisfied_by_id: Factory.insert!(:event_or_commitment).id, satisfies_id: Factory.insert!(:intent).id, resource_quantity: %{ diff --git a/test/vf/scenario/domain.test.exs b/test/vf/scenario/domain.test.exs @@ -28,8 +28,8 @@ alias Zenflows.VF.{ setup do %{ params: %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), has_beginning: DateTime.utc_now(), has_end: DateTime.utc_now(), defined_as_id: Factory.insert!(:scenario_definition).id, diff --git a/test/vf/scenario_definition/domain.test.exs b/test/vf/scenario_definition/domain.test.exs @@ -28,8 +28,8 @@ alias Zenflows.VF.{ setup do %{ params: %{ - name: Factory.uniq("name"), - note: Factory.uniq("note"), + name: Factory.str("name"), + note: Factory.str("note"), has_duration: Factory.build(:iduration), }, inserted: Factory.insert!(:scenario_definition), diff --git a/test/vf/settlement.test.exs b/test/vf/settlement.test.exs @@ -22,7 +22,7 @@ alias Zenflows.VF.Settlement setup do %{params: %{ - note: Factory.uniq("note"), + note: Factory.str("note"), settled_by_id: Factory.insert!(:economic_event).id, settles_id: Factory.insert!(:claim).id, resource_quantity: %{ diff --git a/test/vf/unit/type.test.exs b/test/vf/unit/type.test.exs @@ -21,8 +21,8 @@ use ZenflowsTest.Help.AbsinCase, async: true setup do %{ params: %{ - "label" => Factory.uniq("label"), - "symbol" => Factory.uniq("symbol"), + "label" => Factory.str("label"), + "symbol" => Factory.str("symbol"), }, inserted: Factory.insert!(:unit), }