Configure a Transact Function Unit Test

   Journey Manager (JM) The transaction engine for the platform.  |    Form Builder Platform Developer |  17.10 This feature was introduced in 17.10.

It is a good development practice to create a unit testis a software development life cycle (SDLC) component in which a comprehensive testing procedure is individually applied to the smallest parts of a software program for fitness or desired operation. Unit Testing is a software testing method by which individual units of source code are tested to determine whether they are fit for use. For more information, see http://docs.groovy-lang.org/next/html/documentation/core-testing-guide.html. for any Transact function Groovy script, so it can be thoroughly tested prior to using it. Manager provides Groovy unit testing capability to all Groovy services. When a Transact function is created, it comes with a default Groovy script, which is merely a template to help developers implement a new test logic. You need to change it for each Transact function that you have to test. Typically, a unit test does a lot of this:

FormFuncResult result = (FormFuncResult) new ServiceInvoker(svcDef)
	.setLogger(logger)
	.invoke("funcParam", funcParam)

To configure the unit test:

  1. Select Services > Transact Functions.
  2. Locate a Transact function and click Edit.
  3. Click the Unit Test tab.
    Manager configure a Unit test of a Transact function or a service
  4. Edit a Groovy unit test script as required.
  5. Click on two help links below to get more help on how to write Groovy scripts and which Transact Fluent API to use:
  6. Select the Enable Unit Testing checkbox to enable unit testing for this script.
  7. Click Run Test to execute the Groovy test script. Test results, success or failure, is displayed in the Test Result field.

Next, learn about Transact function help documentation.