From 4ec7b66bcc429e76fa5b8d550339da0e059ed420 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 1/9] Add following Milestone fields returned by TestRail (mGage finds use of these very helpful): start_on started_on is_started parent_id --- .../com/rmn/testrail/entity/Milestone.java | 22 ++++++++++++++++++- .../parameters/GetMilestonesFilter.java | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rmn/testrail/entity/Milestone.java b/src/main/java/com/rmn/testrail/entity/Milestone.java index 2b01717..5246f04 100644 --- a/src/main/java/com/rmn/testrail/entity/Milestone.java +++ b/src/main/java/com/rmn/testrail/entity/Milestone.java @@ -45,4 +45,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; } From a19c944f95ff8f2fe48c2c48869cc4e63f4ec03c Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Fri, 31 Jul 2020 14:19:39 -0700 Subject: [PATCH 2/9] Make sure that json object list behaves similarly with single json object ignoring unspecified fields --- src/main/java/com/rmn/testrail/util/JSONUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rmn/testrail/util/JSONUtils.java b/src/main/java/com/rmn/testrail/util/JSONUtils.java index defd841..ca9aaf4 100644 --- a/src/main/java/com/rmn/testrail/util/JSONUtils.java +++ b/src/main/java/com/rmn/testrail/util/JSONUtils.java @@ -60,7 +60,7 @@ public static T getMappedJsonObject( Class jsonObjectClass, String json, * @return An instance of the given Class, based on the attributes of the given JSON */ public static List getMappedJsonObjectList(Class jsonObjectClass, String json) { - return getMappedJsonObjectList(jsonObjectClass, json, true); + return getMappedJsonObjectList(jsonObjectClass, json, false); } /** From 92d458184b91c6ca2e1876882f2e7184f2dedf5b Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Wed, 27 Jan 2021 15:28:58 -0800 Subject: [PATCH 3/9] QA-877 :: Update dependencies and plugins to latest stable version. Compile to java 11 for new tag with dependencies. Upgrade Jackson to version 2.11.4 (latest for 2020) --- pom.xml | 128 ++++++++++-------- .../rmn/testrail/entity/EmptyMilestone.java | 2 +- .../com/rmn/testrail/entity/Milestone.java | 2 +- .../com/rmn/testrail/entity/PlanEntry.java | 2 +- .../com/rmn/testrail/entity/PlanEntryRun.java | 2 +- .../com/rmn/testrail/entity/Priority.java | 2 +- .../java/com/rmn/testrail/entity/Project.java | 2 +- .../rmn/testrail/entity/ProjectCreator.java | 2 +- .../java/com/rmn/testrail/entity/Section.java | 2 +- .../rmn/testrail/entity/SectionCreator.java | 2 +- .../java/com/rmn/testrail/entity/Step.java | 2 +- .../com/rmn/testrail/entity/StepResult.java | 2 +- .../com/rmn/testrail/entity/TestCase.java | 4 +- .../com/rmn/testrail/entity/TestInstance.java | 4 +- .../com/rmn/testrail/entity/TestPlan.java | 4 +- .../rmn/testrail/entity/TestPlanCreator.java | 2 +- .../com/rmn/testrail/entity/TestResult.java | 4 +- .../com/rmn/testrail/entity/TestResults.java | 2 +- .../java/com/rmn/testrail/entity/TestRun.java | 4 +- .../rmn/testrail/entity/TestRunCreator.java | 4 +- .../com/rmn/testrail/entity/TestRunGroup.java | 2 +- .../rmn/testrail/entity/TestRunUpdater.java | 4 +- .../com/rmn/testrail/entity/TestSuite.java | 2 +- .../rmn/testrail/entity/TestSuiteCreator.java | 2 +- .../rmn/testrail/entity/UpdatePlanEntry.java | 2 +- .../java/com/rmn/testrail/entity/User.java | 2 +- .../parameters/GetMilestonesFilter.java | 4 +- .../rmn/testrail/service/TestRailService.java | 95 +++++++++---- .../java/com/rmn/testrail/util/JSONUtils.java | 13 +- 29 files changed, 174 insertions(+), 130 deletions(-) diff --git a/pom.xml b/pom.xml index a7e0b53..18ea7cb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,14 +1,14 @@ - 4.0.0 + 4.0.0 - com.retailmenot - testrailsdk - 1.3.2 + com.mgage + testrailsdk + 1.3.4.1-SNAPSHOT jar ${project.groupId}:${project.artifactId} A package for managing your TestRail information - https://github.com/RetailMeNot/TestRailSDK + https://github.com/mGageTechOps/TestRailSDK UTF-8 @@ -38,46 +38,46 @@ - scm:git:git@github.com:RetailMeNot/TestRailSDK.git - scm:git:git@github.com:RetailMeNot/TestRailSDK.git - scm:git:git@github.com:RetailMeNot/TestRailSDK.git - testrailsdk-1.1 + scm:git:git@github.com:mGageTechOps/TestRailSDK.git + scm:git:git@github.com:mGageTechOps/TestRailSDK.git + scm:git:git@github.com:mGageTechOps/TestRailSDK.git + testrailsdk-1.3.4.1 - - - org.codehaus.jackson - jackson-mapper-asl - 1.9.9 - - - org.slf4j - slf4j-api - 1.6.6 - + - org.apache.commons - commons-lang3 - 3.1 - - - org.apache.httpcomponents - httpclient - [4.3.6,) - + com.fasterxml.jackson.core + jackson-databind + 2.11.4 + + + org.slf4j + slf4j-api + 1.6.6 + + + org.apache.commons + commons-lang3 + 3.11 + + + org.apache.httpcomponents + httpclient + [4.3.6,) + ch.qos.logback logback-classic - 1.0.9 + 1.2.3 test junit junit - 4.10 + 4.12 test - + @@ -98,7 +98,7 @@ org.apache.maven.plugins maven-source-plugin - 3.0.0 + 3.2.1 attach-sources @@ -111,7 +111,10 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.3 + 3.2.0 + + 11 + attach-javadocs @@ -122,18 +125,9 @@ - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - + org.simplify4u.plugins + sign-maven-plugin + 0.3.0 org.sonatype.plugins @@ -152,20 +146,34 @@ - - - maven-compiler-plugin - 3.5.1 - - 1.6 - 1.6 - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.19.1 + + + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 - + diff --git a/src/main/java/com/rmn/testrail/entity/EmptyMilestone.java b/src/main/java/com/rmn/testrail/entity/EmptyMilestone.java index f32f636..b6c31d3 100644 --- a/src/main/java/com/rmn/testrail/entity/EmptyMilestone.java +++ b/src/main/java/com/rmn/testrail/entity/EmptyMilestone.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; /** * @author jsteigel diff --git a/src/main/java/com/rmn/testrail/entity/Milestone.java b/src/main/java/com/rmn/testrail/entity/Milestone.java index 5246f04..f0bd4e3 100644 --- a/src/main/java/com/rmn/testrail/entity/Milestone.java +++ b/src/main/java/com/rmn/testrail/entity/Milestone.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; /** * @author jsteigel diff --git a/src/main/java/com/rmn/testrail/entity/PlanEntry.java b/src/main/java/com/rmn/testrail/entity/PlanEntry.java index b7b2ebc..04bff7e 100644 --- a/src/main/java/com/rmn/testrail/entity/PlanEntry.java +++ b/src/main/java/com/rmn/testrail/entity/PlanEntry.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/PlanEntryRun.java b/src/main/java/com/rmn/testrail/entity/PlanEntryRun.java index ea289fa..6ebd2c8 100644 --- a/src/main/java/com/rmn/testrail/entity/PlanEntryRun.java +++ b/src/main/java/com/rmn/testrail/entity/PlanEntryRun.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/Priority.java b/src/main/java/com/rmn/testrail/entity/Priority.java index c866e4d..b147640 100644 --- a/src/main/java/com/rmn/testrail/entity/Priority.java +++ b/src/main/java/com/rmn/testrail/entity/Priority.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; /** * @author vliao diff --git a/src/main/java/com/rmn/testrail/entity/Project.java b/src/main/java/com/rmn/testrail/entity/Project.java index 8f55e1e..abb5a0f 100644 --- a/src/main/java/com/rmn/testrail/entity/Project.java +++ b/src/main/java/com/rmn/testrail/entity/Project.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/ProjectCreator.java b/src/main/java/com/rmn/testrail/entity/ProjectCreator.java index e00e710..87fcc4b 100644 --- a/src/main/java/com/rmn/testrail/entity/ProjectCreator.java +++ b/src/main/java/com/rmn/testrail/entity/ProjectCreator.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/Section.java b/src/main/java/com/rmn/testrail/entity/Section.java index 72e9378..38741f2 100644 --- a/src/main/java/com/rmn/testrail/entity/Section.java +++ b/src/main/java/com/rmn/testrail/entity/Section.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/SectionCreator.java b/src/main/java/com/rmn/testrail/entity/SectionCreator.java index 6acb759..5406a04 100644 --- a/src/main/java/com/rmn/testrail/entity/SectionCreator.java +++ b/src/main/java/com/rmn/testrail/entity/SectionCreator.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; /** * @author ragePowered diff --git a/src/main/java/com/rmn/testrail/entity/Step.java b/src/main/java/com/rmn/testrail/entity/Step.java index 2448335..6e078d2 100644 --- a/src/main/java/com/rmn/testrail/entity/Step.java +++ b/src/main/java/com/rmn/testrail/entity/Step.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; public class Step extends BaseEntity { diff --git a/src/main/java/com/rmn/testrail/entity/StepResult.java b/src/main/java/com/rmn/testrail/entity/StepResult.java index 9b4c15a..503319a 100644 --- a/src/main/java/com/rmn/testrail/entity/StepResult.java +++ b/src/main/java/com/rmn/testrail/entity/StepResult.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; public class StepResult extends Step { diff --git a/src/main/java/com/rmn/testrail/entity/TestCase.java b/src/main/java/com/rmn/testrail/entity/TestCase.java index 015a3fe..95c8972 100644 --- a/src/main/java/com/rmn/testrail/entity/TestCase.java +++ b/src/main/java/com/rmn/testrail/entity/TestCase.java @@ -1,7 +1,7 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestInstance.java b/src/main/java/com/rmn/testrail/entity/TestInstance.java index 969e5e5..3c794d6 100644 --- a/src/main/java/com/rmn/testrail/entity/TestInstance.java +++ b/src/main/java/com/rmn/testrail/entity/TestInstance.java @@ -2,8 +2,8 @@ import com.rmn.testrail.parameters.ApiFilterValue; import com.rmn.testrail.parameters.GetResultsFilter; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestPlan.java b/src/main/java/com/rmn/testrail/entity/TestPlan.java index 153a4d3..9ef227d 100644 --- a/src/main/java/com/rmn/testrail/entity/TestPlan.java +++ b/src/main/java/com/rmn/testrail/entity/TestPlan.java @@ -1,7 +1,7 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestPlanCreator.java b/src/main/java/com/rmn/testrail/entity/TestPlanCreator.java index 1bcb78a..8db0a2a 100644 --- a/src/main/java/com/rmn/testrail/entity/TestPlanCreator.java +++ b/src/main/java/com/rmn/testrail/entity/TestPlanCreator.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestResult.java b/src/main/java/com/rmn/testrail/entity/TestResult.java index 448a2c3..af1c4ff 100644 --- a/src/main/java/com/rmn/testrail/entity/TestResult.java +++ b/src/main/java/com/rmn/testrail/entity/TestResult.java @@ -1,7 +1,7 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestResults.java b/src/main/java/com/rmn/testrail/entity/TestResults.java index 268492c..69ea60e 100644 --- a/src/main/java/com/rmn/testrail/entity/TestResults.java +++ b/src/main/java/com/rmn/testrail/entity/TestResults.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestRun.java b/src/main/java/com/rmn/testrail/entity/TestRun.java index 949bd91..8017e14 100644 --- a/src/main/java/com/rmn/testrail/entity/TestRun.java +++ b/src/main/java/com/rmn/testrail/entity/TestRun.java @@ -1,7 +1,7 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestRunCreator.java b/src/main/java/com/rmn/testrail/entity/TestRunCreator.java index d197ad1..ea5904b 100644 --- a/src/main/java/com/rmn/testrail/entity/TestRunCreator.java +++ b/src/main/java/com/rmn/testrail/entity/TestRunCreator.java @@ -1,7 +1,7 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; /** * This class has all the fields that you can provide when creating a TestRun diff --git a/src/main/java/com/rmn/testrail/entity/TestRunGroup.java b/src/main/java/com/rmn/testrail/entity/TestRunGroup.java index 058d1c4..51b4d4c 100644 --- a/src/main/java/com/rmn/testrail/entity/TestRunGroup.java +++ b/src/main/java/com/rmn/testrail/entity/TestRunGroup.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestRunUpdater.java b/src/main/java/com/rmn/testrail/entity/TestRunUpdater.java index a83a272..a19c1b3 100644 --- a/src/main/java/com/rmn/testrail/entity/TestRunUpdater.java +++ b/src/main/java/com/rmn/testrail/entity/TestRunUpdater.java @@ -1,7 +1,7 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; /** * This class has the available fields when updating a TestRun. diff --git a/src/main/java/com/rmn/testrail/entity/TestSuite.java b/src/main/java/com/rmn/testrail/entity/TestSuite.java index 6b19a35..10be270 100644 --- a/src/main/java/com/rmn/testrail/entity/TestSuite.java +++ b/src/main/java/com/rmn/testrail/entity/TestSuite.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/TestSuiteCreator.java b/src/main/java/com/rmn/testrail/entity/TestSuiteCreator.java index eb70d14..f47aae8 100644 --- a/src/main/java/com/rmn/testrail/entity/TestSuiteCreator.java +++ b/src/main/java/com/rmn/testrail/entity/TestSuiteCreator.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; /** * @author mmerrell diff --git a/src/main/java/com/rmn/testrail/entity/UpdatePlanEntry.java b/src/main/java/com/rmn/testrail/entity/UpdatePlanEntry.java index 6627fa4..ecce97a 100644 --- a/src/main/java/com/rmn/testrail/entity/UpdatePlanEntry.java +++ b/src/main/java/com/rmn/testrail/entity/UpdatePlanEntry.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/src/main/java/com/rmn/testrail/entity/User.java b/src/main/java/com/rmn/testrail/entity/User.java index 1d5869d..f2a7e18 100644 --- a/src/main/java/com/rmn/testrail/entity/User.java +++ b/src/main/java/com/rmn/testrail/entity/User.java @@ -1,6 +1,6 @@ package com.rmn.testrail.entity; -import org.codehaus.jackson.annotate.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty; /** * @author mmerrell diff --git a/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java b/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java index 4e48341..637e378 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java @@ -13,7 +13,5 @@ public enum GetMilestonesFilter implements ApiFilter { private String filter; GetMilestonesFilter(String filter) { this.filter = filter; } - public String getFilter() { - return filter; - } + public String getFilter() { return filter; } } diff --git a/src/main/java/com/rmn/testrail/service/TestRailService.java b/src/main/java/com/rmn/testrail/service/TestRailService.java index d88e5d8..fa06f60 100644 --- a/src/main/java/com/rmn/testrail/service/TestRailService.java +++ b/src/main/java/com/rmn/testrail/service/TestRailService.java @@ -1,7 +1,29 @@ package com.rmn.testrail.service; -import com.rmn.testrail.entity.*; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.rmn.testrail.entity.BaseEntity; +import com.rmn.testrail.entity.EmptyMilestone; import com.rmn.testrail.entity.Error; +import com.rmn.testrail.entity.Milestone; +import com.rmn.testrail.entity.PlanEntry; +import com.rmn.testrail.entity.Priority; +import com.rmn.testrail.entity.Project; +import com.rmn.testrail.entity.ProjectCreator; +import com.rmn.testrail.entity.Section; +import com.rmn.testrail.entity.SectionCreator; +import com.rmn.testrail.entity.TestCase; +import com.rmn.testrail.entity.TestInstance; +import com.rmn.testrail.entity.TestPlan; +import com.rmn.testrail.entity.TestPlanCreator; +import com.rmn.testrail.entity.TestResult; +import com.rmn.testrail.entity.TestResults; +import com.rmn.testrail.entity.TestRun; +import com.rmn.testrail.entity.TestRunCreator; +import com.rmn.testrail.entity.TestRunUpdater; +import com.rmn.testrail.entity.TestSuite; +import com.rmn.testrail.entity.TestSuiteCreator; +import com.rmn.testrail.entity.UpdatePlanEntry; +import com.rmn.testrail.entity.User; import com.rmn.testrail.parameters.ApiFilterValue; import com.rmn.testrail.parameters.ApiParameter; import com.rmn.testrail.parameters.ApiParameters; @@ -10,13 +32,12 @@ import com.rmn.testrail.util.JSONUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.annotate.JsonSerialize; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -256,7 +277,7 @@ public TestCase updateTestCase(TestCase testCase, int caseId) { * WARNING: Permanently delete an existing test case. Please note: Deleting a test case cannot be undone and also permanently deletes all test results in active test runs (i.e. test runs that haven't been closed (archived) yet). * @param caseId The ID of the test case */ - public void deleteTestCase(int caseId) { + public void deleteTestCase(int caseId) throws IOException { postRESTBody(TestRailCommand.DELETE_CASE.getCommand(), Integer.toString(caseId), null); } @@ -299,7 +320,7 @@ public String getConfigurations(int projectId) { * @param name The name of the configuration group * @param projectId The ID of the project the configuration group should be added to */ - public void addConfigGroup(final String name, int projectId) { + public void addConfigGroup(final String name, int projectId) throws IOException { postRESTBody(TestRailCommand.ADD_CONFIG_GROUP.getCommand(), null, new BaseEntity() { @JsonProperty("name") @@ -312,7 +333,7 @@ public void addConfigGroup(final String name, int projectId) { * @param name The name of the configuration * @param configGroupId The ID of the configuration group the configuration should be added to */ - public void addConfig(final String name, int configGroupId) { + public void addConfig(final String name, int configGroupId) throws IOException { postRESTBody(TestRailCommand.ADD_CONFIG.getCommand(), Integer.toString(configGroupId), new BaseEntity() { @JsonProperty("name") @@ -325,7 +346,7 @@ public void addConfig(final String name, int configGroupId) { * @param name The new name of the configuration group * @param configGroupId The ID of the configuration group */ - public void updateConfigGroup(final String name, int configGroupId) { + public void updateConfigGroup(final String name, int configGroupId) throws IOException { postRESTBody(TestRailCommand.UPDATE_CONFIG_GROUP.getCommand(), Integer.toString(configGroupId), new BaseEntity() { @JsonProperty("name") @@ -338,7 +359,7 @@ public void updateConfigGroup(final String name, int configGroupId) { * @param name The new name of the configuration * @param configId The ID of the configuration */ - public void updateConfig(final String name, int configId) { + public void updateConfig(final String name, int configId) throws IOException { postRESTBody(TestRailCommand.UPDATE_CONFIG.getCommand(), Integer.toString(configId), new BaseEntity() { @JsonProperty("name") @@ -351,7 +372,7 @@ public void updateConfig(final String name, int configId) { * Please note: Deleting a configuration group cannot be undone and also permanently deletes all configurations in this group. It does not, however, affect closed test plans/runs, or active test plans/runs unless they are updated. * @param configGroupId The ID of the configuration group */ - public void deleteConfigGroup(int configGroupId) { + public void deleteConfigGroup(int configGroupId) throws IOException { postRESTBody(TestRailCommand.DELETE_CONFIG_GROUP.getCommand(), Integer.toString(configGroupId), null); } @@ -360,7 +381,7 @@ public void deleteConfigGroup(int configGroupId) { * Please note: Deleting a configuration cannot be undone. It does not, however, affect closed test plans/runs, or active test plans/runs unless they are updated. * @param configId The ID of the configuration */ - public void deleteConfig(int configId) { + public void deleteConfig(int configId) throws IOException { postRESTBody(TestRailCommand.DELETE_CONFIG.getCommand(), Integer.toString(configId), null); } @@ -488,7 +509,7 @@ public TestPlan closeTestPlan(int planId) { * Please note: Deleting a test plan cannot be undone and also permanently deletes all test runs and results of the test plan. * @param planId The ID of the test plan */ - public void deleteTestPlan(int planId) { + public void deleteTestPlan(int planId) throws IOException { postRESTBody(TestRailCommand.DELETE_PLAN.getCommand(), Integer.toString(planId), null); } @@ -498,7 +519,7 @@ public void deleteTestPlan(int planId) { * @param planId The ID of the test plan * @param entryId The ID of the test plan entry (note: not the test run ID) */ - public void deleteTestPlanEntry(int planId, int entryId) { + public void deleteTestPlanEntry(int planId, int entryId) throws IOException { postRESTBody(TestRailCommand.DELETE_PLAN_ENTRY.getCommand(), Integer.toString(planId) + "/" + Integer.toString(entryId), null); } @@ -578,7 +599,7 @@ public Project updateProject(int projectId, final boolean isCompleted) { * Please note: Deleting a project cannot be undone and also permanently deletes all test suites and cases, test runs and results and everything else that is part of the project. * @param projectId The ID of the project */ - public void deleteProject(int projectId) { + public void deleteProject(int projectId) throws IOException { postRESTBody(TestRailCommand.DELETE_PROJECT.getCommand(), Integer.toString(projectId), null); } @@ -671,7 +692,7 @@ public TestResult addTestResult(int testId, TestResult result) { * @param result TestResult entity you wish to add to this TestInstance * @return the new test result */ - public TestResult addTestResultForCase(int runId, int caseId, TestResult result) { + public TestResult addTestResultForCase(int runId, int caseId, TestResult result) throws IOException { HttpResponse response = postRESTBody(TestRailCommand.ADD_RESULT_FOR_CASE.getCommand(), Integer.toString(runId) + "/" + Integer.toString(caseId), result); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestResult was not properly added to Run ID: %d | Case ID: %d: %s", runId, caseId, response.getStatusLine().getReasonPhrase())); @@ -713,7 +734,7 @@ public TestResults addTestResults(int runId, TestResults results) { * @param results A TestResults entity (which can include multiple TestResult entities) you wish to add to this TestRun * @return the newly created TestResults object */ - public TestResults addTestResultsForCases(int runId, TestResults results) { + public TestResults addTestResultsForCases(int runId, TestResults results) throws IOException { HttpResponse response = postRESTBody(TestRailCommand.ADD_RESULTS_FOR_CASES.getCommand(), Integer.toString(runId), results); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestResults was not properly added to TestRun [%d]: %s", runId, response.getStatusLine().getReasonPhrase())); @@ -793,7 +814,7 @@ public TestRun updateTestRun(int runId, TestRunUpdater testRunUpdater) { * @param run The TestRun you want to close * @return the newly closed test run */ - public TestRun closeTestRun(TestRun run) { + public TestRun closeTestRun(TestRun run) throws IOException { HttpResponse response = postRESTBody(TestRailCommand.CLOSE_RUN.getCommand(), Integer.toString(run.getId()), run); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestRun was not properly closed, TestRunID [%d]: %s", run.getId(), response.getStatusLine().getReasonPhrase())); @@ -811,7 +832,7 @@ public TestRun closeTestRun(TestRun run) { * @param runId The ID of the test run * @return the newly closed test run */ - public TestRun closeTestRun(int runId) { + public TestRun closeTestRun(int runId) throws IOException { HttpResponse response = postRESTBody(TestRailCommand.CLOSE_RUN.getCommand(), Integer.toString(runId), null); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestRun was not properly closed, TestRunID [%d]: %s", runId, response.getStatusLine().getReasonPhrase())); @@ -829,7 +850,7 @@ public TestRun closeTestRun(int runId) { * Please note: Deleting a test run cannot be undone and also permanently deletes all tests and results of the test run. * @param runId The ID of the test run */ - public void deleteTestRun(int runId) { + public void deleteTestRun(int runId) throws IOException { postRESTBody(TestRailCommand.DELETE_RUN.getCommand(), Integer.toString(runId), null); } @@ -884,7 +905,7 @@ public String getStatuses() { * @param suiteId The Suite ID (in TestRails, this will be something like 'S7', but just provide the 7) * @return A TestSuite */ - public TestSuite getTestSuite( int suiteId ) { + public TestSuite getTestSuite(int suiteId ) { return getEntitySingle(TestSuite.class, TestRailCommand.GET_SUITE.getCommand(), Integer.toString(suiteId)); } @@ -922,7 +943,7 @@ public TestSuite updateTestSuite(int suiteId, TestSuite testSuite) { * Please note: Deleting a test suite cannot be undone and also deletes all active test runs and results, i.e. test runs and results that weren't closed (archived) yet. * @param suiteId The ID of the test suite */ - public void deleteTestSuite(int suiteId) { + public void deleteTestSuite(int suiteId) throws IOException { postRESTBody(TestRailCommand.DELETE_SUITE.getCommand(), Integer.toString(suiteId), null); } @@ -1048,7 +1069,7 @@ private HttpURLConnection getRESTRequest(String apiCall, String urlParams) { * @return The Content of the HTTP Response */ private HttpResponse postRESTBody(String apiCall, String urlParams, BaseEntity entity) { - HttpClient httpClient = new DefaultHttpClient(); + CloseableHttpClient httpClient = HttpClientBuilder.create().build(); String completeUrl = buildRequestURL( apiCall, urlParams ); try { @@ -1058,7 +1079,7 @@ private HttpResponse postRESTBody(String apiCall, String urlParams, BaseEntity e request.addHeader("Content-Type", "application/json"); ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL.NON_NULL); byte[] body = mapper.writeValueAsBytes(entity); request.setEntity(new ByteArrayEntity(body)); @@ -1075,7 +1096,14 @@ private HttpResponse postRESTBody(String apiCall, String urlParams, BaseEntity e log.error(String.format("An IOException was thrown while trying to process a REST Request against URL: [%s]", completeUrl), e.toString()); throw new RuntimeException(String.format("Connection is null, check URL: %s", completeUrl)); } finally { - httpClient.getConnectionManager().shutdown(); + try { + httpClient.close(); + } + catch (IOException ex) { + log.error("An IOException thrown while trying to close the HTTP client against URL: {}", completeUrl); + throw new RuntimeException("Unable to close HTTP client against URL: " + completeUrl, ex); + } + //httpClient.getConnectionManager().shutdown(); } } @@ -1089,7 +1117,7 @@ private HttpResponse postRESTBody(String apiCall, String urlParams, BaseEntity e * @return The Content of the HTTP Response */ private T postRESTBodyReturn(String apiCall, String urlParams, BaseEntity entity, Class returnEntityType) { - HttpClient httpClient = new DefaultHttpClient(); + CloseableHttpClient httpClient = HttpClientBuilder.create().build(); String completeUrl = buildRequestURL( apiCall, urlParams ); try { @@ -1100,7 +1128,7 @@ private T postRESTBodyReturn(String apiCall, String urlPa request.addHeader("Encoding", "UTF-8"); ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); byte[] body = mapper.writeValueAsBytes(entity); request.setEntity(new ByteArrayEntity(body)); @@ -1121,7 +1149,14 @@ private T postRESTBodyReturn(String apiCall, String urlPa log.error(String.format("An IOException was thrown while trying to process a REST Request against URL: [%s]", completeUrl), e); throw new RuntimeException(String.format("Connection is null, check URL: %s", completeUrl), e); } finally { - httpClient.getConnectionManager().shutdown(); + try { + httpClient.close(); + } + catch (IOException ex) { + log.error("An IOException thrown while trying to close the HTTP client against URL: {}", completeUrl); + throw new RuntimeException("Unable to close HTTP client against URL: " + completeUrl, ex); + } + //httpClient.getConnectionManager().shutdown(); } return null; } @@ -1138,7 +1173,7 @@ private HttpResponse executeRequestWithRetry(HttpPost request, int retries) thro int RETRY_DELAY_MS = 0; int retryDelayInMS; - HttpClient httpClient = new DefaultHttpClient(); + CloseableHttpClient httpClient = HttpClientBuilder.create().build(); HttpResponse response = null; for (int retry = 0; retry < retries && !connected; retry++) { diff --git a/src/main/java/com/rmn/testrail/util/JSONUtils.java b/src/main/java/com/rmn/testrail/util/JSONUtils.java index ca9aaf4..f92d21c 100644 --- a/src/main/java/com/rmn/testrail/util/JSONUtils.java +++ b/src/main/java/com/rmn/testrail/util/JSONUtils.java @@ -1,8 +1,9 @@ package com.rmn.testrail.util; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.type.TypeFactory; +import com.fasterxml.jackson.databind.DeserializationConfig; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; import java.util.ArrayList; import java.util.List; @@ -39,7 +40,8 @@ public static T getMappedJsonObject(Class jsonObjectClass, String json) { public static T getMappedJsonObject( Class jsonObjectClass, String json, boolean failOnUnknownProperties ) { TypeFactory t = TypeFactory.defaultInstance(); ObjectMapper mapper = new ObjectMapper(); - mapper.configure( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties ); + mapper.configure( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES , failOnUnknownProperties ); + //mapper.configure( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties ); T mappedObject; try { @@ -74,7 +76,8 @@ public static List getMappedJsonObjectList(Class jsonObjectClass, Stri public static List getMappedJsonObjectList(Class jsonObjectClass, String json, boolean failOnUnknownProperties) { List list; ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties); + //mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties); TypeFactory t = TypeFactory.defaultInstance(); try { From 453a3d3b723a97c475f7b63e70b3104cc469a759 Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Wed, 27 Jan 2021 15:32:43 -0800 Subject: [PATCH 4/9] [maven-release-plugin] prepare release testrailsdk-1.3.4.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 18ea7cb..5759617 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.mgage testrailsdk - 1.3.4.1-SNAPSHOT + 1.3.4.1 jar ${project.groupId}:${project.artifactId} From 13d3210392e3e5626ebca0904905fb8527523449 Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Wed, 27 Jan 2021 15:32:58 -0800 Subject: [PATCH 5/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5759617..c55c6d2 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.mgage testrailsdk - 1.3.4.1 + 1.3.4.2-SNAPSHOT jar ${project.groupId}:${project.artifactId} From 2631182acb3fadfba04284c244a68dd625d59525 Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Wed, 10 Feb 2021 15:10:30 -0800 Subject: [PATCH 6/9] QA-885 :: Support for TestRail 6.7 paged object returned by bulk API Includes support for paged: "attachments" (not implemented in the library at this time), "cases", "milestones", "plans", "projects", "results", "runs", "sections", "tests" --- README.md | 12 ++-- pom.xml | 10 +-- .../com/rmn/testrail/entity/BasicPaged.java | 57 +++++++++++++++++ .../testrail/entity/BulkEntityCategory.java | 57 +++++++++++++++++ .../com/rmn/testrail/entity/Milestone.java | 9 +++ .../com/rmn/testrail/entity/TestInstance.java | 2 + .../com/rmn/testrail/entity/TestPlan.java | 4 +- .../com/rmn/testrail/entity/TestResults.java | 2 +- .../java/com/rmn/testrail/entity/TestRun.java | 3 + .../com/rmn/testrail/entity/TestStatus.java | 2 +- .../testrail/parameters/GetCasesFilter.java | 8 ++- .../parameters/GetMilestonesFilter.java | 14 +++-- .../testrail/parameters/GetPlansFilter.java | 9 ++- .../parameters/GetProjectsFilter.java | 10 ++- .../testrail/parameters/GetResultsFilter.java | 6 +- .../parameters/GetResultsForRunFilter.java | 7 ++- .../testrail/parameters/GetRunsFilter.java | 9 ++- .../testrail/parameters/GetTestsFilter.java | 10 ++- .../rmn/testrail/service/TestRailCommand.java | 2 +- .../rmn/testrail/service/TestRailService.java | 52 ++++++++-------- .../java/com/rmn/testrail/util/JSONUtils.java | 42 ++++++++++++- .../testrail/entity/TestRunCreatorTest.java | 3 +- .../service/TestIntegrationSuite.java | 6 +- .../TestRailServiceIntegrationTest.java | 2 +- .../testrail/service/TestRailServiceTest.java | 60 ++++++++++++------ src/test/resources/ProjectsPaged.json | 61 +++++++++++++++++++ src/test/resources/SectionsPaged.json | 56 +++++++++++++++++ src/test/resources/TestCasesPaged.json | 51 ++++++++++++++++ src/test/resources/TestInstancesPaged.json | 41 +++++++++++++ src/test/resources/TestPlansPaged.json | 61 +++++++++++++++++++ src/test/resources/TestResultsPaged.json | 37 +++++++++++ src/test/resources/TestRunsPaged.json | 51 ++++++++++++++++ 32 files changed, 664 insertions(+), 92 deletions(-) create mode 100644 src/main/java/com/rmn/testrail/entity/BasicPaged.java create mode 100644 src/main/java/com/rmn/testrail/entity/BulkEntityCategory.java create mode 100644 src/test/resources/ProjectsPaged.json create mode 100644 src/test/resources/SectionsPaged.json create mode 100644 src/test/resources/TestCasesPaged.json create mode 100644 src/test/resources/TestInstancesPaged.json create mode 100644 src/test/resources/TestPlansPaged.json create mode 100644 src/test/resources/TestResultsPaged.json create mode 100644 src/test/resources/TestRunsPaged.json diff --git a/README.md b/README.md index 16c08fb..a1541bc 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ Download the source, then from the command-line, run the `mvn install` command. Once the jar has been deployed, you should be able to include a small snippet in your pom file: - com.retailmenot + com.mgage testrailsdk - 1.3.1 + 1.3.4.1 If you're currently using Maven, and your repos, paths, and IDE are all set up correctly, you should be able to address the classes in this project immediately. @@ -28,9 +28,9 @@ To point to the jar file in Maven Central, include this xml snippet in your pom. ```xml - com.retailmenot + com.mgage testrailsdk - 1.3.1 + 1.3.4.1 ``` @@ -57,6 +57,10 @@ This project has been in general use within our offices for over a year, having * TestInstance - A single instance of a Test Case in the context of a Test Run. Results of "PASS", "FAIL", "WARNING", etc are reported directly against this entity * TestResult - The execution record of a single Test Instance within a given Test Run +## Entities NOT supported + +* Attachment entity is not implemented + ## Modeling Custom Fields TestRail allows you to add custom fields to many entities. We support this, but you'll have to work a little harder to implement. When parsing the JSON entities that support custom fields, the Jackson processor ignores "unknown" fields diff --git a/pom.xml b/pom.xml index c55c6d2..307d698 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.mgage testrailsdk - 1.3.4.2-SNAPSHOT + 1.3.5-SNAPSHOT jar ${project.groupId}:${project.artifactId} @@ -41,7 +41,7 @@ scm:git:git@github.com:mGageTechOps/TestRailSDK.git scm:git:git@github.com:mGageTechOps/TestRailSDK.git scm:git:git@github.com:mGageTechOps/TestRailSDK.git - testrailsdk-1.3.4.1 + testrailsdk-1.3.5 @@ -50,11 +50,6 @@ jackson-databind 2.11.4 - - org.slf4j - slf4j-api - 1.6.6 - org.apache.commons commons-lang3 @@ -69,7 +64,6 @@ ch.qos.logback logback-classic 1.2.3 - test junit diff --git a/src/main/java/com/rmn/testrail/entity/BasicPaged.java b/src/main/java/com/rmn/testrail/entity/BasicPaged.java new file mode 100644 index 0000000..a12b35b --- /dev/null +++ b/src/main/java/com/rmn/testrail/entity/BasicPaged.java @@ -0,0 +1,57 @@ +package com.rmn.testrail.entity; + +import com.fasterxml.jackson.annotation.JsonAlias; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * This object represents paginated response from TestRail API for bulk artifacts that reflect v6.7 and + * are specified on the {@link JsonAlias} annotation on "list" field + * + * @author mgage + */ + +@JsonIgnoreProperties(ignoreUnknown = true) +public class BasicPaged extends BaseEntity { + + @JsonProperty("offset") + private Integer offset; + public Integer getOffset() { return offset; } + public void setOffset(Integer offset) { this.offset = offset; } + + @JsonProperty("limit") + private Integer limit; + public Integer getLimit() { return limit; } + public void setLimit(Integer limit) { this.limit = limit; } + + @JsonProperty("size") + private Integer size; + public Integer getSize() { return size; } + public void setSize(Integer size) { this.size = size; } + + @JsonProperty("_links") + private Links links; + public Links getLinks() { return links; } + public void setLinks(Links links) { this.links = links; } + + @JsonAlias({ "attachments", "cases", "milestones", "plans", "projects", "results", "runs", "sections", "tests" }) + private List list; + public List getList() { return list; } + public void setList(List list) { this.list = list; } + + + private static class Links { + + @JsonProperty("next") + private String next; + public String getNext() { return next; } + public void setNext(String next) { this.next = next; } + + @JsonProperty("prev") + private String prev; + public String getPrev() { return prev; } + public void setPrev(String prev) { this.prev = prev; } + } +} diff --git a/src/main/java/com/rmn/testrail/entity/BulkEntityCategory.java b/src/main/java/com/rmn/testrail/entity/BulkEntityCategory.java new file mode 100644 index 0000000..7f6d5a7 --- /dev/null +++ b/src/main/java/com/rmn/testrail/entity/BulkEntityCategory.java @@ -0,0 +1,57 @@ +package com.rmn.testrail.entity; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.NoSuchElementException; + +/** + * This Enumeration represents bulk end-point api Json types for returned paginated entity + * bulktype - represents short type name in lower case for entities in the data model + * + * Note: Includes only APIs supporting pagination as of TestRail 6.7 + */ + +public enum BulkEntityCategory { + + ATTACHMENT("attachment"), + MILESTONE("milestone"), + PROJECT("project"), + RESULT("result"), + TESTCASE("testcase"), //The free standing test case used as a template for test entity + TESTINSTANCE("testinstance"), //The test entity attached to either run or plan to report against + TESTPLAN("testplan"), + TESTRUN("testrun"), + SECTION("section"), + TESTRESULT("testresult"); + + private static final Logger log = LoggerFactory.getLogger(BulkEntityCategory.class); + private final String bulkType; + + BulkEntityCategory(String bulkType) { + this.bulkType = bulkType; + } + + public String getBulkType() { + return bulkType; + } + + public static boolean isBulkCategory(String category) { + try { + fromBulkType(category); + return true; + } catch (NoSuchElementException ex) { + log.debug("Non-paged (bulk) object type detected. '{}'", ex.toString()); + return false; + } + } + + public static BulkEntityCategory fromBulkType(String bulkType) { + + return Arrays.stream(BulkEntityCategory.values()) + .filter(t -> t.getBulkType().equals(bulkType)) + .findFirst() + .orElseThrow(); + } +} diff --git a/src/main/java/com/rmn/testrail/entity/Milestone.java b/src/main/java/com/rmn/testrail/entity/Milestone.java index f0bd4e3..add8ca5 100644 --- a/src/main/java/com/rmn/testrail/entity/Milestone.java +++ b/src/main/java/com/rmn/testrail/entity/Milestone.java @@ -1,10 +1,19 @@ package com.rmn.testrail.entity; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** + * 'milestones' - optional field is not implemented. TestRail 5.3 data type 'array'. Only available with get_milestone + * Note: milestone could be included with {@link JsonInclude} + * example: @JsonInclude(value=Include.NON_NULL, content=Include.NON_NULL) + * or consider @JsonInclude(value=Include.NON_ABSENT) + * * @author jsteigel */ + +@JsonIgnoreProperties(ignoreUnknown = true) public class Milestone extends BaseEntity { @JsonProperty("id") private Integer id; diff --git a/src/main/java/com/rmn/testrail/entity/TestInstance.java b/src/main/java/com/rmn/testrail/entity/TestInstance.java index 3c794d6..9a302dc 100644 --- a/src/main/java/com/rmn/testrail/entity/TestInstance.java +++ b/src/main/java/com/rmn/testrail/entity/TestInstance.java @@ -11,6 +11,8 @@ * The TestRail top-level entity is actually called a "Test", but that collides with the @Test annotation we're * using in the unit tests. Calling it a TestInstance will avoid ambiguity * + * Note: Custom Fields are ignored in this object + * * @author mmerrell */ @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/com/rmn/testrail/entity/TestPlan.java b/src/main/java/com/rmn/testrail/entity/TestPlan.java index 9ef227d..b51493c 100644 --- a/src/main/java/com/rmn/testrail/entity/TestPlan.java +++ b/src/main/java/com/rmn/testrail/entity/TestPlan.java @@ -7,6 +7,8 @@ import java.util.List; /** + * 'refs' - optional field is not implemented. TestRail 6.3 data type 'string'. + * * @author mmerrell */ @JsonIgnoreProperties(ignoreUnknown = true) @@ -122,7 +124,7 @@ public List getTestRuns() { //Get the first TestRun in each "entry:run" element and pile it up with the first entries in all the other TestRunGroups to form one list of TestRuns. Not sure this is the ideal way to do // things, but by leaving getEntries() public you can get to the other test runs on your own - List testRuns = new ArrayList(entries.size()); + List testRuns = new ArrayList<>(entries.size()); for (TestRunGroup group: entries) { TestRun testRun = group.getRuns().get(0); if (null != testRun) { diff --git a/src/main/java/com/rmn/testrail/entity/TestResults.java b/src/main/java/com/rmn/testrail/entity/TestResults.java index 69ea60e..3b3f716 100644 --- a/src/main/java/com/rmn/testrail/entity/TestResults.java +++ b/src/main/java/com/rmn/testrail/entity/TestResults.java @@ -12,7 +12,7 @@ */ public class TestResults extends BaseEntity { @JsonProperty("results") - private List results = new ArrayList(); + private List results = new ArrayList<>(); public List getResults() { return results; } public void setResults(List results) { this.results = results; } diff --git a/src/main/java/com/rmn/testrail/entity/TestRun.java b/src/main/java/com/rmn/testrail/entity/TestRun.java index 8017e14..21b5526 100644 --- a/src/main/java/com/rmn/testrail/entity/TestRun.java +++ b/src/main/java/com/rmn/testrail/entity/TestRun.java @@ -8,6 +8,9 @@ /** * This class has all the fields in a TestRun API request. * + * 'updated_on' - optional field is not implemented (timestamp) + * 'refs' - optional field is not implemented (string) + * * @author mmerrell */ @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/com/rmn/testrail/entity/TestStatus.java b/src/main/java/com/rmn/testrail/entity/TestStatus.java index 06450c6..1d8ce5c 100644 --- a/src/main/java/com/rmn/testrail/entity/TestStatus.java +++ b/src/main/java/com/rmn/testrail/entity/TestStatus.java @@ -12,7 +12,7 @@ * @author mmerrell */ public class TestStatus { - private static Map allStatus = new HashMap(); + private static Map allStatus = new HashMap<>(); static { allStatus.put("Passed", 1); diff --git a/src/main/java/com/rmn/testrail/parameters/GetCasesFilter.java b/src/main/java/com/rmn/testrail/parameters/GetCasesFilter.java index 1a890f9..61e244c 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetCasesFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetCasesFilter.java @@ -10,7 +10,9 @@ public enum GetCasesFilter implements ApiFilter { CREATED_AFTER("created_after"), CREATED_BEFORE("created_before"), CREATED_BY("created_by"), + LIMIT("limit"), //250 by default. requires TestRail 6.7 or later MILESTONE_ID("milestone_id"), + OFFSET("offset"), //requires TestRail 6.7 or later PRIORITY_ID("priority_id"), TEMPLATE_ID("template_id"), TYPE_ID("type_id"), @@ -18,8 +20,10 @@ public enum GetCasesFilter implements ApiFilter { UPDATED_BEFORE("updated_before"), UPDATED_BY("updated_by"); - private String filter; - GetCasesFilter(String filter) { this.filter = filter; } + private final String filter; + GetCasesFilter(String filter) { + this.filter = filter; + } public String getFilter() { return filter; diff --git a/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java b/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java index 637e378..3bfcb1c 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetMilestonesFilter.java @@ -8,10 +8,16 @@ public enum GetMilestonesFilter implements ApiFilter { //Request filter for get_milestones IS_COMPLETED("is_completed"), - IS_STARTED("is_started"); + IS_STARTED("is_started"), + LIMIT("limit"), //250 by default. requires TestRail 6.7 or later + OFFSET("offset"); //requires TestRail 6.7 or later - private String filter; - GetMilestonesFilter(String filter) { this.filter = filter; } + private final String filter; + GetMilestonesFilter(String filter) { + this.filter = filter; + } - public String getFilter() { return filter; } + public String getFilter() { + return filter; + } } diff --git a/src/main/java/com/rmn/testrail/parameters/GetPlansFilter.java b/src/main/java/com/rmn/testrail/parameters/GetPlansFilter.java index eede747..edc4b30 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetPlansFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetPlansFilter.java @@ -12,10 +12,13 @@ public enum GetPlansFilter implements ApiFilter{ CREATED_BY("created_by"), IS_COMPLETED("is_completed"), LIMIT("limit"), - MILESTONE_ID("milestone_id"); + MILESTONE_ID("milestone_id"), + OFFSET("offset"); //requires TestRail 6.7 or later - private String filter; - GetPlansFilter(String filter) { this.filter = filter; } + private final String filter; + GetPlansFilter(String filter) { + this.filter = filter; + } public String getFilter() { return filter; diff --git a/src/main/java/com/rmn/testrail/parameters/GetProjectsFilter.java b/src/main/java/com/rmn/testrail/parameters/GetProjectsFilter.java index 6edaa19..175058b 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetProjectsFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetProjectsFilter.java @@ -7,10 +7,14 @@ */ public enum GetProjectsFilter implements ApiFilter { //Request filter for get_projects - IS_COMPLETED("is_completed"); + IS_COMPLETED("is_completed"), + LIMIT("limit"), //250 by default. requires TestRail 6.7 or later + OFFSET("offset"); //requires TestRail 6.7 or later - private String filter; - GetProjectsFilter(String filter) { this.filter = filter; } + private final String filter; + GetProjectsFilter(String filter) { + this.filter = filter; + } public String getFilter() { return filter; diff --git a/src/main/java/com/rmn/testrail/parameters/GetResultsFilter.java b/src/main/java/com/rmn/testrail/parameters/GetResultsFilter.java index 62dfbb9..10af1a8 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetResultsFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetResultsFilter.java @@ -11,8 +11,10 @@ public enum GetResultsFilter implements ApiFilter { OFFSET("offset"), STATUS_ID("status_id"); - private String filter; - GetResultsFilter(String filter) { this.filter = filter; } + private final String filter; + GetResultsFilter(String filter) { + this.filter = filter; + } public String getFilter() { return filter; diff --git a/src/main/java/com/rmn/testrail/parameters/GetResultsForRunFilter.java b/src/main/java/com/rmn/testrail/parameters/GetResultsForRunFilter.java index b809828..fb6845f 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetResultsForRunFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetResultsForRunFilter.java @@ -11,10 +11,13 @@ public enum GetResultsForRunFilter implements ApiFilter { CREATED_BEFORE("created_before"), CREATED_BY("created_by"), LIMIT("limit"), + OFFSET("offset"), //requires TestRail 6.7 or later STATUS_ID("status_id"); - private String filter; - GetResultsForRunFilter(String filter) { this.filter = filter; } + private final String filter; + GetResultsForRunFilter(String filter) { + this.filter = filter; + } public String getFilter() { return filter; diff --git a/src/main/java/com/rmn/testrail/parameters/GetRunsFilter.java b/src/main/java/com/rmn/testrail/parameters/GetRunsFilter.java index e975c55..c9ed2b9 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetRunsFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetRunsFilter.java @@ -13,10 +13,13 @@ public enum GetRunsFilter implements ApiFilter { IS_COMPLETED("is_completed"), LIMIT("limit"), MILESTONE_ID("milestone_id"), - SUITE_ID("suite_id"); + SUITE_ID("suite_id"), + OFFSET("offset"); - private String filter; - GetRunsFilter(String filter) { this.filter = filter; } + private final String filter; + GetRunsFilter(String filter) { + this.filter = filter; + } public String getFilter() { return filter; diff --git a/src/main/java/com/rmn/testrail/parameters/GetTestsFilter.java b/src/main/java/com/rmn/testrail/parameters/GetTestsFilter.java index d777813..06f449a 100644 --- a/src/main/java/com/rmn/testrail/parameters/GetTestsFilter.java +++ b/src/main/java/com/rmn/testrail/parameters/GetTestsFilter.java @@ -7,10 +7,14 @@ */ public enum GetTestsFilter implements ApiFilter { //Request filters for get_tests - STATUS_ID("status_id"); + STATUS_ID("status_id"), + LIMIT("limit"), //250 by default. requires TestRail 6.7 or later + OFFSET("offset"); //requires TestRail 6.7 or later - private String filter; - GetTestsFilter(String filter) { this.filter = filter; } + private final String filter; + GetTestsFilter(String filter) { + this.filter = filter; + } public String getFilter() { return filter; diff --git a/src/main/java/com/rmn/testrail/service/TestRailCommand.java b/src/main/java/com/rmn/testrail/service/TestRailCommand.java index f466754..5f8f812 100644 --- a/src/main/java/com/rmn/testrail/service/TestRailCommand.java +++ b/src/main/java/com/rmn/testrail/service/TestRailCommand.java @@ -105,7 +105,7 @@ public enum TestRailCommand { GET_USER_BY_EMAIL("get_user_by_email"), GET_USERS("get_users"); - private String command; + private final String command; private TestRailCommand(String command) { this.command = command; } diff --git a/src/main/java/com/rmn/testrail/service/TestRailService.java b/src/main/java/com/rmn/testrail/service/TestRailService.java index fa06f60..1fa8e24 100644 --- a/src/main/java/com/rmn/testrail/service/TestRailService.java +++ b/src/main/java/com/rmn/testrail/service/TestRailService.java @@ -53,7 +53,7 @@ * @author mmerrell */ public class TestRailService implements Serializable { - private Logger log = LoggerFactory.getLogger(getClass()); + private final Logger log = LoggerFactory.getLogger(TestRailService.class); /** * This might not last forever--we'll need to make "v2" a variable at some point--but this works for the moment @@ -144,7 +144,7 @@ public void setApiEndpoint(URL apiEndpoint) { */ protected List getEntityList(Class clazz, String apiCall, String param) { HttpURLConnection connection = getRESTRequest(apiCall, param); - log.debug(""); + log.debug("Get Entity List for '{}' class type.", clazz.getSimpleName().toLowerCase()); String contents = utils.getContentsFromConnection(connection); List entities = JSONUtils.getMappedJsonObjectList(clazz, contents); for (T suite: entities) { @@ -277,7 +277,7 @@ public TestCase updateTestCase(TestCase testCase, int caseId) { * WARNING: Permanently delete an existing test case. Please note: Deleting a test case cannot be undone and also permanently deletes all test results in active test runs (i.e. test runs that haven't been closed (archived) yet). * @param caseId The ID of the test case */ - public void deleteTestCase(int caseId) throws IOException { + public void deleteTestCase(int caseId) { postRESTBody(TestRailCommand.DELETE_CASE.getCommand(), Integer.toString(caseId), null); } @@ -320,7 +320,7 @@ public String getConfigurations(int projectId) { * @param name The name of the configuration group * @param projectId The ID of the project the configuration group should be added to */ - public void addConfigGroup(final String name, int projectId) throws IOException { + public void addConfigGroup(final String name, int projectId) { postRESTBody(TestRailCommand.ADD_CONFIG_GROUP.getCommand(), null, new BaseEntity() { @JsonProperty("name") @@ -333,7 +333,7 @@ public void addConfigGroup(final String name, int projectId) throws IOException * @param name The name of the configuration * @param configGroupId The ID of the configuration group the configuration should be added to */ - public void addConfig(final String name, int configGroupId) throws IOException { + public void addConfig(final String name, int configGroupId) { postRESTBody(TestRailCommand.ADD_CONFIG.getCommand(), Integer.toString(configGroupId), new BaseEntity() { @JsonProperty("name") @@ -346,7 +346,7 @@ public void addConfig(final String name, int configGroupId) throws IOException { * @param name The new name of the configuration group * @param configGroupId The ID of the configuration group */ - public void updateConfigGroup(final String name, int configGroupId) throws IOException { + public void updateConfigGroup(final String name, int configGroupId) { postRESTBody(TestRailCommand.UPDATE_CONFIG_GROUP.getCommand(), Integer.toString(configGroupId), new BaseEntity() { @JsonProperty("name") @@ -359,7 +359,7 @@ public void updateConfigGroup(final String name, int configGroupId) throws IOExc * @param name The new name of the configuration * @param configId The ID of the configuration */ - public void updateConfig(final String name, int configId) throws IOException { + public void updateConfig(final String name, int configId) { postRESTBody(TestRailCommand.UPDATE_CONFIG.getCommand(), Integer.toString(configId), new BaseEntity() { @JsonProperty("name") @@ -372,7 +372,7 @@ public void updateConfig(final String name, int configId) throws IOException { * Please note: Deleting a configuration group cannot be undone and also permanently deletes all configurations in this group. It does not, however, affect closed test plans/runs, or active test plans/runs unless they are updated. * @param configGroupId The ID of the configuration group */ - public void deleteConfigGroup(int configGroupId) throws IOException { + public void deleteConfigGroup(int configGroupId) { postRESTBody(TestRailCommand.DELETE_CONFIG_GROUP.getCommand(), Integer.toString(configGroupId), null); } @@ -381,7 +381,7 @@ public void deleteConfigGroup(int configGroupId) throws IOException { * Please note: Deleting a configuration cannot be undone. It does not, however, affect closed test plans/runs, or active test plans/runs unless they are updated. * @param configId The ID of the configuration */ - public void deleteConfig(int configId) throws IOException { + public void deleteConfig(int configId) { postRESTBody(TestRailCommand.DELETE_CONFIG.getCommand(), Integer.toString(configId), null); } @@ -509,7 +509,7 @@ public TestPlan closeTestPlan(int planId) { * Please note: Deleting a test plan cannot be undone and also permanently deletes all test runs and results of the test plan. * @param planId The ID of the test plan */ - public void deleteTestPlan(int planId) throws IOException { + public void deleteTestPlan(int planId) { postRESTBody(TestRailCommand.DELETE_PLAN.getCommand(), Integer.toString(planId), null); } @@ -519,7 +519,7 @@ public void deleteTestPlan(int planId) throws IOException { * @param planId The ID of the test plan * @param entryId The ID of the test plan entry (note: not the test run ID) */ - public void deleteTestPlanEntry(int planId, int entryId) throws IOException { + public void deleteTestPlanEntry(int planId, int entryId) { postRESTBody(TestRailCommand.DELETE_PLAN_ENTRY.getCommand(), Integer.toString(planId) + "/" + Integer.toString(entryId), null); } @@ -599,7 +599,7 @@ public Project updateProject(int projectId, final boolean isCompleted) { * Please note: Deleting a project cannot be undone and also permanently deletes all test suites and cases, test runs and results and everything else that is part of the project. * @param projectId The ID of the project */ - public void deleteProject(int projectId) throws IOException { + public void deleteProject(int projectId) { postRESTBody(TestRailCommand.DELETE_PROJECT.getCommand(), Integer.toString(projectId), null); } @@ -692,7 +692,7 @@ public TestResult addTestResult(int testId, TestResult result) { * @param result TestResult entity you wish to add to this TestInstance * @return the new test result */ - public TestResult addTestResultForCase(int runId, int caseId, TestResult result) throws IOException { + public TestResult addTestResultForCase(int runId, int caseId, TestResult result) { HttpResponse response = postRESTBody(TestRailCommand.ADD_RESULT_FOR_CASE.getCommand(), Integer.toString(runId) + "/" + Integer.toString(caseId), result); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestResult was not properly added to Run ID: %d | Case ID: %d: %s", runId, caseId, response.getStatusLine().getReasonPhrase())); @@ -734,7 +734,7 @@ public TestResults addTestResults(int runId, TestResults results) { * @param results A TestResults entity (which can include multiple TestResult entities) you wish to add to this TestRun * @return the newly created TestResults object */ - public TestResults addTestResultsForCases(int runId, TestResults results) throws IOException { + public TestResults addTestResultsForCases(int runId, TestResults results) { HttpResponse response = postRESTBody(TestRailCommand.ADD_RESULTS_FOR_CASES.getCommand(), Integer.toString(runId), results); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestResults was not properly added to TestRun [%d]: %s", runId, response.getStatusLine().getReasonPhrase())); @@ -814,7 +814,7 @@ public TestRun updateTestRun(int runId, TestRunUpdater testRunUpdater) { * @param run The TestRun you want to close * @return the newly closed test run */ - public TestRun closeTestRun(TestRun run) throws IOException { + public TestRun closeTestRun(TestRun run) { HttpResponse response = postRESTBody(TestRailCommand.CLOSE_RUN.getCommand(), Integer.toString(run.getId()), run); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestRun was not properly closed, TestRunID [%d]: %s", run.getId(), response.getStatusLine().getReasonPhrase())); @@ -832,7 +832,7 @@ public TestRun closeTestRun(TestRun run) throws IOException { * @param runId The ID of the test run * @return the newly closed test run */ - public TestRun closeTestRun(int runId) throws IOException { + public TestRun closeTestRun(int runId) { HttpResponse response = postRESTBody(TestRailCommand.CLOSE_RUN.getCommand(), Integer.toString(runId), null); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException(String.format("TestRun was not properly closed, TestRunID [%d]: %s", runId, response.getStatusLine().getReasonPhrase())); @@ -850,7 +850,7 @@ public TestRun closeTestRun(int runId) throws IOException { * Please note: Deleting a test run cannot be undone and also permanently deletes all tests and results of the test run. * @param runId The ID of the test run */ - public void deleteTestRun(int runId) throws IOException { + public void deleteTestRun(int runId) { postRESTBody(TestRailCommand.DELETE_RUN.getCommand(), Integer.toString(runId), null); } @@ -905,7 +905,7 @@ public String getStatuses() { * @param suiteId The Suite ID (in TestRails, this will be something like 'S7', but just provide the 7) * @return A TestSuite */ - public TestSuite getTestSuite(int suiteId ) { + public TestSuite getTestSuite( int suiteId ) { return getEntitySingle(TestSuite.class, TestRailCommand.GET_SUITE.getCommand(), Integer.toString(suiteId)); } @@ -943,7 +943,7 @@ public TestSuite updateTestSuite(int suiteId, TestSuite testSuite) { * Please note: Deleting a test suite cannot be undone and also deletes all active test runs and results, i.e. test runs and results that weren't closed (archived) yet. * @param suiteId The ID of the test suite */ - public void deleteTestSuite(int suiteId) throws IOException { + public void deleteTestSuite(int suiteId) { postRESTBody(TestRailCommand.DELETE_SUITE.getCommand(), Integer.toString(suiteId), null); } @@ -1042,15 +1042,15 @@ private HttpURLConnection getRESTRequest(String apiCall, String urlParams) { String completeUrl = buildRequestURL(apiCall, urlParams); try { - //log the complete url - log.debug("url: {}", completeUrl); + log.debug("Complete url: {}", completeUrl); //Add the application/json header - Map headers = new HashMap(); + Map headers = new HashMap<>(); headers.put("Content-Type", "application/json"); + headers.put("x-api-ident", "beta"); //Temporary header for beta API on TestRail 6.7 TODO - remove - //Log the curl call for easy reproduction -// log.warn(utils.getCurlCommandStringGet(completeUrl, headers)); + /*Log the curl call for easy reproduction + log.warn(utils.getCurlCommandStringGet(completeUrl, headers));*/ String authentication = utils.encodeAuthenticationBase64(username, password); return utils.getHTTPRequest(completeUrl, authentication, headers); @@ -1079,7 +1079,7 @@ private HttpResponse postRESTBody(String apiCall, String urlParams, BaseEntity e request.addHeader("Content-Type", "application/json"); ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL.NON_NULL); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); byte[] body = mapper.writeValueAsBytes(entity); request.setEntity(new ByteArrayEntity(body)); @@ -1103,7 +1103,6 @@ private HttpResponse postRESTBody(String apiCall, String urlParams, BaseEntity e log.error("An IOException thrown while trying to close the HTTP client against URL: {}", completeUrl); throw new RuntimeException("Unable to close HTTP client against URL: " + completeUrl, ex); } - //httpClient.getConnectionManager().shutdown(); } } @@ -1156,7 +1155,6 @@ private T postRESTBodyReturn(String apiCall, String urlPa log.error("An IOException thrown while trying to close the HTTP client against URL: {}", completeUrl); throw new RuntimeException("Unable to close HTTP client against URL: " + completeUrl, ex); } - //httpClient.getConnectionManager().shutdown(); } return null; } diff --git a/src/main/java/com/rmn/testrail/util/JSONUtils.java b/src/main/java/com/rmn/testrail/util/JSONUtils.java index f92d21c..ad4cbd4 100644 --- a/src/main/java/com/rmn/testrail/util/JSONUtils.java +++ b/src/main/java/com/rmn/testrail/util/JSONUtils.java @@ -1,9 +1,13 @@ package com.rmn.testrail.util; -import com.fasterxml.jackson.databind.DeserializationConfig; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.TypeFactory; +import com.rmn.testrail.entity.BasicPaged; +import com.rmn.testrail.entity.BulkEntityCategory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; @@ -13,6 +17,8 @@ */ public class JSONUtils { + private static final Logger log = LoggerFactory.getLogger(JSONUtils.class); + /** * Takes a JSON string and attempts to "map" it to the given class. It assumes the JSON * string is valid, and that it maps to the object you've indicated, and any problem with @@ -41,7 +47,6 @@ public static T getMappedJsonObject( Class jsonObjectClass, String json, TypeFactory t = TypeFactory.defaultInstance(); ObjectMapper mapper = new ObjectMapper(); mapper.configure( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES , failOnUnknownProperties ); - //mapper.configure( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties ); T mappedObject; try { @@ -60,11 +65,43 @@ public static T getMappedJsonObject( Class jsonObjectClass, String json, * @param jsonObjectClass The Class you wish to map the json to * @param json The JSON you wish to map to the given Class * @return An instance of the given Class, based on the attributes of the given JSON + * + * Note: To accommodate TestRail 6.7 changes to bulk API response this method (as only strict mode used) has + * been updated to get returned paged object and extract the json string representing entity list. This done + * conditionally only on types that are part of the bulk API with the help of {@link BulkEntityCategory}. */ public static List getMappedJsonObjectList(Class jsonObjectClass, String json) { + String entityType = jsonObjectClass.getSimpleName().toLowerCase(); + log.debug("The entity type to process the list has simple name: {}", entityType); + if(BulkEntityCategory.isBulkCategory(entityType)) { + log.debug("The enum type used to determine if bulk: '{}'", BulkEntityCategory.fromBulkType(entityType)); + String jsonObjectList = extractObjectList(json); + return getMappedJsonObjectList(jsonObjectClass, jsonObjectList, false); + } return getMappedJsonObjectList(jsonObjectClass, json, false); } + /** + * Private helper method to extract list of entities defined in {@link BulkEntityCategory} from paged bulk api + * defined as {@link BasicPaged} + * @param json - The JSON object returned by paged bulk API introduced in TestRail 6.7 + * @return - Json String that represents a list of extracted entities in compliance with API before 6.7 + */ + private static String extractObjectList(String json) { + log.debug("Attempting to parse out the list of entities from json string for paged object."); + BasicPaged multiPage = getMappedJsonObject(BasicPaged.class, json, false); + List entitiesObjectList = multiPage.getList(); + //log.debug("Expose entity list for debugging: '{}'", entitiesObjectList); + String jsonEntityList = ""; + try { + jsonEntityList = new ObjectMapper().writeValueAsString(entitiesObjectList); + } catch (JsonProcessingException ex) { + log.debug("The list will be empty due to exception '{}'", ex.toString()); + } + return jsonEntityList; + } + + /** * Returns a list of objects of the specified type. If you send "false" in the 3rd parameter, it will be * forgiving of JSON properties that are not defined or inaccessible in the specified jsonObjectClass @@ -77,7 +114,6 @@ public static List getMappedJsonObjectList(Class jsonObjectClass, Stri List list; ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties); - //mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, failOnUnknownProperties); TypeFactory t = TypeFactory.defaultInstance(); try { diff --git a/src/test/java/com/rmn/testrail/entity/TestRunCreatorTest.java b/src/test/java/com/rmn/testrail/entity/TestRunCreatorTest.java index 75c25c4..cb25c62 100644 --- a/src/test/java/com/rmn/testrail/entity/TestRunCreatorTest.java +++ b/src/test/java/com/rmn/testrail/entity/TestRunCreatorTest.java @@ -59,6 +59,7 @@ public void caseIdsGettersAndSettersShouldWorksCorrectly() { Assert.assertNull(testRunCreator.getCaseIds()); testRunCreator.setCaseIds(new Integer[]{111, 22, 3}); Integer[] expectedCasesId = {111, 22, 3}; - Assert.assertEquals(expectedCasesId, testRunCreator.getCaseIds()); + //Assert.assertEquals(expectedCasesId, testRunCreator.getCaseIds()); + Assert.assertArrayEquals(expectedCasesId, testRunCreator.getCaseIds()); } } \ No newline at end of file diff --git a/src/test/java/com/rmn/testrail/service/TestIntegrationSuite.java b/src/test/java/com/rmn/testrail/service/TestIntegrationSuite.java index 97f5548..896c9e6 100644 --- a/src/test/java/com/rmn/testrail/service/TestIntegrationSuite.java +++ b/src/test/java/com/rmn/testrail/service/TestIntegrationSuite.java @@ -27,7 +27,7 @@ @RunWith(value = Suite.class) @Suite.SuiteClasses(value = { TestRailServiceIntegrationTest.class }) public class TestIntegrationSuite { - private static Logger log = LoggerFactory.getLogger(TestIntegrationSuite.class.getSimpleName()); + private static final Logger log = LoggerFactory.getLogger(TestIntegrationSuite.class); //The setUp method initializes the list of projects, and the rest of the suite uses information from there protected static TestRailService service = new TestRailService(); @@ -45,7 +45,7 @@ public class TestIntegrationSuite { protected static boolean destructiveTestsOk = false; @BeforeClass - public static void setUp() throws IOException, InterruptedException { + public static void setUp() throws IOException { //Get the TestRails credentials from the testrails.properties file Properties properties = new Properties(); InputStream resource = TestRailServiceIntegrationTest.class.getClassLoader().getResourceAsStream("testrails.properties"); @@ -65,7 +65,7 @@ public static void setUp() throws IOException, InterruptedException { destructiveTestsOk = false; log.info("Your testrails.properties file does not contain the 'destructiveTestsOk' property--shutting off destructive tests"); } else { - destructiveTestsOk = Boolean.valueOf(destructiveTestsOkProperty); + destructiveTestsOk = Boolean.parseBoolean(destructiveTestsOkProperty); log.info("Located 'destructiveTestsOk' property--setting to " + destructiveTestsOk); } diff --git a/src/test/java/com/rmn/testrail/service/TestRailServiceIntegrationTest.java b/src/test/java/com/rmn/testrail/service/TestRailServiceIntegrationTest.java index 060ea6d..59821db 100644 --- a/src/test/java/com/rmn/testrail/service/TestRailServiceIntegrationTest.java +++ b/src/test/java/com/rmn/testrail/service/TestRailServiceIntegrationTest.java @@ -27,7 +27,7 @@ import java.util.Properties; public class TestRailServiceIntegrationTest { - private static Logger log = LoggerFactory.getLogger(TestRailServiceIntegrationTest.class.getSimpleName()); + private static final Logger log = LoggerFactory.getLogger(TestRailServiceIntegrationTest.class); /** * Test the getTestSuites (plural) API call diff --git a/src/test/java/com/rmn/testrail/service/TestRailServiceTest.java b/src/test/java/com/rmn/testrail/service/TestRailServiceTest.java index f4bc207..7ad0a20 100644 --- a/src/test/java/com/rmn/testrail/service/TestRailServiceTest.java +++ b/src/test/java/com/rmn/testrail/service/TestRailServiceTest.java @@ -1,8 +1,16 @@ package com.rmn.testrail.service; -import com.rmn.testrail.entity.*; + +import com.rmn.testrail.entity.Project; +import com.rmn.testrail.entity.Section; +import com.rmn.testrail.entity.TestCase; +import com.rmn.testrail.entity.TestInstance; +import com.rmn.testrail.entity.TestPlan; +import com.rmn.testrail.entity.TestResult; +import com.rmn.testrail.entity.TestRun; +import com.rmn.testrail.entity.TestSuite; import com.rmn.testrail.util.MockHTTPUtils; -import junit.framework.Assert; +import org.junit.Assert; import org.junit.Test; import java.io.BufferedReader; @@ -24,7 +32,7 @@ private TestRailService getTestRailsEntities(String fileName) { @Test public void testGetProjects() { - TestRailService service = getTestRailsEntities("Projects.json"); + TestRailService service = getTestRailsEntities("ProjectsPaged.json"); List projects = service.getProjects(); Assert.assertEquals("Sandbox", projects.get(0).getName()); } @@ -38,7 +46,7 @@ public void testGetTestSuites() { @Test public void testGetSections() { - TestRailService service = getTestRailsEntities("Sections.json"); + TestRailService service = getTestRailsEntities("SectionsPaged.json"); List
sections = service.getSections(0, 0); Assert.assertEquals("All Test Cases", sections.get(0).getName()); } @@ -47,27 +55,27 @@ public void testGetSections() { public void testGetTestCase() { TestRailService service = getTestRailsEntities("TestCase.json"); TestCase testCase = service.getTestCase(0); - Assert.assertEquals(new Integer(5), testCase.getCreatedBy()); - Assert.assertEquals(new Integer(1392300984), testCase.getCreatedOn()); + Assert.assertEquals(Integer.valueOf(5), testCase.getCreatedBy()); + Assert.assertEquals(Integer.valueOf(1392300984), testCase.getCreatedOn()); Assert.assertEquals("1m 5s", testCase.getEstimate()); - Assert.assertEquals(null, testCase.getEstimateForecast()); - Assert.assertEquals(new Integer(1), testCase.getId()); - Assert.assertEquals(new Integer(7), testCase.getMilestoneId()); - Assert.assertEquals(new Integer(2), testCase.getPriorityId()); + Assert.assertNull(testCase.getEstimateForecast()); + Assert.assertEquals(Integer.valueOf(1), testCase.getId()); + Assert.assertEquals(Integer.valueOf(7), testCase.getMilestoneId()); + Assert.assertEquals(Integer.valueOf(2), testCase.getPriorityId()); Assert.assertEquals("RF-1, RF-2", testCase.getRefs()); - Assert.assertEquals(new Integer(1), testCase.getSectionId()); - Assert.assertEquals(new Integer(1), testCase.getSuiteId()); + Assert.assertEquals(Integer.valueOf(1), testCase.getSectionId()); + Assert.assertEquals(Integer.valueOf(1), testCase.getSuiteId()); Assert.assertEquals("Change document attributes (author, title, organization)", testCase.getTitle()); - Assert.assertEquals(new Integer(4), testCase.getTypeId()); - Assert.assertEquals(new Integer(1), testCase.getUpdatedBy()); - Assert.assertEquals(new Integer(1393586511), testCase.getUpdatedOn()); - Assert.assertEquals(new Integer(1), testCase.getTemplateId()); + Assert.assertEquals(Integer.valueOf(4), testCase.getTypeId()); + Assert.assertEquals(Integer.valueOf(1), testCase.getUpdatedBy()); + Assert.assertEquals(Integer.valueOf(1393586511), testCase.getUpdatedOn()); + Assert.assertEquals(Integer.valueOf(1), testCase.getTemplateId()); } @Test public void testGetTestCases() { - TestRailService service = getTestRailsEntities("TestCases.json"); + TestRailService service = getTestRailsEntities("TestCasesPaged.json"); List testCases = service.getTestCases(0, 0); Assert.assertEquals("Test Case", testCases.get(0).getTitle()); Assert.assertEquals("Steve - First Test Case", testCases.get(1).getTitle()); @@ -105,18 +113,32 @@ public void testGetConfigurations() { @Test public void testGetTestRuns() { - TestRailService service = getTestRailsEntities("TestRuns.json"); + TestRailService service = getTestRailsEntities("TestRunsPaged.json"); List testRuns = service.getTestRuns(0); Assert.assertEquals("Test Suite", testRuns.get(0).getName()); } @Test public void testGetTestPlans() { - TestRailService service = getTestRailsEntities("TestPlans.json"); + TestRailService service = getTestRailsEntities("TestPlansPaged.json"); List testPlans = service.getTestPlans(0); Assert.assertEquals("Test Plan 2", testPlans.get(0).getName()); } + @Test + public void testGetTestResults() { + TestRailService service = getTestRailsEntities("TestResultsPaged.json"); + List testResults = service.getTestResults(0); + Assert.assertEquals(186187, (int) testResults.get(0).getId()); + } + + @Test + public void testGetTests() { + TestRailService service = getTestRailsEntities("TestInstancesPaged.json"); + List testResults = service.getTests(0); + Assert.assertEquals(6408, (int) testResults.get(0).getCaseId()); + } + /** * Returns the contents of the given file as a List of Strings * @param filename The name of the file to read. This file must be on the classpath at runtime diff --git a/src/test/resources/ProjectsPaged.json b/src/test/resources/ProjectsPaged.json new file mode 100644 index 0000000..45db867 --- /dev/null +++ b/src/test/resources/ProjectsPaged.json @@ -0,0 +1,61 @@ +{ + "offset": 0, + "limit": 250, + "size": 5, + "_links": { + "next": null, + "prev": null + }, + "projects": [ + { + "id": 3, + "name": "Sandbox", + "announcement": "Evaluate :: Test Run & Test Plan - multiple Test Suite", + "show_announcement": true, + "is_completed": false, + "completed_on": null, + "suite_mode": 3, + "url": "https://company_name.testrail.net/index.php?/projects/overview/3" + }, + { + "id": 10, + "name": "Name Project 10", + "announcement": "Sin City Gateway System", + "show_announcement": false, + "is_completed": false, + "completed_on": null, + "suite_mode": 3, + "url": "https://company_name.testrail.net/index.php?/projects/overview/10" + }, + { + "id": 11, + "name": "Name Project 11", + "announcement": "Sin City Gateway System", + "show_announcement": false, + "is_completed": false, + "completed_on": null, + "suite_mode": 3, + "url": "https://company_name.testrail.net/index.php?/projects/overview/11" + }, + { + "id": 12, + "name": "Name Project 12", + "announcement": null, + "show_announcement": false, + "is_completed": false, + "completed_on": null, + "suite_mode": 3, + "url": "https://company_name.testrail.net/index.php?/projects/overview/12" + }, + { + "id": 43, + "name": "SName Project 43", + "announcement": null, + "show_announcement": false, + "is_completed": false, + "completed_on": null, + "suite_mode": 3, + "url": "https://company_name.testrail.net/index.php?/projects/overview/43" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/SectionsPaged.json b/src/test/resources/SectionsPaged.json new file mode 100644 index 0000000..ed81886 --- /dev/null +++ b/src/test/resources/SectionsPaged.json @@ -0,0 +1,56 @@ +{ + "offset": 0, + "limit": 250, + "size": 5, + "_links": { + "next": null, + "prev": null + }, + "sections": [ + { + "id": 63892, + "suite_id": 3398, + "name": "All Test Cases", + "description": null, + "parent_id": null, + "display_order": 1, + "depth": 0 + }, + { + "id": 146508, + "suite_id": 3398, + "name": "Error Handling", + "description": null, + "parent_id": 63892, + "display_order": 2, + "depth": 1 + }, + { + "id": 88174, + "suite_id": 3398, + "name": "Management", + "description": null, + "parent_id": null, + "display_order": 5, + "depth": 0 + }, + { + "id": 88175, + "suite_id": 3398, + "name": "Logging", + "description": null, + "parent_id": 88174, + "display_order": 6, + "depth": 1 + }, + { + "id": 88178, + "suite_id": 3398, + "name": "Config", + "description": null, + "parent_id": 88174, + "display_order": 10, + "depth": 1 + } + ] +} \ No newline at end of file diff --git a/src/test/resources/TestCasesPaged.json b/src/test/resources/TestCasesPaged.json new file mode 100644 index 0000000..f454c89 --- /dev/null +++ b/src/test/resources/TestCasesPaged.json @@ -0,0 +1,51 @@ +{ + "offset": 0, + "limit": 250, + "size": 2, + "_links": { + "next": null, + "prev": null + }, + "cases": [ + { + "id": 1241, + "title": "Test Case", + "section_id": 302, + "type_id": 4, + "priority_id": 6, + "milestone_id": null, + "refs": null, + "created_by": 1, + "created_on": 1357864553, + "estimate": null, + "estimate_forecast": "22s", + "suite_id": 17, + "custom_automation_priority": 1, + "custom_notes": null, + "custom_steps_separated": [{ + "content": "This is a test step", + "expected": "This is a test result" + }] + }, + { + "id": 1243, + "title": "Steve - First Test Case", + "section_id": 302, + "type_id": 4, + "priority_id": 6, + "milestone_id": null, + "refs": null, + "created_by": 8, + "created_on": 1358190068, + "estimate": null, + "estimate_forecast": null, + "suite_id": 17, + "custom_automation_priority": 1, + "custom_notes": null, + "custom_steps_separated": [{ + "content": "1. Step1\n1. Step2\n1. Step3", + "expected": "Expected Results 1" + }] + } + ] +} \ No newline at end of file diff --git a/src/test/resources/TestInstancesPaged.json b/src/test/resources/TestInstancesPaged.json new file mode 100644 index 0000000..6e14f61 --- /dev/null +++ b/src/test/resources/TestInstancesPaged.json @@ -0,0 +1,41 @@ +{ + "offset": 0, + "limit": 250, + "size": 2, + "_links": { + "next": null, + "prev": null + }, + "tests": [ + { + "id": 51899, + "case_id": 6408, + "status_id": 1, + "assignedto_id": 10, + "run_id": 1239, + "title": "Home Page - Universal Tags", + "type_id": 1, + "priority_id": 6, + "estimate": null, + "estimate_forecast": "13s", + "custom_automation_priority": null, + "custom_notes": null, + "custom_steps_separated": null + }, + { + "id": 51900, + "case_id": 6409, + "status_id": 3, + "assignedto_id": null, + "run_id": 1239, + "title": "Store Page - Universal Tags", + "type_id": 1, + "priority_id": 6, + "estimate": null, + "estimate_forecast": "27s", + "custom_automation_priority": null, + "custom_notes": null, + "custom_steps_separated": null + } + ] +} diff --git a/src/test/resources/TestPlansPaged.json b/src/test/resources/TestPlansPaged.json new file mode 100644 index 0000000..b2e97c8 --- /dev/null +++ b/src/test/resources/TestPlansPaged.json @@ -0,0 +1,61 @@ +{ + "offset": 0, + "limit": 250, + "size": 2, + "_links": { + "next": null, + "prev": null + }, + "plans": [ + { + "id": 112233, + "name": "Test Plan 2", + "description": null, + "milestone_id": 456, + "assignedto_id": null, + "is_completed": false, + "completed_on": null, + "passed_count": 0, + "blocked_count": 0, + "untested_count": 64, + "retest_count": 0, + "failed_count": 0, + "custom_status1_count": 0, + "custom_status2_count": 0, + "custom_status3_count": 0, + "custom_status4_count": 0, + "custom_status5_count": 0, + "custom_status6_count": 0, + "custom_status7_count": 0, + "project_id": 3, + "created_on": 1533826280, + "created_by": 1, + "url": "https://coname.testrail.net/index.php?/plans/view/112233" + }, + { + "id": 1234, + "name": "Test Plan 1234", + "description": null, + "milestone_id": 456, + "assignedto_id": null, + "is_completed": false, + "completed_on": null, + "passed_count": 2, + "blocked_count": 0, + "untested_count": 63, + "retest_count": 0, + "failed_count": 1, + "custom_status1_count": 0, + "custom_status2_count": 0, + "custom_status3_count": 0, + "custom_status4_count": 0, + "custom_status5_count": 0, + "custom_status6_count": 0, + "custom_status7_count": 0, + "project_id": 3, + "created_on": 1492011469, + "created_by": 7, + "url": "https://coname.testrail.net/index.php?/plans/view/1234" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/TestResultsPaged.json b/src/test/resources/TestResultsPaged.json new file mode 100644 index 0000000..b75bb5b --- /dev/null +++ b/src/test/resources/TestResultsPaged.json @@ -0,0 +1,37 @@ +{ + "offset": 0, + "limit": 250, + "size": 2, + "_links": { + "next": null, + "prev": null + }, + "results": [ + { + "id": 186187, + "test_id": 51899, + "status_id": 1, + "created_by": 10, + "created_on": 1382800478, + "assignedto_id": 10, + "comment": "It worked!!", + "version": null, + "elapsed": null, + "defects": null, + "custom_step_results": null + }, + { + "id": 186186, + "test_id": 51899, + "status_id": 1, + "created_by": 10, + "created_on": 1382800307, + "assignedto_id": 10, + "comment": "It worked!!", + "version": null, + "elapsed": null, + "defects": null, + "custom_step_results": null + } + ] +} diff --git a/src/test/resources/TestRunsPaged.json b/src/test/resources/TestRunsPaged.json new file mode 100644 index 0000000..506806e --- /dev/null +++ b/src/test/resources/TestRunsPaged.json @@ -0,0 +1,51 @@ +{ + "offset": 0, + "limit": 250, + "size": 2, + "_links": { + "next": null, + "prev": null + }, + "runs": [ + { + "id": 15, + "suite_id": 17, + "name": "Test Suite", + "description": null, + "milestone_id": null, + "assignedto_id": null, + "include_all": false, + "is_completed": false, + "completed_on": null, + "config": null, + "passed_count": 1, + "blocked_count": 0, + "untested_count": 0, + "retest_count": 0, + "failed_count": 0, + "project_id": 2, + "plan_id": null, + "url": "https://rmn.testrail.com/index.php?/runs/view/15" + }, + { + "id": 17, + "suite_id": 17, + "name": "MM Test Run", + "description": null, + "milestone_id": null, + "assignedto_id": 2, + "include_all": true, + "is_completed": false, + "completed_on": null, + "config": null, + "passed_count": 0, + "blocked_count": 0, + "untested_count": 2, + "retest_count": 0, + "failed_count": 0, + "project_id": 2, + "plan_id": null, + "url": "https://rmn.testrail.com/index.php?/runs/view/17" + } + ] +} \ No newline at end of file From 709ae11410406a067d2ade910eac2df2be37b5c9 Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Wed, 10 Feb 2021 15:12:29 -0800 Subject: [PATCH 7/9] [maven-release-plugin] prepare release testrailsdk-1.3.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 307d698..fa8dc0b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.mgage testrailsdk - 1.3.5-SNAPSHOT + 1.3.5 jar ${project.groupId}:${project.artifactId} From 9cd0b1b25dac344223f7eb17e36234e06b6ceebd Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Wed, 10 Feb 2021 15:12:46 -0800 Subject: [PATCH 8/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa8dc0b..a25ad1e 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.mgage testrailsdk - 1.3.5 + 1.3.6-SNAPSHOT jar ${project.groupId}:${project.artifactId} From e043ccc324fb7a402c064380f5e357d330e1c670 Mon Sep 17 00:00:00 2001 From: boris <20168477+BorisMGage@users.noreply.github.com> Date: Thu, 11 Mar 2021 13:24:54 -0800 Subject: [PATCH 9/9] Support deployment --- README.md | 8 ++++---- pom.xml | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a1541bc..93d8444 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ Download the source, then from the command-line, run the `mvn install` command. Once the jar has been deployed, you should be able to include a small snippet in your pom file: - com.mgage + com.retailmenot testrailsdk - 1.3.4.1 + 1.3.1 If you're currently using Maven, and your repos, paths, and IDE are all set up correctly, you should be able to address the classes in this project immediately. @@ -28,9 +28,9 @@ To point to the jar file in Maven Central, include this xml snippet in your pom. ```xml - com.mgage + com.retailmenot testrailsdk - 1.3.4.1 + 1.3.1 ``` diff --git a/pom.xml b/pom.xml index a25ad1e..fa3a51f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,14 +1,14 @@ - 4.0.0 + 4.0.0 - com.mgage - testrailsdk - 1.3.6-SNAPSHOT + com.retailmenot + testrailsdk + 1.3.2 jar ${project.groupId}:${project.artifactId} A package for managing your TestRail information - https://github.com/mGageTechOps/TestRailSDK + https://github.com/RetailMeNot/TestRailSDK UTF-8 @@ -38,10 +38,10 @@ - scm:git:git@github.com:mGageTechOps/TestRailSDK.git - scm:git:git@github.com:mGageTechOps/TestRailSDK.git - scm:git:git@github.com:mGageTechOps/TestRailSDK.git - testrailsdk-1.3.5 + scm:git:git@github.com:RetailMeNot/TestRailSDK.git + scm:git:git@github.com:RetailMeNot/TestRailSDK.git + scm:git:git@github.com:RetailMeNot/TestRailSDK.git + testrailsdk-1.1