Language: Deutsch · English
The scripting API of business tests – BusinessTestScript methods and generated entity classes.
REFERENZ DEVELOPER UPDATED: JUL 2026 APPLIES TO NUCLOS 4.2026.X
On this page
Every business-test script automatically extends org.nuclos.server.businesstest.execution.BusinessTestScript and provides the following methods, among others.
| Method | Purpose |
|---|---|
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. |
For every BO an entity class is generated to access the attributes; it provides helper methods (getters/setters, save() …).
withUser('test') {
Order order = new Order(orderNumber: 123).save()
assert order.createdBy == 'test'
}