Question
Capgemini
SE
Last activity: 7 Jun 2024 9:54 EDT
Write Test Case for a Decision Table which checks a Value List
Hello!
I'm trying to write test cases for a Decision table that follows the structure below, but I'm having problems as the test case fails.
Decision Table
ValidAccess | Return |
@IsInPropertyList("Admin",.StringListOfAccess) | Administrator |
@IsInPropertyList("Dev",.StringListOfAccess) | Developer |
@IsInPropertyList("Work",.StringListOfAccess) | CaseWorker |
Test Case
I'm using assertion type: Decision Result. Properties seen below:
StringListOfAccess | Return |
Admin | Administrator |
Dev | Developer |
The Problem
1. The error section is either empty, 2. or the "Actual result" is returned column is empty, 3. or I get the error below:
The property .StringListOfAccess was of mode String List while com.pega.pegarules.data.internal.clipboard.ClipboardPropertyImpl.setValueOverride(Object) was expecting a String or Page mode.
Question
Hello!
I'm trying to write test cases for a Decision table that follows the structure below, but I'm having problems as the test case fails.
Decision Table
ValidAccess | Return |
@IsInPropertyList("Admin",.StringListOfAccess) | Administrator |
@IsInPropertyList("Dev",.StringListOfAccess) | Developer |
@IsInPropertyList("Work",.StringListOfAccess) | CaseWorker |
Test Case
I'm using assertion type: Decision Result. Properties seen below:
StringListOfAccess | Return |
Admin | Administrator |
Dev | Developer |
The Problem
1. The error section is either empty, 2. or the "Actual result" is returned column is empty, 3. or I get the error below:
The property .StringListOfAccess was of mode String List while com.pega.pegarules.data.internal.clipboard.ClipboardPropertyImpl.setValueOverride(Object) was expecting a String or Page mode.
Question
How can I handle this in a good way? should I use something else, rather than Decision Result? The decision table is circumstanced, and we apply a DT in setup to apply the correct environment.
Is there any syntax to hardcode a Value List in .StringListOfAccess cell of the test case, for example say I want to test somthing like:
- StringListOfAccess
- ["Tester","Admin", "Dev"]
- return
- "Administrator"