MCPcopy Create free account
hub / github.com/cedar-policy/cedar-java / assert_validates_without_errors

Function assert_validates_without_errors

CedarJavaFFI/src/helpers.rs:194–201  ·  view source on GitHub ↗
(json: serde_json::Value)

Source from the content-addressed store, hash-verified

192
193 #[track_caller]
194 fn assert_validates_without_errors(json: serde_json::Value) {
195 let ans = validate_with_level(serde_json::from_value(json).unwrap());
196 let ans_val = serde_json::to_value(ans).unwrap();
197 let result: Result<ValidationAnswer, _> = serde_json::from_value(ans_val);
198 assert_matches!(result, Ok(ValidationAnswer::Success { validation_errors, validation_warnings: _, other_warnings: _ }) => {
199 assert_eq!(validation_errors.len(), 0, "Unexpected validation errors: {validation_errors:?}");
200 });
201 }
202
203 #[track_caller]
204 fn assert_validates_with_errors(json: serde_json::Value) -> Vec<ValidationError> {

Calls 1

validate_with_levelFunction · 0.85