From 6a5e54defba422bcac527078c6846979faaba3f3 Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Tue, 20 Feb 2024 13:30:58 +0300 Subject: [PATCH 1/3] EPMRPP-89261 || Migrate to springDoc (#372) --- build.gradle | 10 +++++----- gradle.properties | 2 +- .../reportportal/ws/model/ActivityResource.java | 17 +++++++++-------- .../ws/model/FinishExecutionRQ.java | 7 ++++--- .../reportportal/ws/model/FinishTestItemRQ.java | 5 +++-- .../epam/ta/reportportal/ws/model/StartRQ.java | 9 +++++---- .../reportportal/ws/model/StartTestItemRQ.java | 6 +++--- .../ws/model/attribute/ItemAttributesRQ.java | 4 ++-- .../ws/model/integration/auth/SamlResource.java | 4 ++-- .../ws/model/launch/StartLaunchRQ.java | 4 ++-- .../ta/reportportal/ws/model/log/SaveLogRQ.java | 11 ++++++----- .../ws/model/project/AnalyzerConfig.java | 8 ++++---- .../settings/OAuthRegistrationResource.java | 3 +++ 13 files changed, 49 insertions(+), 41 deletions(-) diff --git a/build.gradle b/build.gradle index fe597305..a815a2d9 100644 --- a/build.gradle +++ b/build.gradle @@ -41,11 +41,11 @@ wrapper { } dependencies { - compile "io.swagger:swagger-annotations:${swaggerAnnotationsVersion}" - compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" - compile "javax.validation:validation-api:${validationApiVersion}" - compile "org.apache.commons:commons-lang3:${commonsLangVersion}" - compile group: 'com.google.guava', name: 'guava', version: '28.2-jre' + implementation "org.springdoc:springdoc-openapi-data-rest:${sprindocAnnotationsVersion}" + implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" + implementation "javax.validation:validation-api:${validationApiVersion}" + implementation "org.apache.commons:commons-lang3:${commonsLangVersion}" + implementation group: 'com.google.guava', name: 'guava', version: '28.2-jre' // add lombok support compileOnly "org.projectlombok:lombok:${lombokVersion}" diff --git a/gradle.properties b/gradle.properties index 54f4a148..e40e9de4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ hibernateValidatorVersion=6.1.2.Final validationApiVersion=2.0.1.Final junitVersion=4.12 elApiVersion=3.0.0 -swaggerAnnotationsVersion=1.6.0 +sprindocAnnotationsVersion=1.7.0 commonsLangVersion=3.9 mockitoJunitJupiter=2.23.0 jacksonVersion=2.10.2 diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java index b2aee9cc..5de5b47c 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java @@ -19,7 +19,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import java.util.Date; import javax.validation.constraints.NotNull; @@ -33,37 +34,37 @@ public class ActivityResource { @NotNull @JsonProperty(value = "id", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Long id; @NotNull @JsonProperty(value = "user", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String user; @NotNull @JsonProperty(value = "loggedObjectId", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Long loggedObjectId; @NotNull @JsonProperty(value = "lastModified", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date lastModified; @NotNull @JsonProperty(value = "actionType", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String actionType; @NotNull @JsonProperty(value = "objectType", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String objectType; @NotNull @JsonProperty(value = "projectId", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Long projectId; @JsonProperty(value = "projectName") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java index 40478e77..5c9b6ee5 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java @@ -22,8 +22,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -44,12 +45,12 @@ public class FinishExecutionRQ { @NotNull @JsonProperty(value = "endTime", required = true) @JsonAlias({ "endTime", "end_time" }) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date endTime; @JsonProperty(value = "status") @In(allowedValues = { "passed", "failed", "stopped", "skipped", "interrupted", "cancelled", "info", "warn" }) - @ApiModelProperty(allowableValues = "PASSED, FAILED, STOPPED, SKIPPED, INTERRUPTED, CANCELLED, INFO, WARN") + @Schema(allowableValues = "PASSED, FAILED, STOPPED, SKIPPED, INTERRUPTED, CANCELLED, INFO, WARN") private String status; @JsonProperty(value = "description") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java index 6df53469..3395489f 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java @@ -20,8 +20,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.Valid; @JsonInclude(Include.NON_NULL) @@ -35,7 +36,7 @@ public class FinishTestItemRQ extends FinishExecutionRQ { private Boolean retry; @JsonProperty(value = "launchUuid") - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String launchUuid; @JsonProperty(value = "testCaseId") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java index 992ae3e5..d78f5962 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java @@ -21,8 +21,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -40,7 +41,7 @@ public class StartRQ { @JsonProperty(value = "name", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) protected String name; @JsonProperty(value = "description") @@ -55,10 +56,10 @@ public class StartRQ { @NotNull @JsonProperty(required = true) @JsonAlias({ "startTime", "start_time" }) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date startTime; - @ApiModelProperty(hidden = true) + @Schema(hidden = true) @JsonProperty(value = "uuid") private String uuid; diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java index 6828ee9c..d9c7398e 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java @@ -28,8 +28,8 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -58,7 +58,7 @@ public class StartTestItemRQ extends StartRQ { @NotNull @JsonAlias({ "launchUuid", "launch_id" }) - @ApiModelProperty(value = "UUID of parent launch", required = true) + @Schema(description = "UUID of parent launch", required = true) private String launchUuid; @NotNull @@ -67,7 +67,7 @@ public class StartTestItemRQ extends StartRQ { @JsonDeserialize(using = UpperCaseTypeDeserializer.class) @In(allowedValues = { "suite", "story", "test", "scenario", "step", "before_class", "before_groups", "before_method", "before_suite", "before_test", "after_class", "after_groups", "after_method", "after_suite", "after_test" }) - @ApiModelProperty(required = true, allowableValues = "SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS," + @Schema(required = true, allowableValues = "SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS," + "BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS, AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST") private String type; diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java index a00d483f..1d450c9a 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java @@ -16,7 +16,7 @@ package com.epam.ta.reportportal.ws.model.attribute; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serializable; /** @@ -24,7 +24,7 @@ */ public class ItemAttributesRQ extends ItemAttributeResource implements Serializable { - @ApiModelProperty(example = "false") + @Schema(example = "false") private boolean system; public ItemAttributesRQ() { diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java index 9a80df69..205130b5 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlResource.java @@ -18,15 +18,15 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.NotEmpty; /** * @author Ihar Kahadouski */ -@ApiModel +@Schema @JsonInclude(JsonInclude.Include.NON_NULL) public class SamlResource extends AbstractAuthResource { diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java index fd97a1e2..5fcac188 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; @JsonInclude(Include.NON_NULL) public class StartLaunchRQ extends StartRQ { @@ -34,7 +34,7 @@ public class StartLaunchRQ extends StartRQ { private boolean rerun; @JsonProperty("rerunOf") - @ApiModelProperty(value = "UUID of desired launch to rerun") + @Schema(description = "UUID of desired launch to rerun") private String rerunOf; @Override diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java index e2d50c0e..a31b53fb 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java @@ -21,8 +21,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import javax.validation.constraints.NotNull; import java.util.Arrays; import java.util.Date; @@ -38,23 +39,23 @@ public class SaveLogRQ { private String uuid; @JsonAlias({ "itemUuid", "item_id" }) - @ApiModelProperty(value = "UUID of test item owned this log") + @Schema(description = "UUID of test item owned this log") private String itemUuid; @JsonProperty(value = "launchUuid") - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private String launchUuid; @NotNull @JsonProperty(value = "time", required = true) - @ApiModelProperty(required = true) + @Schema(requiredMode = RequiredMode.REQUIRED) private Date logTime; @JsonProperty(value = "message") private String message; @JsonProperty(value = "level") - @ApiModelProperty(allowableValues = "error, warn, info, debug, trace, fatal, unknown") + @Schema(allowableValues = "error, warn, info, debug, trace, fatal, unknown") private String level; @JsonProperty(value = "file") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java b/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java index 4f1314ac..69bbc5b8 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/project/AnalyzerConfig.java @@ -19,9 +19,8 @@ import com.epam.ta.reportportal.ws.annotations.In; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.Max; import javax.validation.constraints.Min; @@ -31,6 +30,7 @@ * @author Pavel Bortnik */ @JsonInclude(JsonInclude.Include.NON_NULL) +@Schema public class AnalyzerConfig { @Min(value = MIN_SHOULD_MATCH) @@ -52,11 +52,11 @@ public class AnalyzerConfig { @JsonProperty(value = "analyzerMode") @In(allowedValues = { "all", "launch_name", "current_launch", "previous_launch", "current_and_the_same_name" }) - @ApiModelProperty(allowableValues = "ALL, LAUNCH_NAME, CURRENT_LAUNCH, PREVIOUS_LAUNCH, CURRENT_AND_THE_SAME_NAME") + @Schema(allowableValues = "ALL, LAUNCH_NAME, CURRENT_LAUNCH, PREVIOUS_LAUNCH, CURRENT_AND_THE_SAME_NAME") private String analyzerMode; @JsonProperty(value = "indexingRunning") - @ApiParam(hidden = true) + @Schema(hidden = true) private boolean indexingRunning; @JsonProperty(value = "allMessagesShouldMatch") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java index 8792d99a..e2e10682 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/settings/OAuthRegistrationResource.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import java.io.Serializable; @@ -56,10 +57,12 @@ public class OAuthRegistrationResource implements Serializable { @Pattern(regexp = URL_PATTERN) @JsonProperty(value = "authorizationUri") + @Schema(type = "string", pattern = URL_PATTERN, example = "string") private String authorizationUri; @Pattern(regexp = URL_PATTERN) @JsonProperty(value = "tokenUri") + @Schema(type = "string", pattern = URL_PATTERN, example = "string") private String tokenUri; @JsonProperty(value = "userInfoEndpointUri") From 41e9fdbb6c8c77776d87c888d75643132d349ce3 Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Tue, 27 Feb 2024 19:13:08 +0300 Subject: [PATCH 2/3] EPMRPP-89384 || Move reporting model to the separate repo (#373) * EPMRPP-89384 || Move reporting classes to a separate directory * EPMRPP-89384 || Add project settings resource for reporting lib * EPMRPP-89384 || Move more model to reporting modul * EPMRPP-89384 || Move more model classes to reporting module * EPMRPP-89384 || Move model to the separate reporting lib --------- Co-authored-by: Pavel Bortnik --- .../ta/reportportal/ws/annotations/In.java | 6 +- .../ws/annotations/InCollectionValidator.java | 6 +- .../ws/annotations/NotBlankString.java | 6 +- .../annotations/NotBlankStringCollection.java | 6 +- .../NotBlankStringCollectionValidator.java | 2 +- .../ws/annotations/NotBlankWithSize.java | 15 +- .../ws/annotations/NotNullMapValue.java | 2 +- .../annotations/NotNullMapValueValidator.java | 2 +- .../ws/model/BatchElementCreatedRS.java | 74 --- .../ws/model/BatchSaveOperatingRS.java | 61 --- .../ws/model/BulkInfoUpdateRQ.java | 3 +- .../ta/reportportal/ws/model/Constants.java | 36 -- .../ws/model/EntryCreatedAsyncRS.java | 51 -- .../ta/reportportal/ws/model/ErrorRS.java | 146 ----- .../ta/reportportal/ws/model/ErrorType.java | 514 ------------------ .../ws/model/FinishExecutionRQ.java | 107 ---- .../ws/model/FinishTestItemRQ.java | 99 ---- .../ws/model/OperationCompletionRS.java | 58 -- .../reportportal/ws/model/OwnedResource.java | 67 --- .../ws/model/ParameterResource.java | 78 --- .../ta/reportportal/ws/model/StartRQ.java | 148 ----- .../ws/model/StartTestItemRQ.java | 212 -------- .../ws/model/analyzer/IndexLaunch.java | 1 - .../ws/model/analyzer/IndexLog.java | 1 - .../ws/model/analyzer/IndexTestItem.java | 1 - .../attribute/ItemAttributeResource.java | 128 +++-- .../ws/model/attribute/ItemAttributesRQ.java | 82 --- .../attribute/UpdateItemAttributeRQ.java | 47 +- .../ws/model/externalsystem/AllowedValue.java | 1 - .../ws/model/externalsystem/Authentic.java | 117 ++-- .../ws/model/externalsystem/PostTicketRQ.java | 5 +- .../ws/model/externalsystem/Ticket.java | 1 - .../auth/AbstractAuthResource.java | 1 - .../auth/AbstractLdapResource.java | 1 - .../integration/auth/LdapAttributes.java | 3 +- .../auth/SamlProvidersResource.java | 3 +- .../SynchronizationAttributesResource.java | 3 +- .../model/integration/auth/UpdateAuthRQ.java | 3 +- .../ta/reportportal/ws/model/issue/Issue.java | 211 ------- .../ws/model/item/ItemCreatedRS.java | 48 -- .../ws/model/item/ItemPathName.java | 59 -- .../ws/model/item/LaunchPathName.java | 59 -- .../ws/model/item/PathNameResource.java | 60 -- .../ws/model/launch/LaunchResource.java | 267 --------- .../ta/reportportal/ws/model/launch/Mode.java | 36 -- .../ws/model/launch/StartLaunchRQ.java | 111 ---- .../ws/model/launch/StartLaunchRS.java | 47 -- .../launch/cluster/ClusterInfoResource.java | 1 - .../launch/cluster/CreateClustersRQ.java | 1 - .../reportportal/ws/model/log/SaveLogRQ.java | 180 ------ .../model/statistics/StatisticsResource.java | 58 -- .../validation/NotBlankWithSizeValidator.java | 3 +- .../ws/model/ErrorSerializationTest.java | 64 --- .../reportportal/ws/model/ErrorTypeTest.java | 38 -- .../model/FinishTestItemSerializerTest.java | 70 --- .../ws/model/StartLaunchSerializerTest.java | 45 -- .../ws/model/StartTestItemSerializerTest.java | 65 --- 57 files changed, 179 insertions(+), 3341 deletions(-) delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/BatchElementCreatedRS.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/BatchSaveOperatingRS.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/Constants.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/EntryCreatedAsyncRS.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/ErrorRS.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/ErrorType.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/OperationCompletionRS.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/OwnedResource.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/ParameterResource.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/issue/Issue.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/item/ItemCreatedRS.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/item/ItemPathName.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/item/LaunchPathName.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/item/PathNameResource.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchResource.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/launch/Mode.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRS.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/statistics/StatisticsResource.java delete mode 100644 src/test/java/com/epam/ta/reportportal/ws/model/ErrorSerializationTest.java delete mode 100644 src/test/java/com/epam/ta/reportportal/ws/model/ErrorTypeTest.java delete mode 100644 src/test/java/com/epam/ta/reportportal/ws/model/FinishTestItemSerializerTest.java delete mode 100644 src/test/java/com/epam/ta/reportportal/ws/model/StartLaunchSerializerTest.java delete mode 100644 src/test/java/com/epam/ta/reportportal/ws/model/StartTestItemSerializerTest.java diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/In.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/In.java index f3f74e82..dbb47e1a 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/In.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/In.java @@ -16,8 +16,12 @@ package com.epam.ta.reportportal.ws.annotations; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import javax.validation.Constraint; -import java.lang.annotation.*; /** * Can be used with strings. diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/InCollectionValidator.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/InCollectionValidator.java index 7cd9e0bc..9d34274a 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/InCollectionValidator.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/InCollectionValidator.java @@ -16,12 +16,12 @@ package com.epam.ta.reportportal.ws.annotations; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; /** * @author Ihar Kahadouski @@ -40,7 +40,7 @@ public void initialize(In constraintAnnotation) { @Override public boolean isValid(Collection value, ConstraintValidatorContext context) { - List upperCaseList = new ArrayList(); + List upperCaseList = new ArrayList<>(); for (String next : value) { upperCaseList.add(next.toUpperCase()); } diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankString.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankString.java index 6eb77c21..15b8d25c 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankString.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankString.java @@ -16,8 +16,12 @@ package com.epam.ta.reportportal.ws.annotations; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import javax.validation.Constraint; -import java.lang.annotation.*; /** * Can be used with strings. diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollection.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollection.java index 895f6828..e76674b1 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollection.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollection.java @@ -16,8 +16,12 @@ package com.epam.ta.reportportal.ws.annotations; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import javax.validation.Constraint; -import java.lang.annotation.*; /** * Can be used with collection of strings. diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollectionValidator.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollectionValidator.java index d067f02f..cd2ac473 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollectionValidator.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankStringCollectionValidator.java @@ -16,9 +16,9 @@ package com.epam.ta.reportportal.ws.annotations; +import java.util.Collection; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; -import java.util.Collection; /** * @author Ihar Kahadouski diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankWithSize.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankWithSize.java index e6e16679..bd16967e 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankWithSize.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotBlankWithSize.java @@ -16,19 +16,18 @@ package com.epam.ta.reportportal.ws.annotations; -import com.epam.ta.reportportal.ws.model.validation.NotBlankWithSizeValidator; - -import javax.validation.Constraint; -import javax.validation.Payload; -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import static org.apache.commons.lang3.StringUtils.EMPTY; +import com.epam.ta.reportportal.ws.model.validation.NotBlankWithSizeValidator; +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import javax.validation.Constraint; +import javax.validation.Payload; + /** * @author Tatyana Gladysheva */ diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValue.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValue.java index 814b3904..f83764c9 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValue.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValue.java @@ -16,11 +16,11 @@ package com.epam.ta.reportportal.ws.annotations; -import javax.validation.Constraint; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import javax.validation.Constraint; @Constraint(validatedBy = { NotNullMapValueValidator.class }) @Target({ ElementType.FIELD }) diff --git a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValueValidator.java b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValueValidator.java index b1d6f69e..8b80dec0 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValueValidator.java +++ b/src/main/java/com/epam/ta/reportportal/ws/annotations/NotNullMapValueValidator.java @@ -16,9 +16,9 @@ package com.epam.ta.reportportal.ws.annotations; +import java.util.Map; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; -import java.util.Map; public class NotNullMapValueValidator implements ConstraintValidator> { diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/BatchElementCreatedRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/BatchElementCreatedRS.java deleted file mode 100644 index 4492d0c1..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/BatchElementCreatedRS.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Element of response for batch save operation. - * - * @author Aliaksei_Makayed - */ -@JsonInclude(Include.NON_NULL) -public class BatchElementCreatedRS extends EntryCreatedAsyncRS { - - @JsonProperty("message") - private String message; - - @JsonProperty("stackTrace") - private String stackTrace; - - public BatchElementCreatedRS() { - - } - - public BatchElementCreatedRS(String id) { - super.setId(id); - } - - public BatchElementCreatedRS(String stackTrace, String message) { - setMessage(message); - setStackTrace(stackTrace); - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getStackTrace() { - return stackTrace; - } - - public void setStackTrace(String stackTrace) { - this.stackTrace = stackTrace; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("BatchElementCreatedRS{"); - sb.append("message='").append(message).append('\''); - sb.append(", stackTrace='").append(stackTrace).append('\''); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/BatchSaveOperatingRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/BatchSaveOperatingRS.java deleted file mode 100644 index 62e160a1..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/BatchSaveOperatingRS.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -/** - * Response with results of completion save batch operation. - * - * @author Aliaksei_Makayed - * - */ -@JsonInclude(Include.NON_NULL) -public class BatchSaveOperatingRS { - - @JsonProperty("responses") - List responses; - - public BatchSaveOperatingRS() { - responses = new ArrayList(); - } - - public List getResponses() { - return responses; - } - - public void addResponse(BatchElementCreatedRS elementCreatedRS) { - responses.add(elementCreatedRS); - } - - public void setResponses(List responses) { - this.responses = responses; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("BatchSaveOperatingRS{"); - sb.append("responses=").append(responses); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java index 6a18cc36..8504fc97 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java @@ -17,11 +17,10 @@ package com.epam.ta.reportportal.ws.model; import com.epam.ta.reportportal.ws.model.attribute.UpdateItemAttributeRQ; - +import java.util.List; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -import java.util.List; /** * @author Ihar Kahadouski diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/Constants.java b/src/main/java/com/epam/ta/reportportal/ws/model/Constants.java deleted file mode 100644 index dc159ca5..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/Constants.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -/** - * Set of Constant values related to Report Portal requests/responses - * - * @author Andrei Varabyeu - * - */ -public interface Constants { - - /** - * Save Log Request part with json data - */ - String LOG_REQUEST_JSON_PART = "json_request_part"; - - /** - * Save Log Request binary part - */ - String LOG_REQUEST_BINARY_PART = "binary_part"; -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/EntryCreatedAsyncRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/EntryCreatedAsyncRS.java deleted file mode 100644 index 71b392e7..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/EntryCreatedAsyncRS.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.annotation.JsonInclude; - -/** - * @author Konstantin Antipin - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class EntryCreatedAsyncRS { - - private String id; - - public EntryCreatedAsyncRS() { - } - - public EntryCreatedAsyncRS(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("EntryCreatedAsyncRS{"); - sb.append("id='").append(id).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/ErrorRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/ErrorRS.java deleted file mode 100644 index d876308c..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ErrorRS.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.ObjectCodec; -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; - -import java.io.IOException; -import java.io.Serializable; - -/** - * Base Error response body for all Report Portal exceptions - * - * @author Andrei Varabyeu - * - */ -@JsonPropertyOrder({ "errorCode", "message", "stackTrace" }) -@JsonInclude(Include.NON_NULL) -public class ErrorRS implements Serializable { - /** - * Generated SVUID - */ - private static final long serialVersionUID = -3717290684860161862L; - - @JsonSerialize(using = ErrorTypeSerializer.class) - @JsonDeserialize(using = ErrorTypeDeserializer.class) - @JsonProperty("errorCode") - private ErrorType errorType; - - @JsonProperty("stackTrace") - private String stackTrace; - - @JsonProperty("message") - private String message; - - public ErrorType getErrorType() { - return errorType; - } - - public void setErrorType(ErrorType errorType) { - this.errorType = errorType; - } - - public String getStackTrace() { - return stackTrace; - } - - public void setStackTrace(String stackTrace) { - this.stackTrace = stackTrace; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((errorType == null) ? 0 : errorType.hashCode()); - result = prime * result + ((message == null) ? 0 : message.hashCode()); - result = prime * result + ((stackTrace == null) ? 0 : stackTrace.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - ErrorRS other = (ErrorRS) obj; - if (errorType != other.errorType) - return false; - if (message == null) { - if (other.message != null) - return false; - } else if (!message.equals(other.message)) - return false; - if (stackTrace == null) { - if (other.stackTrace != null) - return false; - } else if (!stackTrace.equals(other.stackTrace)) - return false; - return true; - } - - private static class ErrorTypeDeserializer extends JsonDeserializer { - - @Override - public ErrorType deserialize(JsonParser parser, DeserializationContext context) throws IOException { - ObjectCodec oc = parser.getCodec(); - JsonNode node = oc.readTree(parser); - return ErrorType.getByCode(node.asInt()); - - } - - } - - private static class ErrorTypeSerializer extends JsonSerializer { - - @Override - public void serialize(ErrorType error, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { - jsonGenerator.writeNumber(error.getCode()); - } - - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("ErrorRS{"); - sb.append("errorType=").append(errorType); - sb.append(", stackTrace='").append(stackTrace).append('\''); - sb.append(", message='").append(message).append('\''); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/ErrorType.java b/src/main/java/com/epam/ta/reportportal/ws/model/ErrorType.java deleted file mode 100644 index 09d024d5..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ErrorType.java +++ /dev/null @@ -1,514 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -/** - * Report Portal's exception list - * - * @author Andrei Varabyeu - */ -public enum ErrorType { - - /** - * Incorrect Report Portal WS Request - */ - INCORRECT_REQUEST(4001, "Incorrect Request. {}"), - - /** - * Incorrect Report Portal WS Request - */ - BINARY_DATA_CANNOT_BE_SAVED(4002, "Binary data cannot be saved. {}"), - - /** - * Access Denied - */ - ACCESS_DENIED(4003, "You do not have enough permissions. {}"), - - /** - * Access Denied - */ - ADDRESS_LOCKED(4004, "Address is locked due to several incorrect login attempts"), - - /** - * If specified by id Project or by ProjectName not found - */ - PROJECT_NOT_FOUND(4040, "Project '{}' not found. Did you use correct project name?"), - - /** - * If specified by id Launch not found - */ - LAUNCH_NOT_FOUND(4041, "Launch '{}' not found. Did you use correct Launch ID?"), - - /** - * If specified by id TestSuite not found - */ - TEST_SUITE_NOT_FOUND(4042, "TestSuite Not Found. Did you use correct TestSuite ID?"), - - /** - * If specified by id Test not found - */ - TEST_ITEM_NOT_FOUND(4043, "Test Item '{}' not found. Did you use correct Test Item ID?"), - - /** - * If specified by id Log not found - */ - LOG_NOT_FOUND(4044, "Log '{}' not found. Did you use correct Log ID?"), - - /** - * If specified by id role not found - */ - ROLE_NOT_FOUND(4045, "Project role '{}' not found. Did you use correct Role Name?"), - - /** - * If specified by login User not found - */ - USER_NOT_FOUND(4046, "User '{}' not found. {}"), - - /** - * If specified by id Widget not found - */ - WIDGET_NOT_FOUND(4047, "Widget with ID '{}' not found. Did you use correct Widget ID?"), - - /** - * If specified by id Widget not found - */ - WIDGET_NOT_FOUND_IN_DASHBOARD(4048, "Widget with ID '{}' not found in dashboard '{}'. Did you use correct Widget ID?"), - - /** - * If specified by id Dashboard not found - */ - DASHBOARD_NOT_FOUND(4049, "Dashboard with ID '{}' not found. Did you use correct Dashboard ID?"), - - /** - * If specified by id UserFilter not found - */ - USER_FILTER_NOT_FOUND(40410, - "User filter with ID '{}' is not found on project '{}' for user '{}'. Did you use correct User Filter ID?" - ), - - /** - * If specified by id Activity not found - */ - ACTIVITY_NOT_FOUND(40411, "Activity '{}' not found. Did you use correct Activity ID?"), - - /** - * Unable to create widget based on favorite link - */ - UNABLE_TO_CREATE_WIDGET(40412, "Unable to create or update widget. {}"), - - /** - * Integration not found - */ - INTEGRATION_NOT_FOUND(40413, "Integration with ID '{}' not found. Did you use correct ID?"), - - /** - * If project not configured - */ - PROJECT_NOT_CONFIGURED(40414, "Project '{}' not configured."), - - /** - * If server settings for specified profile not found - */ - SERVER_SETTINGS_NOT_FOUND(40415, "Server Settings with '{}' profile not found."), - - /** - * If issue type not found (including custom project specific sub-types) - */ - ISSUE_TYPE_NOT_FOUND(40416, "Issue Type '{}' not found."), - - /** - * If project settings for specified project not found - */ - PROJECT_SETTINGS_NOT_FOUND(40417, "Project Settings for project '{}' not found."), - - /** - * Ticket not found - */ - TICKET_NOT_FOUND(40418, "Ticket with ID '{}' not found. Did you use correct Ticket ID?"), - - /** - * If specified Authentication extension isn't found - */ - AUTH_INTEGRATION_NOT_FOUND(40419, "Auth integration '{}' not found. Did you use correct name?"), - - /** - * If specified by id Widget not found - */ - WIDGET_NOT_FOUND_IN_PROJECT(40420, "Widget with ID '{}' not found on project '{}'. Did you use correct Widget ID?"), - - /** - * If specified by id UserFilter not found - */ - USER_FILTER_NOT_FOUND_IN_PROJECT(40421, "User filter with ID '{}' not found on project '{}'. Did you use correct User Filter ID?"), - - /** - * If specified by id Dashboard not found - */ - DASHBOARD_NOT_FOUND_IN_PROJECT(40422, "Dashboard with ID '{}' not found on project '{}'. Did you use correct Dashboard ID?"), - - /** - * If pattern template with provided id is not found - */ - PATTERN_TEMPLATE_NOT_FOUND_IN_PROJECT(40423, - "Pattern template with ID '{}' not found on project '{}'. Did you use correct Pattern template ID?" - ), - - TEST_ITEM_OR_LAUNCH_NOT_FOUND(40424, "Test Item or Launch '{}' not found. Did you use correct ID?"), - - /** - * If analyzer with provided name is not found - */ - ANALYZER_NOT_FOUND(40425, "Analyzer '{}' not found."), - - /** - * If attachment with provided id not found - */ - ATTACHMENT_NOT_FOUND(40426, "Attachment '{}' not found"), - - /** - * If binary data not found - */ - UNABLE_TO_LOAD_BINARY_DATA(40427, "Unable to load binary data by id '{}'"), - - /** - * If cluster with provided id not found - */ - CLUSTER_NOT_FOUND(40428, "Cluster '{}' not found"), - - /** - * Common error in case if object not found - */ - NOT_FOUND(40430, "'{}' not found. Did you use correct ID?"), - - /** - * If provided filtering parameters are incorrect - */ - INCORRECT_FILTER_PARAMETERS(40011, "Incorrect filtering parameters. {}"), - - /** - * If specified by id Log not found - */ - INCORRECT_SORTING_PARAMETERS(40012, "Sorting parameter {} is not defined"), - - /** - * If it's impossible to use specified integration - */ - INCORRECT_INTEGRATION_NAME(40013, "Incorrect integration name. {}"), - - /** - * Unable modify sharable resource - */ - UNABLE_MODIFY_SHARABLE_RESOURCE(40014, "Unable modify sharable resource. {}"), - - /** - * Unable to recognize provided authentication type - */ - INCORRECT_AUTHENTICATION_TYPE(40015, "Incorrect authentication type: {}"), - - /** - * Impossible post ticket to BTS - */ - UNABLE_POST_TICKET(40301, "Impossible post ticket. {}"), - - /** - * Impossible to interact with integration - */ - UNABLE_INTERACT_WITH_INTEGRATION(40302, "Impossible interact with integration. {}"), - - /** - * "Unable assign/unassign user to/from project - */ - UNABLE_ASSIGN_UNASSIGN_USER_TO_PROJECT(40304, "Unable assign/unassign user to/from project. {}"), - - /** - * Impossible operation on server side - */ - EMAIL_CONFIGURATION_IS_INCORRECT(40305, "Email server is not configured or configuration is incorrect. {}"), - - /** - * Project update not allowed. This restriction is applied to Personal projects and internal EPAM's project type - */ - PROJECT_UPDATE_NOT_ALLOWED(4007, "Update/Delete of project with type {} is not allowed"), - - /** - * Unable to update yourself role - */ - UNABLE_TO_UPDATE_YOURSELF_ROLE(4008, "Unable to update yourself role."), - - /** - * Impossible operation on server side - */ - FORBIDDEN_OPERATION(40010, "Forbidden operation. {}"), - - /** - * If resource with specified settings already exists and should be unique - */ - RESOURCE_ALREADY_EXISTS(4091, "Resource '{}' already exists. You couldn't create the duplicate."), - - /** - * If Role with specified settings already exists and should be unique - */ - ROLE_ALREADY_EXISTS_ERROR(4093, "Role with specified settings already exists. You couldn't create the duplicate."), - - /** - * If User with specified login already exists and should be unique - */ - USER_ALREADY_EXISTS(4094, "User with '{}' already exists. You couldn't create the duplicate."), - - /** - * If User filter with specified name already exists and should be unique - */ - USER_FILTER_ALREADY_EXISTS(4098, - "User filter with name '{}' already exists for user '{}' under the project '{}'. You couldn't create the duplicate." - ), - - /** - * If Project with specified settings already exists and should be unique - */ - PROJECT_ALREADY_EXISTS(4095, "Project '{}' already exists. You couldn't create the duplicate."), - - /** - * If Dashboard update request contains invalid data - */ - DASHBOARD_UPDATE_ERROR(4096, "Dashboard update request contains invalid data. {}"), - - /** - * If widget content can't be loaded because some of properties are - * incorrect - */ - UNABLE_LOAD_WIDGET_CONTENT(4097, "Unable to load widget content. Widget properties contain errors: {}"), - - /** - * Unable add resource to favorites - */ - UNABLE_ADD_TO_FAVORITE(4099, "Unable add resource to favorites. {}"), - - /** - * Unable create duplicate of integration - */ - INTEGRATION_ALREADY_EXISTS(40910, "Integration '{}' already exists. You couldn't create the duplicate."), - - /** - * Unable create the duplication of server settings with one profile name - */ - SERVER_SETTINGS_ALREADY_EXISTS(40911, "Server settings with '{}' profile already exists. You couldn't create the duplicate."), - - /** - * Unable remove resource from favorites - */ - UNABLE_REMOVE_FROM_FAVORITE(4100, "Unable remove resource from favorites. {}"), - - /** - * If specified by login User not found - */ - LAUNCH_IS_NOT_FINISHED(4063, "Unable to perform operation for non-finished launch. {}"), - - /** - * Unable to finish with incorrect status - */ - TEST_ITEM_IS_NOT_FINISHED(4064, "Unable to perform operation for non-finished test item. {}"), - - /** - * Unable to finish with incorrect status - */ - INCORRECT_FINISH_STATUS(4065, "{}. Did you provide correct status in request?"), - - /** - * Base Error If Request sent with incorrect parameters - */ - BAD_REQUEST_ERROR(40016, "Error in handled Request. Please, check specified parameters: '{}'"), - /** - * If SaveLogRQ sent with incorrect parameters - */ - BAD_SAVE_LOG_REQUEST(40017, "Error in Save Log Request. {}"), - /** - * If Test, TestStep, Launch already finished and writing is disabled - */ - REPORTING_ITEM_ALREADY_FINISHED(40018, "Reporting for item {} already finished. Please, check item status."), - - /** - * Occurs when status is not provided and cannot be calculated or provided - * status does not corresponds to calculated from statistics. - */ - AMBIGUOUS_TEST_ITEM_STATUS(40019, "Test item status is ambiguous. {}"), - - /** - * Incorrect test item description - */ - FAILED_TEST_ITEM_ISSUE_TYPE_DEFINITION(40020, "Test items issue type cannot be resolved. {}"), - - /** - * Finish Time Earlier than start time - */ - FINISH_TIME_EARLIER_THAN_START_TIME(40021, "Finish time '{}' is earlier than start time '{}' for resource with ID '{}'"), - - /** - * Is not allowed to finish item - */ - FINISH_ITEM_NOT_ALLOWED(40022, "Finish test item is not allowed. {}"), - - /** - * Unable to finish in current status - */ - FINISH_LAUNCH_NOT_ALLOWED(40023, "Finish launch is not allowed. {}"), - - /** - * Unable to finish in current status - */ - START_ITEM_NOT_ALLOWED(40024, "Start test item is not allowed. {}"), - - /** - * Finish Time Earlier than start time - */ - CHILD_START_TIME_EARLIER_THAN_PARENT(40025, - "Start time of child ['{}'] item should be same or later than start time ['{}'] of the parent item/launch '{}'" - ), - - /** - * Unsupported test item type - */ - UNSUPPORTED_TEST_ITEM_TYPE(40026, "Test Item type {} is unsupported"), - - /** - * Unsupported test item type - */ - LOGGING_IS_NOT_ALLOWED(40027, "Logging is not allowed. {}"), - - /** - * Incorrect create widget request - */ - BAD_SAVE_WIDGET_REQUEST(40028, "Incorrect create widget request. {}"), - - /** - * Incorrect update widget request - */ - BAD_UPDATE_WIDGET_REQUEST(40029, "Incorrect update widget request. {}"), - - /** - * Unable to load history test item's history. - */ - UNABLE_LOAD_TEST_ITEM_HISTORY(40030, "Unable to load test item history. {}"), - - /** - * Bad save user filter request - */ - BAD_SAVE_USER_FILTER_REQUEST(40031, "Bad save user filter request. {}"), - - /** - * Error while processing retries - */ - RETRIES_HANDLER_ERROR(40036, "Incorrect retries processing. {}"), - - /** - * Bad format of importing file - */ - IMPORT_FILE_ERROR(40035, "Error while importing the file. '{}'"), - - /** - * Error during the xml file parsing - */ - PARSING_XML_ERROR(40037, "Error during parsing the xml file: '{}'"), - - /** - * Error during the object retrieving - */ - OBJECT_RETRIEVAL_ERROR(40038, "Error during object retrieving: '{}'"), - - /** - * Error during the plugin uploading - */ - PLUGIN_UPLOAD_ERROR(40039, "Error during plugin uploading: '{}'"), - - /** - * Error during the plugin removing - */ - PLUGIN_REMOVE_ERROR(40040, "Error during plugin removing: '{}'"), - - /** - * Unable to save child item for a retry - */ - UNABLE_TO_SAVE_CHILD_ITEM_FOR_THE_RETRY(40041, "Item with id = '{}' is a retry and can not have children"), - - /** - * Pattern analysis error - */ - PATTERN_ANALYSIS_ERROR(40042, "Pattern analysis error. {}"), - - /** - * Bad save user filter request - */ - PROJECT_DOESNT_CONTAIN_USER(4220, "Project '{}' doesn't contain user '{}'"), - - /** - * Base ReportPortal Exception. Try to avoid this type and create more - * custom - */ - UNCLASSIFIED_REPORT_PORTAL_ERROR(5001, "Unclassified Report Portal Error"), - - /** - * Incorrect update preference request - */ - BAD_UPDATE_PREFERENCE_REQUEST(40032, "Incorrect update widget request {}"), - - /** - * Unsupported merge strategy type - */ - UNSUPPORTED_MERGE_STRATEGY_TYPE(40033, "Merge Strategy type {} is unsupported"), - - /** - * Unable to recognize provided authentication type - */ - DEMO_DATA_GENERATION_ERROR(40034, "Demo Data Generation error: {}"), - - /** - * Use it If there are no any other exceptions. There should by no such - * exception - */ - UNCLASSIFIED_ERROR(5000, "Unclassified error"); - - private final int code; - - private final String description; - - ErrorType(int code, String description) { - this.code = code; - this.description = description; - } - - public int getCode() { - return code; - } - - public String getDescription() { - return description; - } - - /** - * Get instance by code - * - * @param code Error Code - * @return ErrorType - */ - public static ErrorType getByCode(int code) { - for (ErrorType error : values()) { - if (error.getCode() == code) { - return error; - } - } - throw new IllegalArgumentException("Unable to find Error with code '" + code + "'"); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java deleted file mode 100644 index 5c9b6ee5..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/FinishExecutionRQ.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.epam.ta.reportportal.ws.annotations.In; -import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ; -import com.fasterxml.jackson.annotation.JsonAlias; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.Date; -import java.util.Set; - -import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MAX_PARAMETERS_LENGTH; - -/** - * Finishes some entity execution in Report Portal
- * May be Launch, TestSuite, Test, TestStep - * - * @author Andrei Varabyeu - */ -@JsonInclude(Include.NON_NULL) -public class FinishExecutionRQ { - - @NotNull - @JsonProperty(value = "endTime", required = true) - @JsonAlias({ "endTime", "end_time" }) - @Schema(requiredMode = RequiredMode.REQUIRED) - private Date endTime; - - @JsonProperty(value = "status") - @In(allowedValues = { "passed", "failed", "stopped", "skipped", "interrupted", "cancelled", "info", "warn" }) - @Schema(allowableValues = "PASSED, FAILED, STOPPED, SKIPPED, INTERRUPTED, CANCELLED, INFO, WARN") - private String status; - - @JsonProperty(value = "description") - private String description; - - @Size(max = MAX_PARAMETERS_LENGTH) - @Valid - @JsonProperty - @JsonAlias({ "attributes", "tags" }) - private Set attributes; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Set getAttributes() { - return attributes; - } - - public void setAttributes(Set attributes) { - this.attributes = attributes; - } - - public Date getEndTime() { - return endTime; - } - - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("FinishExecutionRQ{"); - sb.append("endTime=").append(endTime); - sb.append(", status='").append(status).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", attributes=").append(attributes); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java deleted file mode 100644 index 3395489f..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/FinishTestItemRQ.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.epam.ta.reportportal.ws.model.issue.Issue; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; -import javax.validation.Valid; - -@JsonInclude(Include.NON_NULL) -public class FinishTestItemRQ extends FinishExecutionRQ { - - @Valid - @JsonProperty(value = "issue") - private Issue issue; - - @JsonProperty(value = "retry") - private Boolean retry; - - @JsonProperty(value = "launchUuid") - @Schema(requiredMode = RequiredMode.REQUIRED) - private String launchUuid; - - @JsonProperty(value = "testCaseId") - private String testCaseId; - - @JsonProperty(value = "retryOf") - private String retryOf; - - public Boolean isRetry() { - return retry; - } - - public void setRetry(Boolean retry) { - this.retry = retry; - } - - public Issue getIssue() { - return issue; - } - - public void setIssue(Issue issue) { - this.issue = issue; - } - - public String getLaunchUuid() { - return launchUuid; - } - - public void setLaunchUuid(String launchUuid) { - this.launchUuid = launchUuid; - } - - public String getTestCaseId() { - return testCaseId; - } - - public void setTestCaseId(String testCaseId) { - this.testCaseId = testCaseId; - } - - public String getRetryOf() { - return retryOf; - } - - public void setRetryOf(String retryOf) { - this.retryOf = retryOf; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("FinishTestItemRQ{"); - sb.append("issue=").append(issue); - sb.append(", retry=").append(retry); - sb.append(", launchUuid='").append(launchUuid).append('\''); - sb.append(", testCaseId='").append(testCaseId).append('\''); - sb.append(", retryOf='").append(retryOf).append('\''); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/OperationCompletionRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/OperationCompletionRS.java deleted file mode 100644 index 39be5603..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/OperationCompletionRS.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Common response for operation that return just message about completion - * - * @author Henadzi_Vrubleuski - * - */ -@JsonInclude(Include.NON_NULL) -public class OperationCompletionRS { - - @JsonProperty("message") - private String resultMessage; - - public OperationCompletionRS() { - - } - - public OperationCompletionRS(String message) { - this.resultMessage = message; - } - - public String getResultMessage() { - return resultMessage; - } - - public void setResultMessage(String resultMessage) { - this.resultMessage = resultMessage; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("OperationCompletionRS{"); - sb.append("resultMessage='").append(resultMessage).append('\''); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/OwnedResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/OwnedResource.java deleted file mode 100644 index 578a8c48..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/OwnedResource.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.constraints.Size; - -import static com.epam.ta.reportportal.ws.model.ValidationConstraints.*; - -/** - * Base entity for sharable resources. This resource should contains owner in - * response. - * - * @author Aliaksei_Makayed - * - */ -@JsonInclude(Include.NON_NULL) -public class OwnedResource { - - @JsonProperty(value = "owner") - private String owner; - - @Size(min = MIN_DESCRIPTION, max = MAX_ENTITY_DESCRIPTION) - private String description; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("OwnedResource{"); - sb.append("owner='").append(owner).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/ParameterResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/ParameterResource.java deleted file mode 100644 index 310efbbe..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ParameterResource.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.constraints.NotNull; - -/** - * Test item parameters representation - * - * @author Pavel_Bortnik - */ -public class ParameterResource { - - @NotNull - @JsonProperty(value = "key", required = true) - private String key; - - @JsonProperty(value = "value") - private String value; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ParameterResource that = (ParameterResource) o; - - if (key != null ? !key.equals(that.key) : that.key != null) return false; - return value != null ? value.equals(that.value) : that.value == null; - } - - @Override - public int hashCode() { - int result = key != null ? key.hashCode() : 0; - result = 31 * result + (value != null ? value.hashCode() : 0); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(key != null ? key + "=" : ""); - sb.append(value); - return sb.toString(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java deleted file mode 100644 index d78f5962..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/StartRQ.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ; -import com.fasterxml.jackson.annotation.JsonAlias; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.Date; -import java.util.Set; - -import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MAX_PARAMETERS_LENGTH; - -/** - * Base entity for start requests - * - * @author Andrei Varabyeu - */ -@JsonInclude(Include.NON_NULL) -public class StartRQ { - - @JsonProperty(value = "name", required = true) - @Schema(requiredMode = RequiredMode.REQUIRED) - protected String name; - - @JsonProperty(value = "description") - private String description; - - @Size(max = MAX_PARAMETERS_LENGTH) - @Valid - @JsonProperty("attributes") - @JsonAlias({ "attributes", "tags" }) - private Set attributes; - - @NotNull - @JsonProperty(required = true) - @JsonAlias({ "startTime", "start_time" }) - @Schema(requiredMode = RequiredMode.REQUIRED) - private Date startTime; - - @Schema(hidden = true) - @JsonProperty(value = "uuid") - private String uuid; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Set getAttributes() { - return attributes; - } - - public void setAttributes(Set attributes) { - this.attributes = attributes; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public Date getStartTime() { - return startTime; - } - - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("StartRQ{"); - sb.append("name='").append(name).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", attributes=").append(attributes); - sb.append(", startTime=").append(startTime); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - StartRQ startRQ = (StartRQ) o; - - if (name != null ? !name.equals(startRQ.name) : startRQ.name != null) { - return false; - } - if (description != null ? !description.equals(startRQ.description) : startRQ.description != null) { - return false; - } - if (attributes != null ? !attributes.equals(startRQ.attributes) : startRQ.attributes != null) { - return false; - } - return startTime != null ? startTime.equals(startRQ.startTime) : startRQ.startTime == null; - } - - @Override - public int hashCode() { - int result = name != null ? name.hashCode() : 0; - result = 31 * result + (description != null ? description.hashCode() : 0); - result = 31 * result + (attributes != null ? attributes.hashCode() : 0); - result = 31 * result + (startTime != null ? startTime.hashCode() : 0); - return result; - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java deleted file mode 100644 index d9c7398e..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/StartTestItemRQ.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.epam.ta.reportportal.ws.annotations.In; -import com.epam.ta.reportportal.ws.annotations.NotBlankWithSize; -import com.fasterxml.jackson.annotation.JsonAlias; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.ObjectCodec; -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; - -import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.io.IOException; -import java.util.List; -import java.util.Objects; - -import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MAX_TEST_ITEM_UNIQUE_ID_LENGTH; - -@JsonInclude(Include.NON_NULL) -public class StartTestItemRQ extends StartRQ { - - @JsonProperty(value = "codeRef") - private String codeRef; - - @Valid - @JsonProperty(value = "parameters") - private List parameters; - - @Size(max = MAX_TEST_ITEM_UNIQUE_ID_LENGTH) - @JsonProperty(value = "uniqueId") - private String uniqueId; - - @JsonProperty(value = "testCaseId") - private String testCaseId; - - @NotNull - @JsonAlias({ "launchUuid", "launch_id" }) - @Schema(description = "UUID of parent launch", required = true) - private String launchUuid; - - @NotNull - @JsonProperty(value = "type", required = true) - @JsonSerialize(using = UpperCaseTypeSerializer.class) - @JsonDeserialize(using = UpperCaseTypeDeserializer.class) - @In(allowedValues = { "suite", "story", "test", "scenario", "step", "before_class", "before_groups", "before_method", "before_suite", - "before_test", "after_class", "after_groups", "after_method", "after_suite", "after_test" }) - @Schema(required = true, allowableValues = "SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS," - + "BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS, AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST") - private String type; - - @JsonProperty(value = "retry") - private Boolean retry; - - @JsonProperty(value = "hasStats") - private boolean hasStats = true; - - @JsonProperty(value = "retryOf") - private String retryOf; - - @Override - @NotBlankWithSize(min = ValidationConstraints.MIN_TEST_ITEM_NAME_LENGTH, max = ValidationConstraints.MAX_TEST_ITEM_NAME_LENGTH) - public String getName() { - return name; - } - - public String getCodeRef() { - return codeRef; - } - - public void setCodeRef(String codeRef) { - this.codeRef = codeRef; - } - - public Boolean isRetry() { - return retry; - } - - public void setRetry(Boolean retry) { - this.retry = retry; - } - - public boolean isHasStats() { - return hasStats; - } - - public void setHasStats(boolean hasStats) { - this.hasStats = hasStats; - } - - public String getRetryOf() { - return retryOf; - } - - public void setRetryOf(String retryOf) { - this.retryOf = retryOf; - } - - public String getLaunchUuid() { - return launchUuid; - } - - public void setLaunchUuid(String launchUuid) { - this.launchUuid = launchUuid; - } - - public List getParameters() { - return parameters; - } - - public void setParameters(List parameters) { - this.parameters = parameters; - } - - public String getUniqueId() { - return uniqueId; - } - - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } - - public String getTestCaseId() { - return testCaseId; - } - - public void setTestCaseId(String testCaseId) { - this.testCaseId = testCaseId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - private static class UpperCaseTypeDeserializer extends JsonDeserializer { - - @Override - public String deserialize(JsonParser parser, DeserializationContext context) throws IOException { - ObjectCodec oc = parser.getCodec(); - JsonNode node = oc.readTree(parser); - return node.asText().toUpperCase(); - } - - } - - private static class UpperCaseTypeSerializer extends JsonSerializer { - - @Override - public void serialize(String type, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { - if (type != null) { - jsonGenerator.writeString(type.toUpperCase()); - } - } - - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - StartTestItemRQ that = (StartTestItemRQ) o; - return hasStats == that.hasStats && Objects.equals(retryOf, that.retryOf) && Objects.equals(codeRef, that.codeRef) - && Objects.equals(parameters, that.parameters) && Objects.equals(uniqueId, that.uniqueId) && Objects.equals(testCaseId, - that.testCaseId - ) && Objects.equals(launchUuid, that.launchUuid) && Objects.equals(type, that.type) && Objects.equals(retry, that.retry); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), codeRef, parameters, uniqueId, testCaseId, launchUuid, type, retry, hasStats, retryOf); - } - - @Override - public String toString() { - return "StartTestItemRQ{" + "codeRef='" + codeRef + '\'' + ", parameters=" + parameters + ", uniqueId='" + uniqueId + '\'' - + ", testCaseId='" + testCaseId + '\'' + ", launchUuid='" + launchUuid + '\'' + ", type='" + type + '\'' + ", retry=" - + retry + ", hasStats=" + hasStats + ", retryOf=" + retryOf + ", name='" + name + '\'' + '}'; - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLaunch.java b/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLaunch.java index ddb29b87..1e471c89 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLaunch.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLaunch.java @@ -19,7 +19,6 @@ import com.epam.ta.reportportal.ws.model.project.AnalyzerConfig; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.time.LocalDateTime; import java.util.List; import java.util.Map; diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLog.java b/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLog.java index 7515f72f..6df2b996 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLog.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexLog.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.time.LocalDateTime; import java.util.Objects; diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexTestItem.java b/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexTestItem.java index bedeff4d..3daf5429 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/analyzer/IndexTestItem.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.ws.model.analyzer; import com.fasterxml.jackson.annotation.JsonProperty; - import java.time.LocalDateTime; import java.util.Objects; import java.util.Set; diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java index 7d3b9014..956e0e5e 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java @@ -16,77 +16,75 @@ package com.epam.ta.reportportal.ws.model.attribute; +import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MIN_ITEM_ATTRIBUTE_VALUE_LENGTH; + +import java.io.Serializable; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; -import java.io.Serializable; - -import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MIN_ITEM_ATTRIBUTE_VALUE_LENGTH; /** * @author Ihar Kahadouski */ public class ItemAttributeResource implements Serializable { - private String key; - - @NotBlank - @Size(min = MIN_ITEM_ATTRIBUTE_VALUE_LENGTH) - private String value; - - public ItemAttributeResource() { - } - - public ItemAttributeResource(String key, String value) { - this.key = key; - this.value = value; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("ItemAttributeResource{"); - sb.append("key='").append(key).append('\''); - sb.append(", value='").append(value).append('\''); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - ItemAttributeResource that = (ItemAttributeResource) o; - - if (key != null ? !key.equals(that.key) : that.key != null) { - return false; - } - return value != null ? value.equals(that.value) : that.value == null; - } - - @Override - public int hashCode() { - int result = key != null ? key.hashCode() : 0; - result = 31 * result + (value != null ? value.hashCode() : 0); - return result; - } + private String key; + + @NotBlank + @Size(min = MIN_ITEM_ATTRIBUTE_VALUE_LENGTH) + private String value; + + public ItemAttributeResource() { + } + + public ItemAttributeResource(String key, String value) { + this.key = key; + this.value = value; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public String toString() { + return "ItemAttributeResource{" + "key='" + key + '\'' + + ", value='" + value + '\'' + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + ItemAttributeResource that = (ItemAttributeResource) o; + + if (key != null ? !key.equals(that.key) : that.key != null) { + return false; + } + return value != null ? value.equals(that.value) : that.value == null; + } + + @Override + public int hashCode() { + int result = key != null ? key.hashCode() : 0; + result = 31 * result + (value != null ? value.hashCode() : 0); + return result; + } } diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java deleted file mode 100644 index 1d450c9a..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributesRQ.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.attribute; - -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.Serializable; - -/** - * @author Pavel Bortnik - */ -public class ItemAttributesRQ extends ItemAttributeResource implements Serializable { - - @Schema(example = "false") - private boolean system; - - public ItemAttributesRQ() { - } - - public ItemAttributesRQ(String value) { - super(null, value); - } - - public ItemAttributesRQ(String key, String value) { - super(key, value); - } - - public ItemAttributesRQ(String key, String value, boolean system) { - super(key, value); - this.system = system; - } - - public boolean isSystem() { - return system; - } - - public void setSystem(boolean system) { - this.system = system; - } - - @Override - public String toString() { - return "ItemAttributesRQ{" + "system=" + system + "} " + super.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - - ItemAttributesRQ that = (ItemAttributesRQ) o; - - return system == that.system; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (system ? 1 : 0); - return result; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java index 503445c6..84e68ca9 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.ws.model.attribute; import com.epam.ta.reportportal.ws.model.BulkInfoUpdateRQ; - import javax.validation.Valid; /** @@ -25,35 +24,35 @@ */ public class UpdateItemAttributeRQ { - @Valid - private ItemAttributeResource from; + @Valid + private ItemAttributeResource from; - @Valid - private ItemAttributeResource to; + @Valid + private ItemAttributeResource to; - private BulkInfoUpdateRQ.Action action; + private BulkInfoUpdateRQ.Action action; - public ItemAttributeResource getFrom() { - return from; - } + public ItemAttributeResource getFrom() { + return from; + } - public void setFrom(ItemAttributeResource from) { - this.from = from; - } + public void setFrom(ItemAttributeResource from) { + this.from = from; + } - public ItemAttributeResource getTo() { - return to; - } + public ItemAttributeResource getTo() { + return to; + } - public void setTo(ItemAttributeResource to) { - this.to = to; - } + public void setTo(ItemAttributeResource to) { + this.to = to; + } - public BulkInfoUpdateRQ.Action getAction() { - return action; - } + public BulkInfoUpdateRQ.Action getAction() { + return action; + } - public void setAction(BulkInfoUpdateRQ.Action action) { - this.action = action; - } + public void setAction(BulkInfoUpdateRQ.Action action) { + this.action = action; + } } diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/AllowedValue.java b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/AllowedValue.java index 385ad9b4..28757bac 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/AllowedValue.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/AllowedValue.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; - import java.io.Serializable; /** diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Authentic.java b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Authentic.java index 5ed6b07e..a6635425 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Authentic.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Authentic.java @@ -12,74 +12,71 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ - + */ + package com.epam.ta.reportportal.ws.model.externalsystem; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; /** - * Basic class for accessible data - * //TODO: AV - refactor to support polymorphism - * + * Basic class for accessible data //TODO: AV - refactor to support polymorphism + * * @author Andrei_Ramanchuk */ @JsonInclude(Include.NON_NULL) public class Authentic { - - @JsonProperty(value = "username") - private String username; - - @JsonProperty(value = "password") - private String password; - - @JsonProperty(value = "domain") - private String domain; - - @JsonProperty(value = "token") - private String token; - - public String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getUsername() { - return username; - } - - public void setPassword(String pass) { - this.password = pass; - } - - public String getPassword() { - return password; - } - - public void setToken(String value) { - this.token = value; - } - - public String getToken() { - return token; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("Authentic{"); - sb.append("username='").append(username).append('\''); - sb.append(", password='").append(password).append('\''); //NOSONAR - sb.append(", token='").append(token).append('\''); - sb.append('}'); - return sb.toString(); - } + + @JsonProperty(value = "username") + private String username; + + @JsonProperty(value = "password") + private String password; + + @JsonProperty(value = "domain") + private String domain; + + @JsonProperty(value = "token") + private String token; + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getUsername() { + return username; + } + + public void setPassword(String pass) { + this.password = pass; + } + + public String getPassword() { + return password; + } + + public void setToken(String value) { + this.token = value; + } + + public String getToken() { + return token; + } + + @Override + public String toString() { + return "Authentic{" + "username='" + username + '\'' + + ", password='" + password + '\'' //NOSONAR + + ", token='" + token + '\'' + + '}'; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostTicketRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostTicketRQ.java index 0cd307e6..c9956bf2 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostTicketRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostTicketRQ.java @@ -20,12 +20,11 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; - +import java.util.List; +import java.util.Map; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.Size; -import java.util.List; -import java.util.Map; /** * Domain object for creating ticket in bug tracking system. diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Ticket.java b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Ticket.java index d82d04e1..f3accfad 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Ticket.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/Ticket.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.Objects; @JsonInclude(Include.NON_NULL) diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractAuthResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractAuthResource.java index b4b8b862..a5e8e5cd 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractAuthResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractAuthResource.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.ws.model.integration.auth; import com.fasterxml.jackson.annotation.JsonInclude; - import java.io.Serializable; /** diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractLdapResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractLdapResource.java index 773dcb51..cfe4a426 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractLdapResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/AbstractLdapResource.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import javax.validation.Valid; /** diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/LdapAttributes.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/LdapAttributes.java index f8c1b8dd..ef7656b1 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/LdapAttributes.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/LdapAttributes.java @@ -18,12 +18,11 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - +import java.io.Serializable; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; -import java.io.Serializable; /** * @author Ivan Budayeu diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlProvidersResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlProvidersResource.java index b1725f65..2ab20dbe 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlProvidersResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SamlProvidersResource.java @@ -17,9 +17,8 @@ package com.epam.ta.reportportal.ws.model.integration.auth; import com.fasterxml.jackson.annotation.JsonInclude; - -import javax.validation.Valid; import java.util.List; +import javax.validation.Valid; /** * @author Ihar Kahadouski diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SynchronizationAttributesResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SynchronizationAttributesResource.java index e1fb4d3e..c510830d 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SynchronizationAttributesResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/SynchronizationAttributesResource.java @@ -18,9 +18,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.constraints.NotBlank; import java.io.Serializable; +import javax.validation.constraints.NotBlank; /** * @author Ivan Budayeu diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/UpdateAuthRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/UpdateAuthRQ.java index d3271971..ced12944 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/UpdateAuthRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/integration/auth/UpdateAuthRQ.java @@ -18,10 +18,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - +import java.util.Map; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -import java.util.Map; /** * @author Ihar Kahadouski diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/issue/Issue.java b/src/main/java/com/epam/ta/reportportal/ws/model/issue/Issue.java deleted file mode 100644 index e1087341..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/issue/Issue.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.issue; - -import com.epam.ta.reportportal.ws.model.ValidationConstraints; -import com.fasterxml.jackson.annotation.JsonAlias; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.Objects; -import java.util.Set; - -/** - * Test item issue - * - * @author Dzianis Shlychkou - */ -@JsonInclude(Include.NON_NULL) -public class Issue { - - @NotBlank - @JsonProperty(value = "issueType", required = true) - @JsonAlias({ "issueType", "issue_type" }) - private String issueType; - - @JsonProperty(value = "comment") - @Size(max = ValidationConstraints.MAX_DESCRIPTION_LENGTH) - private String comment; - - @JsonProperty(value = "autoAnalyzed") - private boolean autoAnalyzed; - - @JsonProperty(value = "ignoreAnalyzer") - private boolean ignoreAnalyzer; - - @Valid - @Size(max = 300) - @JsonProperty(value = "externalSystemIssues") - private Set externalSystemIssues; - - @JsonInclude(Include.NON_NULL) - public static class ExternalSystemIssue { - - @NotBlank - @JsonProperty(value = "ticketId") - private String ticketId; - - @JsonProperty(value = "submitDate") - private Long submitDate; - - @NotBlank - @JsonProperty(value = "btsUrl") - private String btsUrl; - - @NotBlank - @JsonProperty(value = "btsProject") - private String btsProject; - - @NotBlank - @JsonProperty(value = "url") - private String url; - - @JsonProperty(value = "pluginName") - private String pluginName; - - public void setTicketId(String ticketId) { - this.ticketId = ticketId; - } - - public String getTicketId() { - return ticketId; - } - - public Long getSubmitDate() { - return submitDate; - } - - public void setSubmitDate(Long submitDate) { - this.submitDate = submitDate; - } - - public String getBtsUrl() { - return btsUrl; - } - - public void setBtsUrl(String btsUrl) { - this.btsUrl = btsUrl; - } - - public String getBtsProject() { - return btsProject; - } - - public void setBtsProject(String btsProject) { - this.btsProject = btsProject; - } - - public void setUrl(String value) { - this.url = value; - } - - public String getUrl() { - return url; - } - - public String getPluginName() { - return pluginName; - } - - public void setPluginName(String pluginName) { - this.pluginName = pluginName; - } - - @Override - public String toString() { - return "ExternalSystemIssue{" + "ticketId='" + ticketId + '\'' + ", submitDate=" + submitDate + ", btsUrl='" + btsUrl + '\'' - + ", btsProject='" + btsProject + '\'' + ", url='" + url + '\'' + ", pluginName='" + pluginName + '\'' + '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExternalSystemIssue that = (ExternalSystemIssue) o; - return Objects.equals(ticketId, that.ticketId) && Objects.equals(submitDate, that.submitDate) && Objects.equals(btsUrl, - that.btsUrl - ) && Objects.equals(btsProject, that.btsProject) && Objects.equals(url, that.url) && Objects.equals(pluginName, - that.pluginName - ); - } - - @Override - public int hashCode() { - return Objects.hash(ticketId, submitDate, btsUrl, btsProject, url, pluginName); - } - } - - public void setExternalSystemIssues(Set externalSystemIssues) { - this.externalSystemIssues = externalSystemIssues; - } - - public Set getExternalSystemIssues() { - return externalSystemIssues; - } - - public String getIssueType() { - return issueType; - } - - public void setIssueType(String issueType) { - this.issueType = issueType; - } - - public String getComment() { - return comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - - public boolean getAutoAnalyzed() { - return autoAnalyzed; - } - - public void setAutoAnalyzed(boolean autoAnalyzed) { - this.autoAnalyzed = autoAnalyzed; - } - - public boolean getIgnoreAnalyzer() { - return ignoreAnalyzer; - } - - public void setIgnoreAnalyzer(boolean ignoreAnalyzer) { - this.ignoreAnalyzer = ignoreAnalyzer; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("Issue{"); - sb.append("issueType='").append(issueType).append('\''); - sb.append(", comment='").append(comment).append('\''); - sb.append(", autoAnalyzed='").append(autoAnalyzed).append("\'"); - sb.append(", externalSystemIssues=").append(externalSystemIssues); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/item/ItemCreatedRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/item/ItemCreatedRS.java deleted file mode 100644 index 47a92831..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/item/ItemCreatedRS.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.epam.ta.reportportal.ws.model.item; - -import com.epam.ta.reportportal.ws.model.EntryCreatedAsyncRS; -import com.fasterxml.jackson.annotation.JsonInclude; - -/** - * Response Model for Start Test Item RQ - * - * @author Andrei Varabyeu - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ItemCreatedRS extends EntryCreatedAsyncRS { - - public ItemCreatedRS() { - - } - - public ItemCreatedRS(String id, String uniqueId) { - super(id); - this.uniqueId = uniqueId; - } - - private String uniqueId; - - public String getUniqueId() { - return uniqueId; - } - - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } - -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/item/ItemPathName.java b/src/main/java/com/epam/ta/reportportal/ws/model/item/ItemPathName.java deleted file mode 100644 index b6333999..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/item/ItemPathName.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.item; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; - -/** - * @author Ivan Budayeu - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ItemPathName implements Serializable { - - @JsonProperty(value = "id") - private Long id; - - @JsonProperty(value = "name") - private String name; - - public ItemPathName() { - } - - public ItemPathName(Long id, String name) { - this.id = id; - this.name = name; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/item/LaunchPathName.java b/src/main/java/com/epam/ta/reportportal/ws/model/item/LaunchPathName.java deleted file mode 100644 index a63e735f..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/item/LaunchPathName.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.item; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; - -/** - * @author Ivan Budayeu - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class LaunchPathName implements Serializable { - - @JsonProperty(value = "name") - private String name; - - @JsonProperty(value = "number") - private Integer number; - - public LaunchPathName() { - } - - public LaunchPathName(String name, Integer number) { - this.name = name; - this.number = number; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - this.number = number; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/item/PathNameResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/item/PathNameResource.java deleted file mode 100644 index 8b633cf9..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/item/PathNameResource.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.item; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.io.Serializable; -import java.util.List; - -/** - * @author Ivan Budayeu - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PathNameResource implements Serializable { - - @JsonProperty(value = "launchPathName") - private LaunchPathName launchPathName; - - @JsonProperty(value = "itemPaths") - private List itemPaths; - - public PathNameResource() { - } - - public PathNameResource(LaunchPathName launchPathName, List itemPaths) { - this.launchPathName = launchPathName; - this.itemPaths = itemPaths; - } - - public LaunchPathName getLaunchPathName() { - return launchPathName; - } - - public void setLaunchPathName(LaunchPathName launchPathName) { - this.launchPathName = launchPathName; - } - - public List getItemPaths() { - return itemPaths; - } - - public void setItemPaths(List itemPaths) { - this.itemPaths = itemPaths; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchResource.java deleted file mode 100644 index 83f3b50f..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchResource.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.launch; - -import com.epam.ta.reportportal.ws.model.OwnedResource; -import com.epam.ta.reportportal.ws.model.ValidationConstraints; -import com.epam.ta.reportportal.ws.model.attribute.ItemAttributeResource; -import com.epam.ta.reportportal.ws.model.statistics.StatisticsResource; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; - -/** - * JSON Representation of Report Portal's Launch domain object - * - * @author Andrei Varabyeu - */ -@JsonInclude(Include.NON_NULL) -public class LaunchResource extends OwnedResource { - - @NotNull - @JsonProperty(value = "id", required = true) - private Long launchId; - - @NotBlank - @JsonProperty(value = "uuid", required = true) - private String uuid; - - @NotBlank - @Size(min = ValidationConstraints.MIN_NAME_LENGTH, max = ValidationConstraints.MAX_NAME_LENGTH) - @JsonProperty(value = "name", required = true) - private String name; - - @NotNull - @JsonProperty(value = "number", required = true) - private Long number; - - @JsonProperty(value = "description") - @Size(max = ValidationConstraints.MAX_LAUNCH_DESCRIPTION_LENGTH) - private String description; - - @NotNull - @JsonProperty(value = "startTime", required = true) - private Date startTime; - - @JsonProperty(value = "endTime") - private Date endTime; - - @JsonProperty(value = "lastModified") - private Date lastModified; - - @NotNull - @JsonProperty(value = "status", required = true) - private String status; - - @JsonProperty(value = "statistics") - @Valid - private StatisticsResource statisticsResource; - - @JsonProperty(value = "attributes") - private Set attributes; - - @JsonProperty(value = "mode") - private Mode mode; - - @JsonProperty(value = "analysing") - private Set analyzers = new LinkedHashSet<>(); - - @JsonProperty(value = "approximateDuration") - private double approximateDuration; - - @JsonProperty(value = "hasRetries") - private boolean hasRetries; - - @JsonProperty(value = "rerun") - private boolean rerun; - - @JsonProperty(value = "metadata") - private Map metadata; - - public double getApproximateDuration() { - return approximateDuration; - } - - public void setApproximateDuration(double approximateDuration) { - this.approximateDuration = approximateDuration; - } - - public Long getLaunchId() { - return launchId; - } - - public void setLaunchId(Long launchId) { - this.launchId = launchId; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Long getNumber() { - return number; - } - - public void setNumber(Long number) { - this.number = number; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getStartTime() { - return startTime; - } - - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - - public Date getEndTime() { - return endTime; - } - - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - - public Date getLastModified() { - return lastModified; - } - - public void setLastModified(Date lastModified) { - this.lastModified = lastModified; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public StatisticsResource getStatisticsResource() { - return statisticsResource; - } - - public void setStatisticsResource(StatisticsResource statisticsResource) { - this.statisticsResource = statisticsResource; - } - - public Set getAttributes() { - return attributes; - } - - public void setAttributes(Set attributes) { - this.attributes = attributes; - } - - public Mode getMode() { - return mode; - } - - public void setMode(Mode mode) { - this.mode = mode; - } - - public Set getAnalyzers() { - return analyzers; - } - - public void setAnalyzers(Set analyzers) { - this.analyzers = analyzers; - } - - public boolean isHasRetries() { - return hasRetries; - } - - public boolean getHasRetries() { - return hasRetries; - } - - public void setHasRetries(boolean hasRetries) { - this.hasRetries = hasRetries; - } - - public boolean isRerun() { - return rerun; - } - - public void setRerun(boolean rerun) { - this.rerun = rerun; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("LaunchResource{"); - sb.append("launchId=").append(launchId); - sb.append(", uuid='").append(uuid).append('\''); - sb.append(", name='").append(name).append('\''); - sb.append(", number=").append(number); - sb.append(", description='").append(description).append('\''); - sb.append(", startTime=").append(startTime); - sb.append(", endTime=").append(endTime); - sb.append(", lastModified=").append(lastModified); - sb.append(", status='").append(status).append('\''); - sb.append(", statisticsResource=").append(statisticsResource); - sb.append(", attributes=").append(attributes); - sb.append(", mode=").append(mode); - sb.append(", analyzers=").append(analyzers); - sb.append(", approximateDuration=").append(approximateDuration); - sb.append(", hasRetries=").append(hasRetries); - sb.append(", rerun=").append(rerun); - sb.append(", metadata=").append(metadata); - sb.append('}'); - return sb.toString(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/Mode.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/Mode.java deleted file mode 100644 index e50af2e8..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/Mode.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.launch; - -/** - * Defile possible executing modes. Executing mode specify visibility of launch. - * - * @author Aliaksei_Makayed - * - */ -public enum Mode { - - DEFAULT, DEBUG; - - public static boolean isExists(String name) { - for (Mode mode : values()) { - if (mode.name().equalsIgnoreCase(name)) - return true; - } - return false; - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java deleted file mode 100644 index 5fcac188..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRQ.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.launch; - -import com.epam.ta.reportportal.ws.annotations.NotBlankWithSize; -import com.epam.ta.reportportal.ws.model.StartRQ; -import com.epam.ta.reportportal.ws.model.ValidationConstraints; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; - -@JsonInclude(Include.NON_NULL) -public class StartLaunchRQ extends StartRQ { - - @JsonProperty("mode") - private Mode mode; - - @JsonProperty("rerun") - private boolean rerun; - - @JsonProperty("rerunOf") - @Schema(description = "UUID of desired launch to rerun") - private String rerunOf; - - @Override - @NotBlankWithSize(min = ValidationConstraints.MIN_LAUNCH_NAME_LENGTH, max = ValidationConstraints.MAX_NAME_LENGTH) - public String getName() { - return name; - } - - public Mode getMode() { - return mode; - } - - public void setMode(Mode mode) { - this.mode = mode; - } - - public boolean isRerun() { - return rerun; - } - - public void setRerun(boolean rerun) { - this.rerun = rerun; - } - - public String getRerunOf() { - return rerunOf; - } - - public void setRerunOf(String rerunOf) { - this.rerunOf = rerunOf; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("StartLaunchRQ{"); - sb.append("mode=").append(mode); - sb.append(", rerun=").append(rerun); - sb.append(", rerunOf='").append(rerunOf).append('\''); - sb.append('}'); - return sb.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - - StartLaunchRQ that = (StartLaunchRQ) o; - - if (rerun != that.rerun) { - return false; - } - if (mode != that.mode) { - return false; - } - return rerunOf != null ? rerunOf.equals(that.rerunOf) : that.rerunOf == null; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (mode != null ? mode.hashCode() : 0); - result = 31 * result + (rerun ? 1 : 0); - result = 31 * result + (rerunOf != null ? rerunOf.hashCode() : 0); - return result; - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRS.java deleted file mode 100644 index de79637f..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/StartLaunchRS.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.launch; - -import com.epam.ta.reportportal.ws.model.EntryCreatedAsyncRS; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Ihar Kahadouski - */ -public class StartLaunchRS extends EntryCreatedAsyncRS { - - @JsonProperty("number") - private Long number; - - public StartLaunchRS() { - } - - public StartLaunchRS(String id, Long number) { - super(id); - this.number = number; - } - - public Long getNumber() { - return number; - } - - public void setNumber(Long number) { - this.number = number; - } - -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/ClusterInfoResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/ClusterInfoResource.java index 38d2d9eb..2e68d24d 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/ClusterInfoResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/ClusterInfoResource.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.Map; /** diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/CreateClustersRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/CreateClustersRQ.java index dd0e43a5..e39c21c6 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/CreateClustersRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/launch/cluster/CreateClustersRQ.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import javax.validation.constraints.NotNull; /** diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java deleted file mode 100644 index a31b53fb..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/log/SaveLogRQ.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.log; - -import com.fasterxml.jackson.annotation.JsonAlias; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; -import javax.validation.constraints.NotNull; -import java.util.Arrays; -import java.util.Date; - -/** - * @author Henadzi_Vrubleuski - * @author Andrei Varabyeu - */ -@JsonInclude(Include.NON_NULL) -public class SaveLogRQ { - - @JsonProperty("uuid") - private String uuid; - - @JsonAlias({ "itemUuid", "item_id" }) - @Schema(description = "UUID of test item owned this log") - private String itemUuid; - - @JsonProperty(value = "launchUuid") - @Schema(requiredMode = RequiredMode.REQUIRED) - private String launchUuid; - - @NotNull - @JsonProperty(value = "time", required = true) - @Schema(requiredMode = RequiredMode.REQUIRED) - private Date logTime; - - @JsonProperty(value = "message") - private String message; - - @JsonProperty(value = "level") - @Schema(allowableValues = "error, warn, info, debug, trace, fatal, unknown") - private String level; - - @JsonProperty(value = "file") - private File file; - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public Date getLogTime() { - return logTime; - } - - public void setLogTime(Date logTime) { - this.logTime = logTime; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getItemUuid() { - return itemUuid; - } - - public void setItemUuid(String itemUuid) { - this.itemUuid = itemUuid; - } - - public String getLaunchUuid() { - return launchUuid; - } - - public void setLaunchUuid(String launchUuid) { - this.launchUuid = launchUuid; - } - - public void setLevel(String level) { - this.level = level; - } - - public String getLevel() { - return level; - } - - public void setFile(File file) { - this.file = file; - } - - public File getFile() { - return file; - } - - @JsonInclude(Include.NON_NULL) - public static class File { - - @JsonProperty(value = "name") - private String name; - - @JsonIgnore - private byte[] content; - - @JsonIgnore - private String contentType; - - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public byte[] getContent() { - return content; - } - - public void setContent(byte[] content) { - this.content = content; - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("File{"); - sb.append("name='").append(name).append('\''); - sb.append(", content=").append(Arrays.toString(content)); - sb.append(", contentType='").append(contentType).append('\''); - sb.append('}'); - return sb.toString(); - } - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("SaveLogRQ{"); - sb.append("uuid='").append(uuid).append('\''); - sb.append(", itemUuid='").append(itemUuid).append('\''); - sb.append(", launchUuid='").append(launchUuid).append('\''); - sb.append(", logTime=").append(logTime); - sb.append(", message='").append(message).append('\''); - sb.append(", level='").append(level).append('\''); - sb.append(", file=").append(file); - sb.append('}'); - return sb.toString(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/statistics/StatisticsResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/statistics/StatisticsResource.java deleted file mode 100644 index 484b0877..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/statistics/StatisticsResource.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.statistics; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Map; - -@JsonInclude(Include.NON_NULL) -public class StatisticsResource { - - @JsonProperty(value = "executions") - private Map executions; - - @JsonProperty(value = "defects") - private Map> defects; - - public Map getExecutions() { - return executions; - } - - public void setExecutions(Map executions) { - this.executions = executions; - } - - public Map> getDefects() { - return defects; - } - - public void setDefects(Map> defects) { - this.defects = defects; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("Statistics{"); - sb.append("executions=").append(executions); - sb.append(", defects=").append(defects); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/validation/NotBlankWithSizeValidator.java b/src/main/java/com/epam/ta/reportportal/ws/model/validation/NotBlankWithSizeValidator.java index ad5ac645..faa738f6 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/validation/NotBlankWithSizeValidator.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/validation/NotBlankWithSizeValidator.java @@ -17,10 +17,9 @@ package com.epam.ta.reportportal.ws.model.validation; import com.epam.ta.reportportal.ws.annotations.NotBlankWithSize; -import org.apache.commons.lang3.StringUtils; - import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; +import org.apache.commons.lang3.StringUtils; /** * @author Tatyana Gladysheva diff --git a/src/test/java/com/epam/ta/reportportal/ws/model/ErrorSerializationTest.java b/src/test/java/com/epam/ta/reportportal/ws/model/ErrorSerializationTest.java deleted file mode 100644 index e3e54be3..00000000 --- a/src/test/java/com/epam/ta/reportportal/ws/model/ErrorSerializationTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; - -/** - * Serializer/Deserializer unit tests - * - * @author Andrei Varabyeu - * - */ -public class ErrorSerializationTest { - - private static final String SERIALIZATION_RESULT = "{\"errorCode\":5000,\"message\":\"MESSAGE\",\"stackTrace\":\"STACK_TRACE\"}"; - - private ObjectMapper om = getObjectMapper(); - - @Test - public void testSerializer() throws JsonProcessingException { - String json = om.writeValueAsString(getErrorResponse()); - Assert.assertEquals(SERIALIZATION_RESULT, json); - } - - @Test - public void testDeserializer() throws IOException { - ErrorRS fromJson = om.readValue(SERIALIZATION_RESULT, ErrorRS.class); - Assert.assertEquals(getErrorResponse(), fromJson); - } - - private ErrorRS getErrorResponse() { - ErrorRS error = new ErrorRS(); - error.setMessage("MESSAGE"); - error.setStackTrace("STACK_TRACE"); - error.setErrorType(ErrorType.UNCLASSIFIED_ERROR); - return error; - } - - private ObjectMapper getObjectMapper() { - ObjectMapper om = new ObjectMapper(); - om.configure(SerializationFeature.INDENT_OUTPUT, false); - return om; - } -} \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/ws/model/ErrorTypeTest.java b/src/test/java/com/epam/ta/reportportal/ws/model/ErrorTypeTest.java deleted file mode 100644 index 11689720..00000000 --- a/src/test/java/com/epam/ta/reportportal/ws/model/ErrorTypeTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.epam.ta.reportportal.ws.model; - -import org.junit.Assert; -import org.junit.Test; - -import java.util.HashSet; -import java.util.Set; - -/** - * @author Dzmitry_Kavalets - */ -public class ErrorTypeTest { - - @Test - public void duplicateCodes() { - final int length = ErrorType.values().length; - Set codes = new HashSet(); - for (ErrorType errorType : ErrorType.values()) { - codes.add(errorType.getCode()); - } - Assert.assertEquals(length, codes.size()); - } -} \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/ws/model/FinishTestItemSerializerTest.java b/src/test/java/com/epam/ta/reportportal/ws/model/FinishTestItemSerializerTest.java deleted file mode 100644 index 06dd9618..00000000 --- a/src/test/java/com/epam/ta/reportportal/ws/model/FinishTestItemSerializerTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ; -import com.epam.ta.reportportal.ws.model.issue.Issue; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Collections; - -/** - * @author Pavel Bortnik - */ -public class FinishTestItemSerializerTest { - - private ObjectMapper om = getObjectMapper(); - - private static final String FINISH_TEST_ITEM_RQ = "{\"attributes\":[],\"status\":\"PASSED\",\"description\":\"description\"," - + "\"issue\":{\"autoAnalyzed\":false,\"ignoreAnalyzer\":false},\"retry\":false}"; - - @Test - public void testSerializer() throws JsonProcessingException { - String json = om.writeValueAsString(getFinishTestItem()); - Assert.assertEquals("Incorrect serialization result", FINISH_TEST_ITEM_RQ, json); - } - - @Test - public void testDeserializer() throws IOException { - FinishTestItemRQ rq = om.readValue(FINISH_TEST_ITEM_RQ.getBytes(StandardCharsets.UTF_8), FinishTestItemRQ.class); - Assert.assertEquals("Incorrect deserialization result", rq.getStatus(), "PASSED"); - } - - private FinishTestItemRQ getFinishTestItem() { - FinishTestItemRQ finishTestItemRQ = new FinishTestItemRQ(); - finishTestItemRQ.setStatus("PASSED"); - finishTestItemRQ.setRetry(false); - finishTestItemRQ.setDescription("description"); - finishTestItemRQ.setIssue(new Issue()); - finishTestItemRQ.setAttributes(Collections.emptySet()); - - return finishTestItemRQ; - } - - private ObjectMapper getObjectMapper() { - ObjectMapper om = new ObjectMapper(); - om.configure(SerializationFeature.INDENT_OUTPUT, false); - return om; - } - -} diff --git a/src/test/java/com/epam/ta/reportportal/ws/model/StartLaunchSerializerTest.java b/src/test/java/com/epam/ta/reportportal/ws/model/StartLaunchSerializerTest.java deleted file mode 100644 index c22a7857..00000000 --- a/src/test/java/com/epam/ta/reportportal/ws/model/StartLaunchSerializerTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.epam.ta.reportportal.ws.model; - -import com.epam.ta.reportportal.ws.model.launch.StartLaunchRQ; -import com.epam.ta.reportportal.ws.model.launch.StartLaunchRS; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author Pavel Bortnik - */ -public class StartLaunchSerializerTest { - - private ObjectMapper om = getObjectMapper(); - - @Test - public void testSerializerNotNull() throws JsonProcessingException { - String json = om.writeValueAsString(getLaunchRs()); - Assert.assertEquals("Incorrect serialization result", "{\"id\":\"1\"}", json); - } - - @Test - public void testSerializerFull() throws JsonProcessingException { - final StartLaunchRS startTestItem = getLaunchRs(); - startTestItem.setNumber(1L); - String json = om.writeValueAsString(startTestItem); - Assert.assertEquals("Incorrect serialization result", "{\"id\":\"1\",\"number\":1}", json); - } - - private StartLaunchRS getLaunchRs() { - StartLaunchRS rs = new StartLaunchRS(); - rs.setId("1"); - rs.setNumber(null); - return rs; - } - - private ObjectMapper getObjectMapper() { - ObjectMapper om = new ObjectMapper(); - om.configure(SerializationFeature.INDENT_OUTPUT, false); - return om; - } - -} diff --git a/src/test/java/com/epam/ta/reportportal/ws/model/StartTestItemSerializerTest.java b/src/test/java/com/epam/ta/reportportal/ws/model/StartTestItemSerializerTest.java deleted file mode 100644 index 950d774c..00000000 --- a/src/test/java/com/epam/ta/reportportal/ws/model/StartTestItemSerializerTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; - -/** - * Test Item custom serializer test - * - * @author Andrei Varabyeu - */ -public class StartTestItemSerializerTest { - - private ObjectMapper om = getObjectMapper(); - - private static final String START_ITEM_RQ = "{\"launchUuid\":\"1\",\"description\":\"description\",\"type\":\"LAUNCH\",\"retry\":false,\"hasStats\":true}"; - - @Test - public void testSerializer() throws JsonProcessingException { - String json = om.writeValueAsString(getStartTestItem()); - Assert.assertEquals("Incorrect serialization result", START_ITEM_RQ, json); - } - - @Test - public void testDeserializer() throws IOException { - StartTestItemRQ rq = om.readValue(START_ITEM_RQ, StartTestItemRQ.class); - Assert.assertEquals("Incorrect deserialization result", rq.getType(), "LAUNCH"); - } - - private StartTestItemRQ getStartTestItem() { - StartTestItemRQ startTestItem = new StartTestItemRQ(); - startTestItem.setDescription("description"); - startTestItem.setLaunchUuid("1"); - startTestItem.setType("launch"); - startTestItem.setRetry(false); - - return startTestItem; - } - - private ObjectMapper getObjectMapper() { - ObjectMapper om = new ObjectMapper(); - om.configure(SerializationFeature.INDENT_OUTPUT, false); - return om; - } -} \ No newline at end of file From f466951867483d48ff3a4dac160a85d327b8eb6b Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Tue, 27 Feb 2024 23:06:41 +0300 Subject: [PATCH 3/3] EPMRPP-89384 || Move classes to the reporting repo (#374) * EPMRPP-89384 || Move reporting classes to a separate directory * EPMRPP-89384 || Add project settings resource for reporting lib * EPMRPP-89384 || Move more model to reporting modul * EPMRPP-89384 || Move more model classes to reporting module * EPMRPP-89384 || Move model to the separate reporting lib * EPMRPP-89384 || Move more model classes --------- Co-authored-by: Pavel Bortnik --- .../ws/model/BulkInfoUpdateRQ.java | 91 ------------------- .../attribute/ItemAttributeResource.java | 90 ------------------ .../attribute/UpdateItemAttributeRQ.java | 58 ------------ 3 files changed, 239 deletions(-) delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java delete mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java deleted file mode 100644 index 8504fc97..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/BulkInfoUpdateRQ.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model; - -import com.epam.ta.reportportal.ws.model.attribute.UpdateItemAttributeRQ; -import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -/** - * @author Ihar Kahadouski - */ -public class BulkInfoUpdateRQ { - - @NotNull - @Size(min = 1) - private List ids; - - private Description description; - - @Valid - private List attributes; - - public List getIds() { - return ids; - } - - public void setIds(List ids) { - this.ids = ids; - } - - public Description getDescription() { - return description; - } - - public void setDescription(Description description) { - this.description = description; - } - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - public enum Action { - DELETE, - UPDATE, - CREATE - } - - public static class Description { - - String comment; - - Action action; - - public String getComment() { - return comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - - public Action getAction() { - return action; - } - - public void setAction(Action action) { - this.action = action; - } - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java deleted file mode 100644 index 956e0e5e..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/ItemAttributeResource.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.attribute; - -import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MIN_ITEM_ATTRIBUTE_VALUE_LENGTH; - -import java.io.Serializable; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; - -/** - * @author Ihar Kahadouski - */ -public class ItemAttributeResource implements Serializable { - - private String key; - - @NotBlank - @Size(min = MIN_ITEM_ATTRIBUTE_VALUE_LENGTH) - private String value; - - public ItemAttributeResource() { - } - - public ItemAttributeResource(String key, String value) { - this.key = key; - this.value = value; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public String toString() { - return "ItemAttributeResource{" + "key='" + key + '\'' - + ", value='" + value + '\'' - + '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - ItemAttributeResource that = (ItemAttributeResource) o; - - if (key != null ? !key.equals(that.key) : that.key != null) { - return false; - } - return value != null ? value.equals(that.value) : that.value == null; - } - - @Override - public int hashCode() { - int result = key != null ? key.hashCode() : 0; - result = 31 * result + (value != null ? value.hashCode() : 0); - return result; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java deleted file mode 100644 index 84e68ca9..00000000 --- a/src/main/java/com/epam/ta/reportportal/ws/model/attribute/UpdateItemAttributeRQ.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.ws.model.attribute; - -import com.epam.ta.reportportal.ws.model.BulkInfoUpdateRQ; -import javax.validation.Valid; - -/** - * @author Ihar Kahadouski - */ -public class UpdateItemAttributeRQ { - - @Valid - private ItemAttributeResource from; - - @Valid - private ItemAttributeResource to; - - private BulkInfoUpdateRQ.Action action; - - public ItemAttributeResource getFrom() { - return from; - } - - public void setFrom(ItemAttributeResource from) { - this.from = from; - } - - public ItemAttributeResource getTo() { - return to; - } - - public void setTo(ItemAttributeResource to) { - this.to = to; - } - - public BulkInfoUpdateRQ.Action getAction() { - return action; - } - - public void setAction(BulkInfoUpdateRQ.Action action) { - this.action = action; - } -}