From c9aec98919d0036d56b90f2c7fa79625baf2e322 Mon Sep 17 00:00:00 2001 From: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:10:05 +0100 Subject: [PATCH] Disable pretty printing DSS overrides to save space (#655) Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --- .../src/main/java/dev/galasa/framework/FrameworkRuns.java | 4 +++- .../test/java/dev/galasa/framework/FrameworkRunsTest.java | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/galasa-parent/dev.galasa.framework/src/main/java/dev/galasa/framework/FrameworkRuns.java b/galasa-parent/dev.galasa.framework/src/main/java/dev/galasa/framework/FrameworkRuns.java index 0fbe4ce6..90fd01a7 100644 --- a/galasa-parent/dev.galasa.framework/src/main/java/dev/galasa/framework/FrameworkRuns.java +++ b/galasa-parent/dev.galasa.framework/src/main/java/dev/galasa/framework/FrameworkRuns.java @@ -37,6 +37,7 @@ import dev.galasa.framework.spi.IFrameworkRuns; import dev.galasa.framework.spi.IRun; import dev.galasa.framework.spi.utils.GalasaGson; +import dev.galasa.framework.spi.utils.GalasaGsonBuilder; public class FrameworkRuns implements IFrameworkRuns { @@ -55,12 +56,13 @@ public class FrameworkRuns implements IFrameworkRuns { private final String RUN_PREFIX = "run."; - private static final GalasaGson gson = new GalasaGson(); + private final GalasaGson gson = new GalasaGson(); public FrameworkRuns(IFramework framework) throws FrameworkException { this.framework = framework; this.dss = framework.getDynamicStatusStoreService("framework"); this.cps = framework.getConfigurationPropertyService("framework"); + gson.setGsonBuilder(new GalasaGsonBuilder(false)); } @Override diff --git a/galasa-parent/dev.galasa.framework/src/test/java/dev/galasa/framework/FrameworkRunsTest.java b/galasa-parent/dev.galasa.framework/src/test/java/dev/galasa/framework/FrameworkRunsTest.java index b29e4979..c7786726 100644 --- a/galasa-parent/dev.galasa.framework/src/test/java/dev/galasa/framework/FrameworkRunsTest.java +++ b/galasa-parent/dev.galasa.framework/src/test/java/dev/galasa/framework/FrameworkRunsTest.java @@ -11,6 +11,7 @@ import java.util.Properties; import java.util.Map.Entry; +import org.junit.BeforeClass; import org.junit.Test; import com.google.gson.JsonArray; @@ -23,11 +24,17 @@ import dev.galasa.framework.spi.IRun; import dev.galasa.framework.spi.IFrameworkRuns.SharedEnvironmentPhase; import dev.galasa.framework.spi.utils.GalasaGson; +import dev.galasa.framework.spi.utils.GalasaGsonBuilder; public class FrameworkRunsTest { private static final GalasaGson gson = new GalasaGson(); + @BeforeClass + public static void setUp() { + gson.setGsonBuilder(new GalasaGsonBuilder(false)); + } + private String getExpectedOverridesJson(Properties properties) { JsonArray overridesArray = new JsonArray();