Creators in the Acceptance test library

Important

Functionality noted in this topic is available to targeted users as part of a preview release. The content and the functionality are subject to change. For more information about preview releases, see Service update availability.

Creator classes provide fluent application programming interfaces (APIs) that are used to create test data.

Naming convention

AtlCreator<ModuleName><EntityName>

In this naming convention:

  • <ModuleName> is optional and is based on the names of the modules on the main menu. You should use a short version or an abbreviation to support brevity of test code.
  • <EntityName> is optional and is used when the command applies to different types of entities.

Examples

AtlCreatorCostGroup

AtlCreatorCustomer

Fluent setter methods

Creator classes should provide fluent setter methods that are used to set the properties of the entity that is being constructed.

Naming convention

set<EntityPropertyName>

In this naming convention, <EntityPropertyName> is the name of the property that is being set for the entity by using the fluent method.

Example

item = new AtlCreatorProductItem()
    .setItemId('DemoItem')
    .setItemGroup(invent.itemGroups().carAudio())
    .setItemModelGroup(invent.modelGroups().fifo())
    .setStorageDimGroup(invent.storageDimGroups().siteWarehousePhysical())
    .setTrackingDimGroup(invent.trackingDimGroups().serialControlled())
    .setDefaultWarehouse(invent.warehouses().default())
    .create();

When should creators be used instead of entities?

For information that will help you choose between entities and creators, see Should I implement an entity or a creator class.