Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-88461 switch to LocalDateTime #370

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 37 additions & 129 deletions src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,153 +20,61 @@
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.time.LocalDateTime;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
* JSON Representation of Report Portal's Activity domain object.
*
* @see <a href="http://en.wikipedia.org/wiki/HATEOAS">HATEOAS Description</a>
*/
@JsonInclude(Include.NON_NULL)
@Data
public class ActivityResource {

@NotNull
@JsonProperty(value = "id", required = true)
@ApiModelProperty(required = true)
private Long id;
@NotNull
@JsonProperty(value = "id", required = true)
@ApiModelProperty(required = true)
private Long id;

@NotNull
@JsonProperty(value = "user", required = true)
@ApiModelProperty(required = true)
private String user;
@NotNull
@JsonProperty(value = "user", required = true)
@ApiModelProperty(required = true)
private String user;

@NotNull
@JsonProperty(value = "loggedObjectId", required = true)
@ApiModelProperty(required = true)
private Long loggedObjectId;
@NotNull
@JsonProperty(value = "loggedObjectId", required = true)
@ApiModelProperty(required = true)
private Long loggedObjectId;

@NotNull
@JsonProperty(value = "lastModified", required = true)
@ApiModelProperty(required = true)
private Date lastModified;
@NotNull
@JsonProperty(value = "lastModified", required = true)
@ApiModelProperty(required = true)
private LocalDateTime lastModified;

@NotNull
@JsonProperty(value = "actionType", required = true)
@ApiModelProperty(required = true)
private String actionType;
@NotNull
@JsonProperty(value = "actionType", required = true)
@ApiModelProperty(required = true)
private String actionType;

@NotNull
@JsonProperty(value = "objectType", required = true)
@ApiModelProperty(required = true)
private String objectType;
@NotNull
@JsonProperty(value = "objectType", required = true)
@ApiModelProperty(required = true)
private String objectType;

@NotNull
@JsonProperty(value = "projectId", required = true)
@ApiModelProperty(required = true)
private Long projectId;
@NotNull
@JsonProperty(value = "projectId", required = true)
@ApiModelProperty(required = true)
private Long projectId;

@JsonProperty(value = "projectName")
private String projectName;
@JsonProperty(value = "projectName")
private String projectName;

@JsonProperty(value = "details")
private Object details;
@JsonProperty(value = "details")
private Object details;

@JsonProperty(value = "objectName")
private String objectName;
@JsonProperty(value = "objectName")
private String objectName;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getUser() {
return user;
}

public void setUser(String user) {
this.user = user;
}

public Long getLoggedObjectId() {
return loggedObjectId;
}

public void setLoggedObjectId(Long loggedObjectId) {
this.loggedObjectId = loggedObjectId;
}

public Date getLastModified() {
return lastModified;
}

public void setLastModified(Date lastModified) {
this.lastModified = lastModified;
}

public String getActionType() {
return actionType;
}

public void setActionType(String actionType) {
this.actionType = actionType;
}

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 Object getDetails() {
return details;
}

public void setDetails(Object details) {
this.details = details;
}

public String getObjectName() {
return objectName;
}

public void setObjectName(String objectName) {
this.objectName = objectName;
}

@Override
public String toString() {
return "ActivityResource{" + "id=" + id
+ ", user='" + user + '\''
+ ", loggedObjectId='" + loggedObjectId + '\''
+ ", lastModified=" + lastModified
+ ", actionType='" + actionType + '\''
+ ", objectType='" + objectType + '\''
+ ", projectId=" + projectId
+ ", projectName='" + projectName + '\''
+ ", objectName='" + objectName + '\''
+ ", details=" + details
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,91 +16,50 @@

package com.epam.ta.reportportal.ws.model;

import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MAX_PARAMETERS_LENGTH;

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.annotations.ApiModelProperty;

import java.time.LocalDateTime;
import java.util.Set;
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;
import lombok.Data;

/**
* Finishes some entity execution in Report Portal<br>
* May be Launch, TestSuite, Test, TestStep
* Finishes some entity execution in Report Portal<br> May be Launch, TestSuite, Test, TestStep
*
* @author Andrei Varabyeu
*/
@JsonInclude(Include.NON_NULL)
@Data
public class FinishExecutionRQ {

@NotNull
@JsonProperty(value = "endTime", required = true)
@JsonAlias({ "endTime", "end_time" })
@ApiModelProperty(required = true)
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")
private String status;

@JsonProperty(value = "description")
private String description;

@Size(max = MAX_PARAMETERS_LENGTH)
@Valid
@JsonProperty
@JsonAlias({ "attributes", "tags" })
private Set<ItemAttributesRQ> attributes;

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public Set<ItemAttributesRQ> getAttributes() {
return attributes;
}

public void setAttributes(Set<ItemAttributesRQ> attributes) {
this.attributes = attributes;
}

public Date getEndTime() {
return endTime;
}
@NotNull
@JsonProperty(value = "endTime", required = true)
@JsonAlias({"endTime", "end_time"})
@ApiModelProperty(required = true)
private LocalDateTime endTime;

public void setEndTime(Date endTime) {
this.endTime = endTime;
}
@JsonProperty(value = "status")
@In(allowedValues = {"passed", "failed", "stopped", "skipped", "interrupted", "cancelled", "info",
"warn"})
@ApiModelProperty(allowableValues = "PASSED, FAILED, STOPPED, SKIPPED, INTERRUPTED, CANCELLED, INFO, WARN")
private String status;

public String getStatus() {
return status;
}
@JsonProperty(value = "description")
private String description;

public void setStatus(String status) {
this.status = status;
}
@Size(max = MAX_PARAMETERS_LENGTH)
@Valid
@JsonProperty
@JsonAlias({"attributes", "tags"})
private Set<ItemAttributesRQ> attributes;

@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();
}
}
}
Loading
Loading