From f63fa587d1a0f632004d4fe636d26de18caf60ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristjan=20=C5=A0oln?= Date: Tue, 3 Dec 2024 13:40:01 +0100 Subject: [PATCH] Change camelCase parameters in archivePV request to lowercase Archiver seems to expect lowercase parameters in the archivePV request. As the AA processor used camelCase, Archiver ignored the specified archiving configuration. --- .../phoebus/channelfinder/processors/aa/ArchivePVOptions.java | 3 +++ .../channelfinder/processors/AAChannelProcessorTest.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/phoebus/channelfinder/processors/aa/ArchivePVOptions.java b/src/main/java/org/phoebus/channelfinder/processors/aa/ArchivePVOptions.java index 4e8cb68..8b99906 100644 --- a/src/main/java/org/phoebus/channelfinder/processors/aa/ArchivePVOptions.java +++ b/src/main/java/org/phoebus/channelfinder/processors/aa/ArchivePVOptions.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.logging.Level; @@ -12,7 +13,9 @@ public class ArchivePVOptions { private static final Logger logger = Logger.getLogger(ArchivePVOptions.class.getName()); private String pv; + @JsonProperty("samplingmethod") private String samplingMethod; + @JsonProperty("samplingperiod") private String samplingPeriod; private String policy; @JsonIgnore diff --git a/src/test/java/org/phoebus/channelfinder/processors/AAChannelProcessorTest.java b/src/test/java/org/phoebus/channelfinder/processors/AAChannelProcessorTest.java index 2d1a9bb..5403c47 100644 --- a/src/test/java/org/phoebus/channelfinder/processors/AAChannelProcessorTest.java +++ b/src/test/java/org/phoebus/channelfinder/processors/AAChannelProcessorTest.java @@ -114,7 +114,7 @@ void archivePVJson() throws JsonProcessingException { ObjectMapper objectMapper = new ObjectMapper(); String str = objectMapper.writeValueAsString(List.of(ar1, ar2)); - String expectedString = "[{\"pv\":\"sim://testing1\",\"samplingMethod\":\"MONITOR\",\"samplingPeriod\":\"1.0\"},{\"pv\":\"sim://testing2\",\"samplingMethod\":\"SCAN\",\"samplingPeriod\":\"0.2\"}]"; + String expectedString = "[{\"pv\":\"sim://testing1\",\"samplingmethod\":\"MONITOR\",\"samplingperiod\":\"1.0\"},{\"pv\":\"sim://testing2\",\"samplingmethod\":\"SCAN\",\"samplingperiod\":\"0.2\"}]"; Assertions.assertEquals(str, expectedString); // Only a pv name