diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java
index bc69537..9654572 100644
--- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java
+++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,7 +34,7 @@
  */
 public final class AvroSchemaKeyTranslationUtilities {
     // Constants for key replacements
-    private static final String DOT_STRING = "\\.";
+    private static final String DOT_STRING = ".";
     private static final String DOT_STRING_REPLACEMENT = "_DoT_";
     private static final String DASH_STRING = "-";
     private static final String DASH_STRING_REPLACEMENT = "_DasH_";
@@ -133,9 +134,9 @@
      */
     private static String translateIllegalKey(final String key, final boolean revert) {
         if (revert) {
-            return key.replaceAll(DOT_STRING_REPLACEMENT, DOT_STRING).replaceAll(DASH_STRING_REPLACEMENT, DASH_STRING);
+            return key.replace(DOT_STRING_REPLACEMENT, DOT_STRING).replace(DASH_STRING_REPLACEMENT, DASH_STRING);
         } else {
-            return key.replaceAll(DOT_STRING, DOT_STRING_REPLACEMENT).replaceAll(DASH_STRING, DASH_STRING_REPLACEMENT);
+            return key.replace(DOT_STRING, DOT_STRING_REPLACEMENT).replace(DASH_STRING, DASH_STRING_REPLACEMENT);
         }
     }
 }
diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java
index 7aec4ae..20c7446 100644
--- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java
+++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -220,8 +221,8 @@
         obTask.duplicateOutputFields(event0001.getParameterMap());
         final AxTaskLogic obAxLogic = new AxTaskLogic(obTask.getKey(), TASK_LOGIC,
                         (justOneLang == null ? JAVASCRIPT : justOneLang), logicReader);
-        obAxLogic.setLogic(obAxLogic.getLogic().replaceAll(STATE_NAME, OBSERVE)
-                        .replaceAll(TASK_NAME, obTask.getKey().getName()).replaceAll(STATE_NUMBER, "1"));
+        obAxLogic.setLogic(obAxLogic.getLogic().replace(STATE_NAME, OBSERVE)
+                        .replace(TASK_NAME, obTask.getKey().getName()).replace(STATE_NUMBER, "1"));
         obTask.setTaskLogic(obAxLogic);
 
         final AxTask orTask = new AxTask(new AxArtifactKey("Task_Orient_0", DEFAULT_VERSION));
@@ -229,8 +230,8 @@
         orTask.duplicateOutputFields(event0002.getParameterMap());
         final AxTaskLogic orAxLogic = new AxTaskLogic(orTask.getKey(), TASK_LOGIC,
                         (justOneLang == null ? JAVASCRIPT : justOneLang), logicReader);
-        orAxLogic.setLogic(orAxLogic.getLogic().replaceAll(STATE_NAME, ORIENT)
-                        .replaceAll(TASK_NAME, orTask.getKey().getName()).replaceAll(STATE_NUMBER, "2"));
+        orAxLogic.setLogic(orAxLogic.getLogic().replace(STATE_NAME, ORIENT)
+                        .replace(TASK_NAME, orTask.getKey().getName()).replace(STATE_NUMBER, "2"));
         orTask.setTaskLogic(orAxLogic);
 
         final AxTask dTask = new AxTask(new AxArtifactKey("Task_Decide_0", DEFAULT_VERSION));
@@ -238,8 +239,8 @@
         dTask.duplicateOutputFields(event0003.getParameterMap());
         final AxTaskLogic dAxLogic = new AxTaskLogic(dTask.getKey(), TASK_LOGIC,
                         (justOneLang == null ? MVEL : justOneLang), logicReader);
-        dAxLogic.setLogic(dAxLogic.getLogic().replaceAll(STATE_NAME, ORIENT)
-                        .replaceAll(TASK_NAME, dTask.getKey().getName()).replaceAll(STATE_NUMBER, "3"));
+        dAxLogic.setLogic(dAxLogic.getLogic().replace(STATE_NAME, ORIENT)
+                        .replace(TASK_NAME, dTask.getKey().getName()).replace(STATE_NUMBER, "3"));
         dTask.setTaskLogic(dAxLogic);
 
         final AxTask aTask = new AxTask(new AxArtifactKey("Task_Act_0", DEFAULT_VERSION));
@@ -247,8 +248,8 @@
         aTask.duplicateOutputFields(event0004.getParameterMap());
         final AxTaskLogic aAxLogic = new AxTaskLogic(aTask.getKey(), TASK_LOGIC,
                         (justOneLang == null ? "JAVA" : justOneLang), logicReader);
-        aAxLogic.setLogic(aAxLogic.getLogic().replaceAll(STATE_NAME, "Act")
-                        .replaceAll(TASK_NAME, aTask.getKey().getName()).replaceAll(STATE_NUMBER, "4"));
+        aAxLogic.setLogic(aAxLogic.getLogic().replace(STATE_NAME, "Act")
+                        .replace(TASK_NAME, aTask.getKey().getName()).replace(STATE_NUMBER, "4"));
         aTask.setTaskLogic(aAxLogic);
 
         tasks.getTaskMap().put(obTask.getKey(), obTask);
@@ -262,7 +263,7 @@
         final Set<AxArtifactKey> actTasks = new TreeSet<>();
 
         addOodaTasks(tasks, obTasks, orTasks, decTasks, actTasks);
-        
+
         final List<Set<AxArtifactKey>> taskReferenceList = new ArrayList<>();
         taskReferenceList.add(obTasks);
         taskReferenceList.add(orTasks);
@@ -318,7 +319,7 @@
 
     /**
      * Add OODA tasks to the policy.
-     * 
+     *
      * @param tasks the policy tasks
      * @param obTasks observe tasks
      * @param orTasks orient tasks
@@ -345,7 +346,7 @@
 
     /**
      * Initialize the logic executor list.
-     * 
+     *
      * @param justOneLang the language to use
      * @return the list of languages
      */
@@ -463,8 +464,8 @@
         eTask.duplicateOutputFields(event0001.getParameterMap());
         final AxTaskLogic eAxLogic = new AxTaskLogic(eTask.getKey(), TASK_LOGIC,
                         (justOneLang == null ? JYTHON : justOneLang), logicReader);
-        eAxLogic.setLogic(eAxLogic.getLogic().replaceAll(STATE_NAME, EVENT)
-                        .replaceAll(TASK_NAME, eTask.getKey().getName()).replaceAll(STATE_NUMBER, "1"));
+        eAxLogic.setLogic(eAxLogic.getLogic().replace(STATE_NAME, EVENT)
+                        .replace(TASK_NAME, eTask.getKey().getName()).replace(STATE_NUMBER, "1"));
         eTask.setTaskLogic(eAxLogic);
 
         final AxTask cTask = new AxTask(new AxArtifactKey("Task_Condition_0", DEFAULT_VERSION));
@@ -472,8 +473,8 @@
         cTask.duplicateOutputFields(event0002.getParameterMap());
         final AxTaskLogic cAxLogic = new AxTaskLogic(cTask.getKey(), TASK_LOGIC,
                         (justOneLang == null ? JAVASCRIPT : justOneLang), logicReader);
-        cAxLogic.setLogic(cAxLogic.getLogic().replaceAll(STATE_NAME, CONDITION)
-                        .replaceAll(TASK_NAME, cTask.getKey().getName()).replaceAll(STATE_NUMBER, "2"));
+        cAxLogic.setLogic(cAxLogic.getLogic().replace(STATE_NAME, CONDITION)
+                        .replace(TASK_NAME, cTask.getKey().getName()).replace(STATE_NUMBER, "2"));
         cTask.setTaskLogic(cAxLogic);
 
         final AxTask aTask = new AxTask(new AxArtifactKey("Task_Action_0", DEFAULT_VERSION));
@@ -481,8 +482,8 @@
         aTask.duplicateOutputFields(event0003.getParameterMap());
         final AxTaskLogic aAxLogic = new AxTaskLogic(aTask.getKey(), TASK_LOGIC,
                         (justOneLang == null ? "JAVA" : justOneLang), logicReader);
-        aAxLogic.setLogic(aAxLogic.getLogic().replaceAll(STATE_NAME, ACTION)
-                        .replaceAll(TASK_NAME, aTask.getKey().getName()).replaceAll(STATE_NUMBER, "3"));
+        aAxLogic.setLogic(aAxLogic.getLogic().replace(STATE_NAME, ACTION)
+                        .replace(TASK_NAME, aTask.getKey().getName()).replace(STATE_NUMBER, "3"));
         aTask.setTaskLogic(aAxLogic);
 
         tasks.getTaskMap().put(eTask.getKey(), eTask);
@@ -545,7 +546,7 @@
 
     /**
      * Add ECA tasks.
-     * 
+     *
      * @param tasks the tasks
      * @param eventTasks event tasks
      * @param conditionTasks condition tasks
diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java
index 1b560db..18ef33a 100644
--- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java
+++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -766,9 +767,9 @@
         AxTaskLogic axLogic = new AxTaskLogic(new AxReferenceKey(task.getKey(), "_TaskLogic"), logicFlavour,
                         logicReader);
 
-        axLogic.setLogic(axLogic.getLogic().replaceAll("<STATE_NAME>", stateName)
-                        .replaceAll("<TASK_NAME>", task.getKey().getName())
-                        .replaceAll("<RANDOM_BYTE_VALUE>", caseToUse));
+        axLogic.setLogic(axLogic.getLogic().replace("<STATE_NAME>", stateName)
+                        .replace("<TASK_NAME>", task.getKey().getName())
+                        .replace("<RANDOM_BYTE_VALUE>", caseToUse));
 
         return axLogic;
     }
