diff options
author | ITSERVICES\rb7147 <rb7147@att.com> | 2017-04-25 11:46:00 -0400 |
---|---|---|
committer | ITSERVICES\rb7147 <rb7147@att.com> | 2017-05-03 09:58:17 -0400 |
commit | e0addf5b588a1244f9679becd90999dfcb4c3a94 (patch) | |
tree | 1212772d6366730266ff0e093c874b07aa716c29 /ECOMP-XACML/src/test/java/org/openecomp/policy/xacml/test/json/RequestCategoryTest.java | |
parent | 39fb0f30472777e4b60d6a7ac8aa4eb9773961ff (diff) |
Policy 1707 commit to LF
Change-Id: Ibe6f01d92f9a434c040abb05d5386e89d675ae65
Signed-off-by: ITSERVICES\rb7147 <rb7147@att.com>
Diffstat (limited to 'ECOMP-XACML/src/test/java/org/openecomp/policy/xacml/test/json/RequestCategoryTest.java')
-rw-r--r-- | ECOMP-XACML/src/test/java/org/openecomp/policy/xacml/test/json/RequestCategoryTest.java | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/ECOMP-XACML/src/test/java/org/openecomp/policy/xacml/test/json/RequestCategoryTest.java b/ECOMP-XACML/src/test/java/org/openecomp/policy/xacml/test/json/RequestCategoryTest.java index e4ef4bef7..905c1a18a 100644 --- a/ECOMP-XACML/src/test/java/org/openecomp/policy/xacml/test/json/RequestCategoryTest.java +++ b/ECOMP-XACML/src/test/java/org/openecomp/policy/xacml/test/json/RequestCategoryTest.java @@ -852,9 +852,9 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " + - "\"Value\" : \"10.221.43.58:12345\" " + + "\"Value\" : \"121.221.43.58:12345\" " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -1053,9 +1053,9 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"ipAddress\", " + - "\"Value\" : \"10.221.43.58:12345\" " + + "\"Value\" : \"121.221.43.58:12345\" " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -1241,9 +1241,9 @@ public class RequestCategoryTest { try { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + - "\"Value\" : \"10.221.43.58:12345\" " + + "\"Value\" : \"121.221.43.58:12345\" " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -2594,9 +2594,9 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " + - "\"Value\" : [ \"10.221.43.58:12345\",\"10.221.43.58:12345\",\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -2604,9 +2604,9 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"ipAddress\", " + - "\"Value\" : [ \"10.221.43.58:12345\",\"10.221.43.58:12345\",\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=10.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -2614,7 +2614,7 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " + - "\"Value\" : [ \"10.221.43.58:12345\",\"not an ip address\",\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",\"not an ip address\",\"121.221.43.58:12345\" ] " + "}] } ] }}"); fail("Operation should throw exception"); } catch (JSONStructureException e) { @@ -2626,7 +2626,7 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " + - "\"Value\" : [ \"10.221.43.58:12345\",true,\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",true,\"121.221.43.58:12345\" ] " + "}] } ] }}"); fail("Operation should throw exception"); } catch (JSONStructureException e) { @@ -2638,7 +2638,7 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " + - "\"Value\" : [ \"10.221.43.58:12345\",1111,\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",1111,\"121.221.43.58:12345\" ] " + "}] } ] }}"); fail("Operation should throw exception"); } catch (JSONStructureException e) { @@ -2650,7 +2650,7 @@ public class RequestCategoryTest { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + "\"DataType\" : \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " + - "\"Value\" : [ \"10.221.43.58:12345\",11.22,\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",11.22,\"121.221.43.58:12345\" ] " + "}] } ] }}"); fail("Operation should throw exception"); } catch (JSONStructureException e) { @@ -3534,9 +3534,9 @@ public class RequestCategoryTest { try { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + - "\"Value\" : [ \"10.221.43.58:12345\",\"10.221.43.58:12345\",\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -3544,9 +3544,9 @@ public class RequestCategoryTest { try { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + - "\"Value\" : [ \"10.221.43.58:12345\",true,\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",true,\"121.221.43.58:12345\" ] " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -3554,9 +3554,9 @@ public class RequestCategoryTest { try { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + - "\"Value\" : [ \"10.221.43.58:12345\",1111,\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",1111,\"121.221.43.58:12345\" ] " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -3564,9 +3564,9 @@ public class RequestCategoryTest { try { request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" + "\"Id\" : \"document-id\", " + - "\"Value\" : [ \"10.221.43.58:12345\",11.22,\"10.221.43.58:12345\" ] " + + "\"Value\" : [ \"121.221.43.58:12345\",11.22,\"121.221.43.58:12345\" ] " + "}] } ] }}"); - assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=10.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); + assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString()); } catch (Exception e) { fail ("Failed convert from JSON to object: " + e); } @@ -4165,10 +4165,4 @@ public class RequestCategoryTest { } } - - - -//TODO - Shorthand for CategoryId ???? - - } |