From bc40b1b37c105f9f2addc92f6612a0efebd19eee Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Fri, 31 Jul 2020 14:14:41 -0700 Subject: [PATCH] Update Milestone entity and filters to comply with TestRail 5.3 1. Add Milestone date and status fields: - start_on - started_on - is_started - parent_id 2. Add "is_started" filter for Milestone command 3. Ignore Milestone unspecified fields for consistency with the rest of the entities. compile with java 9 --- pom.xml | 4 ++-- .../com/rmn/testrail/entity/Milestone.java | 24 ++++++++++++++++++- .../parameters/GetMilestonesFilter.java | 3 ++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a7e0b53..84aa5c5 100644 --- a/pom.xml +++ b/pom.xml @@ -157,8 +157,8 @@ maven-compiler-plugin 3.5.1 - 1.6 - 1.6 + 1.9 + 1.9 diff --git a/src/main/java/com/rmn/testrail/entity/Milestone.java b/src/main/java/com/rmn/testrail/entity/Milestone.java index 2b01717..91a4bcc 100644 --- a/src/main/java/com/rmn/testrail/entity/Milestone.java +++ b/src/main/java/com/rmn/testrail/entity/Milestone.java @@ -1,10 +1,12 @@ package com.rmn.testrail.entity; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; /** * @author jsteigel */ +@JsonIgnoreProperties(ignoreUnknown = true) public class Milestone extends BaseEntity { @JsonProperty("id") private Integer id; @@ -45,4 +47,24 @@ public class Milestone extends BaseEntity { private Integer projectId; public Integer getProjectId() { return projectId; } public void setProjectId(Integer projectId) { this.projectId = projectId; } -} \ No newline at end of file + + @JsonProperty("start_on") + private String startOn; + public String getStartOn() { return startOn; } + public void setStartOn(String startOn) { this.startOn = startOn; } + + @JsonProperty("started_on") + private String startedOn; + public String getStartedOn() { return startedOn; } + public void setStartedOn(String startedOn) { this.startedOn = startedOn; } + + @JsonProperty("is_started") + private String isStarted; + public String getIsStarted() { return isStarted; } + public void setIsStarted(String isStarted) { this.isStarted = isStarted; } + + @JsonProperty("parent_id") + private String parentId; + public String getParentId() { return parentId; } + public void setParentId(String parentId) { this.parentId = parentId; } +} diff --git a/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java b/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java index b60965e..4e48341 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java @@ -7,7 +7,8 @@ */ public enum GetMilestonesFilter implements ApiFilter { //Request filter for get_milestones - IS_COMPLETED("is_completed"); + IS_COMPLETED("is_completed"), + IS_STARTED("is_started"); private String filter; GetMilestonesFilter(String filter) { this.filter = filter; }