@@ -29,11 +29,10 @@ public void testParserSyntaxFailures() {
2929    public  void  testEntitlementDoesNotExist () throws  IOException  {
3030        PolicyParserException  ppe  = expectThrows (PolicyParserException .class , () -> new  PolicyParser (new  ByteArrayInputStream (""" 
3131            entitlement-module-name: 
32-               entitlements: 
33-                 - does_not_exist: {} 
32+               - does_not_exist: {} 
3433            """ .getBytes (StandardCharsets .UTF_8 )), "test-failure-policy.yaml" ).parsePolicy ());
3534        assertEquals (
36-             "[3:7 ] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name]: " 
35+             "[2:5 ] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name]: " 
3736                + "unknown entitlement type [does_not_exist]" ,
3837            ppe .getMessage ()
3938        );
@@ -42,23 +41,21 @@ public void testEntitlementDoesNotExist() throws IOException {
4241    public  void  testEntitlementMissingParameter () throws  IOException  {
4342        PolicyParserException  ppe  = expectThrows (PolicyParserException .class , () -> new  PolicyParser (new  ByteArrayInputStream (""" 
4443            entitlement-module-name: 
45-               entitlements: 
46-                 - file: {} 
44+               - file: {} 
4745            """ .getBytes (StandardCharsets .UTF_8 )), "test-failure-policy.yaml" ).parsePolicy ());
4846        assertEquals (
49-             "[3:14 ] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name] " 
47+             "[2:12 ] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name] " 
5048                + "for entitlement type [file]: missing entitlement parameter [path]" ,
5149            ppe .getMessage ()
5250        );
5351
5452        ppe  = expectThrows (PolicyParserException .class , () -> new  PolicyParser (new  ByteArrayInputStream (""" 
5553            entitlement-module-name: 
56-               entitlements: 
57-                 - file: 
58-                     path: test-path 
54+               - file: 
55+                   path: test-path 
5956            """ .getBytes (StandardCharsets .UTF_8 )), "test-failure-policy.yaml" ).parsePolicy ());
6057        assertEquals (
61-             "[5 :1] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name] " 
58+             "[4 :1] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name] " 
6259                + "for entitlement type [file]: missing entitlement parameter [actions]" ,
6360            ppe .getMessage ()
6461        );
@@ -67,15 +64,14 @@ public void testEntitlementMissingParameter() throws IOException {
6764    public  void  testEntitlementExtraneousParameter () throws  IOException  {
6865        PolicyParserException  ppe  = expectThrows (PolicyParserException .class , () -> new  PolicyParser (new  ByteArrayInputStream (""" 
6966            entitlement-module-name: 
70-               entitlements: 
71-                 - file: 
72-                     path: test-path 
73-                     actions: 
74-                       - read 
75-                     extra: test 
67+               - file: 
68+                   path: test-path 
69+                   actions: 
70+                     - read 
71+                   extra: test 
7672            """ .getBytes (StandardCharsets .UTF_8 )), "test-failure-policy.yaml" ).parsePolicy ());
7773        assertEquals (
78-             "[8 :1] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name] " 
74+             "[7 :1] policy parsing error for [test-failure-policy.yaml] in scope [entitlement-module-name] " 
7975                + "for entitlement type [file]: extraneous entitlement parameter(s) {extra=test}" ,
8076            ppe .getMessage ()
8177        );
0 commit comments