mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Also update version numbers of binding Rust projects to match Regorus Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
21 lines
635 B
Java
21 lines
635 B
Java
// 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);
|
|
}
|
|
}
|
|
}
|