()
| 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() { |
nothing calls this directly
no test coverage detected