Skip to content

Commit

Permalink
Merge pull request #167 from kristjansoln/issue_116
Browse files Browse the repository at this point in the history
Change camelCase parameters in archivePV request to lowercase
  • Loading branch information
shroffk authored Jan 10, 2025
2 parents 8232cd4 + f63fa58 commit 9025f3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9025f3d

Please sign in to comment.