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

Function validate_entities_detect_cycle_fails

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

Source from the content-addressed store, hash-verified

880
881 #[test]
882 fn validate_entities_detect_cycle_fails() {
883 let json_data = json!(
884 {
885 "entities": [
886 {
887 "uid": {
888 "type": "PhotoApp::UserGroup",
889 "id": "ABCTeam"
890 },
891 "attrs": {},
892 "parents": [
893 {
894 "type": "PhotoApp::UserGroup",
895 "id": "AVTeam"
896 }
897 ]
898 },
899 {
900 "uid": {
901 "type": "PhotoApp::UserGroup",
902 "id": "AVTeam"
903 },
904 "attrs": {},
905 "parents": [
906 {
907 "type": "PhotoApp::UserGroup",
908 "id": "ABCTeam"
909 }
910 ]
911 }
912 ],
913 "schema": {
914 "PhotoApp": {
915 "commonTypes": {},
916 "entityTypes": {
917 "UserGroup": {
918 "shape": {
919 "type": "Record",
920 "attributes": {}
921 },
922 "memberOfTypes": [
923 "UserGroup"
924 ]
925 }
926 },
927 "actions": {}
928 }
929 }
930 });
931 let result = call_cedar("ValidateEntities", json_data.to_string().as_str());
932 assert_failure(&result);
933
934 assert!(
935 result.contains("input graph has a cycle containing vertex `PhotoApp::UserGroup"),
936 "result was `{result}`",
937 );
938 }
939

Callers

nothing calls this directly

Calls 2

call_cedarFunction · 0.85
assert_failureFunction · 0.85

Tested by

no test coverage detected