From 23b933d86728047320b86f09e9da1288d68ce7a8 Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Fri, 15 Dec 2023 15:40:38 +0300 Subject: [PATCH] Release 5.11.0 (#367) * EPMRPP-86199 || Add common not found error * EPMRPP-86199 || Add common not found error * Add common not found Error (#352) * EPMRPP-86199 || Add common not found error * EPMRPP-86199 || Add common not found error * EPMRPP-86221 || Fix missed fields * EPMRPP-86250 || Update Analyzer settings. Provide the base for analysis: Current launch and Current launch+previous * EPMRPP-86742 add lombok support (#355) EPMRPP-86742 extended response for launch import * EPMRPP-86743 || Add new launch import rq (#356) * EPMRPP-86743 || Add new launch import rq * EPMRPP-86743 || Remove start time constraint * EPMRPP-86743 || Add author * EPMRPP-87332 || Send launchNumber to analyzer * EPMRPP-87316 || Update PostFromField model (#358) * EPMRPP-87316 || Update post form fields * EPMRPP-87316 || Add command name to PostFormField * EPMRPP-87316 || Add command name to PostFormField * EPMRPP-87316 || Update named value object * EPMRPP-87493 || Add description of the field (#360) * EPMRPP-87271 added ActivityEventResource.subjectId field (#359) * EPMRPP-87271 added ActivityEventResource.subjectId field * rc/5.11.0 || Update version --------- Co-authored-by: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Co-authored-by: Andrei Piankouski Co-authored-by: APiankouski <109206864+APiankouski@users.noreply.github.com> Co-authored-by: Ivan Co-authored-by: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> --- build.gradle | 5 + gradle.properties | 3 +- .../ws/model/ActivityEventResource.java | 193 +-------------- .../ta/reportportal/ws/model/ErrorType.java | 21 +- .../ws/model/LaunchImportCompletionRS.java | 41 ++++ .../ws/model/LaunchImportData.java | 47 ++++ .../ws/model/ValidationConstraints.java | 1 + .../ws/model/analyzer/IndexLaunch.java | 11 + .../ws/model/externalsystem/NamedValue.java | 16 ++ .../model/externalsystem/PostFormField.java | 229 +++++++----------- .../ws/model/launch/AnalyzeLaunchRQ.java | 4 +- .../ws/model/launch/LaunchImportRQ.java | 57 +++++ .../ws/model/project/AnalyzerConfig.java | 4 +- .../ws/model/project/email/SenderCaseDTO.java | 30 ++- 14 files changed, 319 insertions(+), 343 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportCompletionRS.java create mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportData.java create mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/NamedValue.java create mode 100644 src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchImportRQ.java diff --git a/build.gradle b/build.gradle index e5c47b44..fe597305 100644 --- a/build.gradle +++ b/build.gradle @@ -47,6 +47,11 @@ dependencies { compile "org.apache.commons:commons-lang3:${commonsLangVersion}" compile group: 'com.google.guava', name: 'guava', version: '28.2-jre' + // add lombok support + compileOnly "org.projectlombok:lombok:${lombokVersion}" + annotationProcessor "org.projectlombok:lombok:${lombokVersion}" + testCompileOnly "org.projectlombok:lombok:${lombokVersion}" + testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}" testImplementation "junit:junit:${junitVersion}" testImplementation "org.mockito:mockito-junit-jupiter:${mockitoJunitJupiter}" diff --git a/gradle.properties b/gradle.properties index 631447e9..0b58ea7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=5.10.1 +version=5.11.0 description=EPAM Report portal. REST API model hibernateValidatorVersion=6.1.2.Final validationApiVersion=2.0.1.Final @@ -8,3 +8,4 @@ swaggerAnnotationsVersion=1.6.0 commonsLangVersion=3.9 mockitoJunitJupiter=2.23.0 jacksonVersion=2.10.2 +lombokVersion=1.18.30 diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/ActivityEventResource.java b/src/main/java/com/epam/ta/reportportal/ws/model/ActivityEventResource.java index 0710060f..076b90eb 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ActivityEventResource.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/ActivityEventResource.java @@ -23,6 +23,10 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; import javax.validation.constraints.NotNull; +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; /** * JSON Representation of Report Portal's Activity domain object. @@ -30,6 +34,10 @@ * @author Ryhor_Kukharenka */ @JsonInclude(Include.NON_NULL) +@Getter +@Setter +@Builder +@ToString public class ActivityEventResource { @NotNull @@ -79,187 +87,12 @@ public class ActivityEventResource { @ApiModelProperty(required = true) private String subjectType; + @NotNull + @JsonProperty(value = "subject_id", required = true) + @ApiModelProperty(required = true) + private String subjectId; + @JsonProperty(value = "details") private Object details; - private ActivityEventResource() { - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - - public String getEventName() { - return eventName; - } - - public void setEventName(String eventName) { - this.eventName = eventName; - } - - public Long getObjectId() { - return objectId; - } - - public void setObjectId(Long objectId) { - this.objectId = objectId; - } - - public String getObjectName() { - return objectName; - } - - public void setObjectName(String objectName) { - this.objectName = objectName; - } - - public String getObjectType() { - return objectType; - } - - public void setObjectType(String objectType) { - this.objectType = objectType; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getSubjectName() { - return subjectName; - } - - public void setSubjectName(String subjectName) { - this.subjectName = subjectName; - } - - public String getSubjectType() { - return subjectType; - } - - public void setSubjectType(String subjectType) { - this.subjectType = subjectType; - } - - public Object getDetails() { - return details; - } - - public void setDetails(Object details) { - this.details = details; - } - - @Override - public String toString() { - return "ActivityEventResource{" + "id=" + id - + ", createdAt=" + createdAt + ", eventName='" + eventName - + '\'' + ", objectId=" + objectId + ", objectName='" - + objectName + '\'' + ", objectType='" + objectType + '\'' - + ", projectId=" + projectId + ", projectName='" + projectName - + '\'' + ", subjectName='" + subjectName + '\'' - + ", subjectType='" + subjectType + '\'' + ", details=" - + details + '}'; - } - - public static ActivityEventResourceBuilder builder() { - return new ActivityEventResourceBuilder(); - } - - /** - * Activity Event Resource builder. - * - * @author Ryhor_Kukharenka - */ - public static class ActivityEventResourceBuilder { - - private final ActivityEventResource activityEventResource; - - private ActivityEventResourceBuilder() { - activityEventResource = new ActivityEventResource(); - } - - public ActivityEventResourceBuilder id(Long id) { - activityEventResource.id = id; - return this; - } - - public ActivityEventResourceBuilder createdAt(Date createdAt) { - activityEventResource.createdAt = createdAt; - return this; - } - - public ActivityEventResourceBuilder eventName(String eventName) { - activityEventResource.eventName = eventName; - return this; - } - - public ActivityEventResourceBuilder objectId(Long objectId) { - activityEventResource.objectId = objectId; - return this; - } - - public ActivityEventResourceBuilder objectName(String objectName) { - activityEventResource.objectName = objectName; - return this; - } - - public ActivityEventResourceBuilder objectType(String objectType) { - activityEventResource.objectType = objectType; - return this; - } - - public ActivityEventResourceBuilder projectId(Long projectId) { - activityEventResource.projectId = projectId; - return this; - } - - public ActivityEventResourceBuilder projectName(String projectName) { - activityEventResource.projectName = projectName; - return this; - } - - public ActivityEventResourceBuilder subjectName(String subjectName) { - activityEventResource.subjectName = subjectName; - return this; - } - - public ActivityEventResourceBuilder subjectType(String subjectType) { - activityEventResource.subjectType = subjectType; - return this; - } - - public ActivityEventResourceBuilder details(Object details) { - activityEventResource.details = details; - return this; - } - - public ActivityEventResource build() { - return activityEventResource; - } - } - } 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 index c6f9000a..09d024d5 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ErrorType.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/ErrorType.java @@ -24,24 +24,24 @@ public enum ErrorType { /** - * Access Denied + * Incorrect Report Portal WS Request */ - ADDRESS_LOCKED(4004, "Address is locked due to several incorrect login attempts"), + INCORRECT_REQUEST(4001, "Incorrect Request. {}"), /** - * Access Denied + * Incorrect Report Portal WS Request */ - ACCESS_DENIED(4003, "You do not have enough permissions. {}"), + BINARY_DATA_CANNOT_BE_SAVED(4002, "Binary data cannot be saved. {}"), /** - * Incorrect Report Portal WS Request + * Access Denied */ - INCORRECT_REQUEST(4001, "Incorrect Request. {}"), + ACCESS_DENIED(4003, "You do not have enough permissions. {}"), /** - * Incorrect Report Portal WS Request + * Access Denied */ - BINARY_DATA_CANNOT_BE_SAVED(4002, "Binary data cannot be saved. {}"), + ADDRESS_LOCKED(4004, "Address is locked due to several incorrect login attempts"), /** * If specified by id Project or by ProjectName not found @@ -189,6 +189,11 @@ public enum ErrorType { */ 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 */ diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportCompletionRS.java b/src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportCompletionRS.java new file mode 100644 index 00000000..022184a2 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportCompletionRS.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 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 lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +/** + * Operation completion response for launch import. + * + * @author Siarhei Hrabko + */ +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class LaunchImportCompletionRS extends OperationCompletionRS { + + @JsonProperty(value = "data") + private LaunchImportData data; + +} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportData.java b/src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportData.java new file mode 100644 index 00000000..dcc18b77 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/ws/model/LaunchImportData.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 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 lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +/** + * Operation completion response extension for launch import. + * + * @author Siarhei Hrabko + */ +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class LaunchImportData { + + @JsonProperty("id") + private String id; + + @JsonProperty("name") + private String name; + + @JsonProperty("number") + private Long number; + +} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/ValidationConstraints.java b/src/main/java/com/epam/ta/reportportal/ws/model/ValidationConstraints.java index f77b7dba..bc8d871c 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/ValidationConstraints.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/ValidationConstraints.java @@ -25,6 +25,7 @@ public class ValidationConstraints { /* 1 always exists as predefined type */ + public static final int MAX_ISSUE_TYPES_AND_SUBTYPES = 75; public static final int MAX_ISSUE_SUBTYPES = 15; public static final int MIN_COLLECTION_SIZE = 1; public static final int MAX_NUMBER_OF_FILTER_ENTITIES = 20; 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 03648990..d0f4f9d3 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 @@ -53,6 +53,9 @@ public class IndexLaunch { @JsonProperty("clusters") private Map clusters; + @JsonProperty("launchNumber") + private Long launchNumber; + public IndexLaunch() { } @@ -111,4 +114,12 @@ public Map getClusters() { public void setClusters(Map clusters) { this.clusters = clusters; } + + public Long getLaunchNumber() { + return launchNumber; + } + + public void setLaunchNumber(Long launchNumber) { + this.launchNumber = launchNumber; + } } diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/NamedValue.java b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/NamedValue.java new file mode 100644 index 00000000..c79dd5d0 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/NamedValue.java @@ -0,0 +1,16 @@ +package com.epam.ta.reportportal.ws.model.externalsystem; + +import java.io.Serializable; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Represents value that consists of id for making request and human readable name + */ +@Data +@NoArgsConstructor +public class NamedValue implements Serializable { + + private Long id; + private String name; +} diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java index 0ca97c82..0fb97151 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java @@ -12,166 +12,101 @@ * 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 java.io.Serializable; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; /** * Basic representation of single post ticket form field
- * + *

* NOTE: representation based on JIRA post ticket form - * + * * @author Andrei_Ramanchuk */ +@Builder +@Data +@AllArgsConstructor +@NoArgsConstructor @JsonInclude(Include.NON_NULL) public class PostFormField implements Comparable, Serializable { - /** - * Field name on JIRA form - */ - @JsonProperty(value = "fieldName") - private String fieldName; - - /** - * Field ID for post ticket request in JIRA - */ - @JsonProperty(value = "id", required = true) - private String id; - - /** - * Field type for UI representation for user - */ - @JsonProperty(value = "fieldType") - private String fieldType; - - /** - * Is field required for ticket post - */ - @JsonProperty(value = "required", required = true) - private boolean isRequired; - - /** - * Field value(s) - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** - * Values for fields with pre-defined set - */ - @JsonProperty(value = "definedValues") - private List definedValues; - - public PostFormField() { - } - - public PostFormField(String id, String name, String type, boolean isReq, List values, List defValues) { - this.id = id; - this.fieldName = name; - this.fieldType = type; - this.isRequired = isReq; - this.value = values; - this.definedValues = defValues; - } - - public void setFieldName(String name) { - this.fieldName = name; - } - - public String getFieldName() { - return fieldName; - } - - public void setId(String value) { - this.id = value; - } - - public String getId() { - return id; - } - - public void setFieldType(String type) { - this.fieldType = type; - } - - public String getFieldType() { - return fieldType; - } - - public void setIsRequired(boolean value) { - this.isRequired = value; - } - - public boolean getIsRequired() { - return isRequired; - } - - public void setValue(List value) { - this.value = value; - } - - public List getValue() { - return value; - } - - public List getDefinedValues() { - return definedValues; - } - - public void setDefinedValues(List values) { - this.definedValues = values; - } - - @Override - public String toString() { - return "PostFormField{" + "fieldName='" + fieldName + '\'' + ", id='" + id + '\'' + ", fieldType='" + fieldType + '\'' - + ", isRequired=" + isRequired + ", value=" + value + ", definedValues=" + definedValues + '}'; - } - - @Override - public int compareTo(PostFormField field) { - Boolean current = this.isRequired; - Boolean byField = field.isRequired; - return byField.compareTo(current); - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - PostFormField that = (PostFormField) o; - - if (isRequired != that.isRequired) - return false; - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) - return false; - if (id != null ? !id.equals(that.id) : that.id != null) - return false; - if (fieldType != null ? !fieldType.equals(that.fieldType) : that.fieldType != null) - return false; - if (value != null ? !value.equals(that.value) : that.value != null) - return false; - return definedValues != null ? definedValues.equals(that.definedValues) : that.definedValues == null; - } - - @Override - public int hashCode() { - int result = fieldName != null ? fieldName.hashCode() : 0; - result = 31 * result + (id != null ? id.hashCode() : 0); - result = 31 * result + (fieldType != null ? fieldType.hashCode() : 0); - result = 31 * result + (isRequired ? 1 : 0); - result = 31 * result + (value != null ? value.hashCode() : 0); - result = 31 * result + (definedValues != null ? definedValues.hashCode() : 0); - return result; - } + /** + * Field name on JIRA form + */ + @JsonProperty(value = "fieldName") + private String fieldName; + + /** + * Filed description + */ + @JsonProperty(value = "description") + private String description; + + /** + * Field ID for post ticket request in JIRA + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Field type for UI representation for user + */ + @JsonProperty(value = "fieldType") + private String fieldType; + + /** + * Is field required for ticket post + */ + @JsonProperty(value = "required", required = true) + private boolean isRequired; + + /** + * Field value(s) + */ + @JsonProperty(value = "value") + private List value; + + /** + * id - name representation of value + */ + @JsonProperty(value = "namedValue") + private List namedValue; + + /** + * Command name that can be executed in plugin for current field + */ + @JsonProperty(value = "commandName") + private String commandName; + + /** + * Values for fields with pre-defined set + */ + @JsonProperty(value = "definedValues") + private List definedValues; + + public PostFormField(String id, String fieldName, String fieldType, boolean isRequired, + String commandName) { + this.id = id; + this.fieldName = fieldName; + this.fieldType = fieldType; + this.isRequired = isRequired; + this.commandName = commandName; + } + + @Override + public int compareTo(PostFormField field) { + Boolean current = this.isRequired; + Boolean byField = field.isRequired; + return byField.compareTo(current); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/AnalyzeLaunchRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/AnalyzeLaunchRQ.java index 3a476771..63a86b94 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/launch/AnalyzeLaunchRQ.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/launch/AnalyzeLaunchRQ.java @@ -37,8 +37,8 @@ public class AnalyzeLaunchRQ { @NotNull @JsonProperty(value = "analyzerMode", required = true) - @In(allowedValues = { "all", "launch_name", "current_launch" }) - @ApiModelProperty(allowableValues = "ALL, LAUNCH_NAME, CURRENT_LAUNCH") + @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") private String analyzerHistoryMode; @NotNull diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchImportRQ.java b/src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchImportRQ.java new file mode 100644 index 00000000..8259b365 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/ws/model/launch/LaunchImportRQ.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 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 static com.epam.ta.reportportal.ws.model.ValidationConstraints.MAX_PARAMETERS_LENGTH; + +import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ; +import com.fasterxml.jackson.annotation.JsonAlias; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import java.util.Set; +import javax.validation.Valid; +import javax.validation.constraints.Size; +import lombok.Data; + +/** + * @author Pavel Bortnik + */ +@Data +public class LaunchImportRQ { + + @JsonProperty(value = "name") + @ApiModelProperty + protected String name; + + @JsonProperty(value = "description") + private String description; + + @Size(max = MAX_PARAMETERS_LENGTH) + @Valid + @JsonProperty("attributes") + @JsonAlias({"attributes", "tags"}) + private Set attributes; + + @JsonProperty + @JsonAlias({"startTime", "start_time"}) + @ApiModelProperty + private Date startTime; + + @JsonProperty("mode") + private Mode mode; +} 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 804935ec..4f1314ac 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 @@ -51,8 +51,8 @@ public class AnalyzerConfig { private Boolean isAutoAnalyzerEnabled; @JsonProperty(value = "analyzerMode") - @In(allowedValues = { "all", "launch_name", "current_launch" }) - @ApiModelProperty(allowableValues = "ALL, LAUNCH_NAME") + @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") private String analyzerMode; @JsonProperty(value = "indexingRunning") diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/project/email/SenderCaseDTO.java b/src/main/java/com/epam/ta/reportportal/ws/model/project/email/SenderCaseDTO.java index 557fff7b..ddc3b423 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/project/email/SenderCaseDTO.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/project/email/SenderCaseDTO.java @@ -44,6 +44,13 @@ public class SenderCaseDTO implements Serializable { */ private static final long serialVersionUID = -3546546654348861010L; + @JsonProperty("id") + private Long id; + + @NotEmpty + @JsonProperty("ruleName") + private String ruleName; + @NotEmpty @NotBlankStringCollection @JsonProperty(value = "recipients") @@ -75,17 +82,34 @@ public class SenderCaseDTO implements Serializable { public SenderCaseDTO() { } - public SenderCaseDTO(List recs, String sendMode, List laNames, Set attributes, boolean enabled, - String attributesOperator) { + public SenderCaseDTO(Long id, String ruleName, List recs, String sendMode, + List laNames, Set attributes, boolean enabled) { + this.id = id; + this.ruleName = ruleName; this.recipients = recs; this.sendCase = sendMode; this.launchNames = laNames; this.attributes = attributes; this.enabled = enabled; - this.attributesOperator = attributesOperator; } /* Getters and setters block */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + public void setRecipients(List recipients) { this.recipients = recipients; }