Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

Nuclos business test API: BusinessTestScript, attempt, fail, withUser, entity class, save, Groovy, assert.

globe with meridians Language: Deutsch · English

open book API

The scripting API of business tests – BusinessTestScript methods and generated entity classes.

Status
colourGrey
titleReferenz
Status
colourBlue
titleDeveloper
Status
colourGreen
titleUpdated: Jul 2026
Status
colourGrey
titleapplies to Nuclos 4.2026.x

Panel
bgColor#F4F5F7

On this page

Inhalt
maxLevel2
minLevel2

Every business-test script automatically extends org.nuclos.server.businesstest.execution.BusinessTestScript and provides the following methods, among others.

Methods

MethodPurpose
void attempt(Callable c)runs the callable and catches exceptions; increments the error/warning counter if needed without aborting the script.
void fail(String message)makes the test fail (only in exceptional cases – assertions are usually better).
<T> T withUser(String user, Callable<T> c)runs the callable as the given user (with their permissions) and returns its result.

Entity classes

For every BO an entity class is generated to access the attributes; it provides helper methods (getters/setters, save() …).

Codeblock
languagegroovy
withUser('test') {
    Order order = new Order(orderNumber: 123).save()
    assert order.createdBy == 'test'
}

Related pages

gear Business tests


Overview.

Open →

gear Operation


Operation.

Open →