mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Fix bindings and add CI tests (#247)
Also update version numbers of binding Rust projects to match Regorus Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
495e91c75a
commit
9894f00829
20
bindings/java/Test.java
Normal file
20
bindings/java/Test.java
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
import com.microsoft.regorus.Engine;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
try (Engine engine = new Engine()) {
|
||||
engine.addPolicy(
|
||||
"hello.rego",
|
||||
"package test\nmessage = concat(\", \", [input.message, data.message])"
|
||||
);
|
||||
engine.addDataJson("{\"message\":\"World!\"}");
|
||||
engine.setInputJson("{\"message\":\"Hello\"}");
|
||||
String resJson = engine.evalQuery("data.test.message");
|
||||
|
||||
System.out.println(resJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user