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

Function validate_entities_invalid_schema_fails

CedarJavaFFI/src/tests.rs:802–835  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

800
801 #[test]
802 fn validate_entities_invalid_schema_fails() {
803 let json_data = json!(
804 {
805 "entities": [
806
807 ],
808 "schema": {
809 "PhotoApp": {
810 "commonTypes": {},
811 "entityTypes": {
812 "UserGroup": {
813 "shape44": {
814 "type": "Record",
815 "attributes": {}
816 },
817 "memberOfTypes": [
818 "UserGroup"
819 ]
820 }
821 },
822 "actions": {}
823 }
824 }
825 });
826 let result = call_cedar("ValidateEntities", json_data.to_string().as_str());
827 assert_failure(&result);
828
829 assert!(
830 result.contains(
831 "unknown field `shape44`, expected one of `memberOfTypes`, `shape`, `tags`"
832 ),
833 "result was `{result}`",
834 );
835 }
836
837 #[test]
838 fn validate_entities_invalid_cedarschema_fails() {

Callers

nothing calls this directly

Calls 2

call_cedarFunction · 0.85
assert_failureFunction · 0.85

Tested by

no test coverage detected