Skip to content

Commit 5c4c9cd

Browse files
committed
chore: add test
1 parent bc5c961 commit 5c4c9cd

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/PolicySchemaTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void verifySchema() {
2929
assertThat(schema.validate(POLICY_STRING_PROFILE, JSON)).isEmpty();
3030
assertThat(schema.validate(POLICY_ARRAY_PROFILE, JSON)).isEmpty();
3131
assertThat(schema.validate(POLICY_PERMISSION_DUTY, JSON)).isEmpty();
32+
assertThat(schema.validate(POLICY_PROHIBITION_DUTY, JSON)).isEmpty();
3233
assertThat(schema.validate(POLICY_OR_CONSTRAINT, JSON)).isEmpty();
3334
assertThat(schema.validate(POLICY_AND_CONSTRAINT, JSON)).isEmpty();
3435
assertThat(schema.validate(POLICY_AND_SEQUENCE_CONSTRAINT, JSON)).isEmpty();
@@ -129,6 +130,32 @@ void setUp() {
129130
]
130131
}""";
131132

133+
private static final String POLICY_PROHIBITION_DUTY = """
134+
{
135+
"@id": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
136+
"@type": "Offer",
137+
"target": "asset:1",
138+
"profile": ["https://test.com/profile"],
139+
"prohibition": [
140+
{
141+
"action": "use",
142+
"constraint": [{
143+
"leftOperand": "partner",
144+
"operator": "eq",
145+
"rightOperand": "gold"
146+
}],
147+
"duty": [{
148+
"action": "report",
149+
"constraint": [{
150+
"leftOperand": "event",
151+
"operator": "gt",
152+
"rightOperand": "use"
153+
}]
154+
}]
155+
}
156+
]
157+
}""";
158+
132159

133160
private static final String POLICY_OR_CONSTRAINT = """
134161
{

0 commit comments

Comments
 (0)