From 0220d8f1a2731a953f852599a66830e725045cd2 Mon Sep 17 00:00:00 2001 From: Sanoj Punchihewa Date: Fri, 20 Dec 2024 07:01:45 +0530 Subject: [PATCH] Update PublishingEventTest with variables --- .../flow/statistics/publishing/PublishingEventTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core/src/test/java/org/apache/synapse/aspects/flow/statistics/publishing/PublishingEventTest.java b/modules/core/src/test/java/org/apache/synapse/aspects/flow/statistics/publishing/PublishingEventTest.java index d61796575f..08800bd1b3 100644 --- a/modules/core/src/test/java/org/apache/synapse/aspects/flow/statistics/publishing/PublishingEventTest.java +++ b/modules/core/src/test/java/org/apache/synapse/aspects/flow/statistics/publishing/PublishingEventTest.java @@ -52,6 +52,7 @@ public class PublishingEventTest { private static final Integer FAULT_COUNT = 1; private static final Integer HASHCODE = 12345; private static final Map PROPERTY_MAP = new HashMap<>(); + private static final Map VARIABLE_MAP = new HashMap<>(); /** * Initializing PublishingEvent before tests. @@ -62,6 +63,8 @@ public static void init() { statisticDataUnit.setTime(START_TIME); PROPERTY_MAP.put("1", new Integer(1)); statisticDataUnit.setContextPropertyMap(PROPERTY_MAP); + VARIABLE_MAP.put("var1", new String("John")); + statisticDataUnit.setContextVariableMap(VARIABLE_MAP); StatisticsLog statisticsLog = new StatisticsLog(statisticDataUnit); statisticsLog.setComponentType(ComponentType.ENDPOINT); statisticsLog.setComponentName(COMPONENT_NAME); @@ -106,6 +109,7 @@ public void testGetObjectList() { Assert.assertEquals("comparing stored values", objectList.get(index++), AFTER_PAYLOAD); Assert.assertEquals("null since not initialized", objectList.get(index++), PROPERTY_MAP.toString()); Assert.assertNull("null since not initialized", objectList.get(index++)); + Assert.assertEquals("comparing stored variables", VARIABLE_MAP.toString(), objectList.get(index++)); Assert.assertEquals("comparing stored values", objectList.get(index++), Arrays.toString(CHILDREN)); Assert.assertEquals("comparing stored values", objectList.get(index++), ENTRY_POINT); Assert.assertEquals("comparing stored values", objectList.get(index++),