From 7438fe5a86a9fcfaf248ee32197b24d1badaecb3 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 4 Aug 2021 10:41:51 -0400 Subject: Use lombok in apex-pdp #2 Updated context to use lombok. Issue-ID: POLICY-3391 Change-Id: I349e0202fffad161cac08cebaea4a9571db58bda Signed-off-by: Jim Hahn --- .../handling/PolicyModelComparerTest.java | 32 +++++++++++----------- ...PolicyModelComparisonDifferentVerboseValues.txt | 12 ++++---- ...PolicyModelComparisonIdenticalVerboseValues.txt | 12 ++++---- 3 files changed, 28 insertions(+), 28 deletions(-) (limited to 'model/policy-model') diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparerTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparerTest.java index f148f7d2a..0a1e80a20 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparerTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparerTest.java @@ -44,26 +44,26 @@ public class PolicyModelComparerTest { String resultString = policyModelComparer.asString(false, false); String checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonIdenticalVerboseValues.txt"); - assertEquals(resultString.trim().replaceAll("[\\r?\\n]+", " "), - checkString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(resultString.trim().replaceAll("\\s+", ""), + checkString.trim().replaceAll("\\s+", "")); resultString = policyModelComparer.asString(false, true); checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonIdenticalVerboseKeys.txt"); - assertEquals(checkString.trim().replaceAll("[\\r?\\n]+", " "), - resultString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(checkString.trim().replaceAll("\\s+", ""), + resultString.trim().replaceAll("\\s+", "")); resultString = policyModelComparer.asString(true, false); checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonIdenticalTerse.txt"); - assertEquals(checkString.trim().replaceAll("[\\r?\\n]+", " "), - resultString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(checkString.trim().replaceAll("\\s+", ""), + resultString.trim().replaceAll("\\s+", "")); resultString = policyModelComparer.asString(true, true); checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonIdenticalTerse.txt"); - assertEquals(checkString.trim().replaceAll("[\\r?\\n]+", " "), - resultString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(checkString.trim().replaceAll("\\s+", ""), + resultString.trim().replaceAll("\\s+", "")); final AxKeyInfo leftOnlyKeyInfo = new AxKeyInfo(new AxArtifactKey("LeftOnlyKeyInfo", "0.0.1"), UUID.fromString("ce9168c-e6df-414f-9646-6da464b6f000"), "Left only key info"); @@ -83,26 +83,26 @@ public class PolicyModelComparerTest { resultString = policyModelComparer.asString(false, false); checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonDifferentVerboseValues.txt"); - assertEquals(resultString.trim().replaceAll("[\\r?\\n]+", " "), - checkString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(resultString.trim().replaceAll("\\s+", ""), + checkString.trim().replaceAll("\\s+", "")); resultString = policyModelComparer.asString(false, true); checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonDifferentVerboseKeys.txt"); - assertEquals(checkString.trim().replaceAll("[\\r?\\n]+", " "), - resultString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(checkString.trim().replaceAll("\\s+", ""), + resultString.trim().replaceAll("\\s+", "")); resultString = policyModelComparer.asString(true, false); checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonDifferentTerseValues.txt"); - assertEquals(checkString.trim().replaceAll("[\\r?\\n]+", " "), - resultString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(checkString.trim().replaceAll("\\s+", ""), + resultString.trim().replaceAll("\\s+", "")); resultString = policyModelComparer.asString(true, true); checkString = TextFileUtils .getTextFileAsString("src/test/resources/checkFiles/PolicyModelComparisonDifferentTerseKeys.txt"); - assertEquals(checkString.trim().replaceAll("[\\r?\\n]+", " "), - resultString.trim().replaceAll("[\\r?\\n]+", " ")); + assertEquals(checkString.trim().replaceAll("\\s+", ""), + resultString.trim().replaceAll("\\s+", "")); assertNotNull(policyModelComparer.getContextAlbumComparisonResult()); assertNotNull(policyModelComparer.getContextAlbumKeyDifference()); diff --git a/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonDifferentVerboseValues.txt b/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonDifferentVerboseValues.txt index 7dd0b3955..2138e97f0 100644 --- a/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonDifferentVerboseValues.txt +++ b/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonDifferentVerboseValues.txt @@ -6,10 +6,10 @@ left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtif *** all right keys in left *** all values in left and right are identical *** list of identical entries in left and right -key=AxArtifactKey:(name=MapType,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=MapType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem00A) -key=AxArtifactKey:(name=StringType,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=StringType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem000) -key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.String) -key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.Long) +key=AxArtifactKey:(name=MapType,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=MapType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem00A) +key=AxArtifactKey:(name=StringType,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=StringType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem000) +key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.String) +key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.Long) *** event differences *** left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtifactKey:(name=PolicyModel,version=0.0.1) *** all left keys in right @@ -25,8 +25,8 @@ left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtif *** all right keys in left *** all values in left and right are identical *** list of identical entries in left and right -key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),value=AxContextAlbum:(key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),scope=APPLICATION,isWritable=true,itemSchema=AxArtifactKey:(name=MapType,version=0.0.1)) -key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),value=AxContextAlbum:(key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),scope=GLOBAL,isWritable=false,itemSchema=AxArtifactKey:(name=StringType,version=0.0.1)) +key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),value=AxContextAlbum(key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),scope=APPLICATION,isWritable=true,itemSchema=AxArtifactKey:(name=MapType,version=0.0.1)) +key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),value=AxContextAlbum(key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),scope=GLOBAL,isWritable=false,itemSchema=AxArtifactKey:(name=StringType,version=0.0.1)) *** task differences *** left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtifactKey:(name=PolicyModel,version=0.0.1) *** all left keys in right diff --git a/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonIdenticalVerboseValues.txt b/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonIdenticalVerboseValues.txt index 149bec002..0faab1cdb 100644 --- a/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonIdenticalVerboseValues.txt +++ b/model/policy-model/src/test/resources/checkFiles/PolicyModelComparisonIdenticalVerboseValues.txt @@ -6,10 +6,10 @@ left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtif *** all right keys in left *** all values in left and right are identical *** list of identical entries in left and right -key=AxArtifactKey:(name=MapType,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=MapType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem00A) -key=AxArtifactKey:(name=StringType,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=StringType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem000) -key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.String) -key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),value=AxContextSchema:(key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.Long) +key=AxArtifactKey:(name=MapType,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=MapType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem00A) +key=AxArtifactKey:(name=StringType,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=StringType,version=0.0.1),schemaFlavour=Java,schemaDefinition=org.onap.policy.apex.model.policymodel.concepts.TestContextItem000) +key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=eventContextItem0,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.String) +key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),value=AxContextSchema(key=AxArtifactKey:(name=eventContextItem1,version=0.0.1),schemaFlavour=Java,schemaDefinition=java.lang.Long) *** event differences *** left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtifactKey:(name=PolicyModel,version=0.0.1) *** all left keys in right @@ -25,8 +25,8 @@ left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtif *** all right keys in left *** all values in left and right are identical *** list of identical entries in left and right -key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),value=AxContextAlbum:(key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),scope=APPLICATION,isWritable=true,itemSchema=AxArtifactKey:(name=MapType,version=0.0.1)) -key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),value=AxContextAlbum:(key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),scope=GLOBAL,isWritable=false,itemSchema=AxArtifactKey:(name=StringType,version=0.0.1)) +key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),value=AxContextAlbum(key=AxArtifactKey:(name=contextAlbum0,version=0.0.1),scope=APPLICATION,isWritable=true,itemSchema=AxArtifactKey:(name=MapType,version=0.0.1)) +key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),value=AxContextAlbum(key=AxArtifactKey:(name=contextAlbum1,version=0.0.1),scope=GLOBAL,isWritable=false,itemSchema=AxArtifactKey:(name=StringType,version=0.0.1)) *** task differences *** left key AxArtifactKey:(name=PolicyModel,version=0.0.1) equals right key AxArtifactKey:(name=PolicyModel,version=0.0.1) *** all left keys in right -- cgit 1.2.3-korg