com.testdroid.api.model.APITestCaseRunStep Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testdroid-api Show documentation
Show all versions of testdroid-api Show documentation
The Testdroid API library for Java
The newest version!
package com.testdroid.api.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.testdroid.api.APIEntity;
import com.testdroid.api.APIList;
import jakarta.xml.bind.annotation.XmlType;
/**
* @author Slawomir Pawluk
*/
public class APITestCaseRunStep extends APIEntity {
@XmlType(namespace = "APITestCaseRunStep")
public enum Type {
ASSERTION,
CLICK,
CONFIG,
DRAG,
HTTP,
INPUT,
NAVIGATION,
OTHER,
SCROLL,
UTIL,
WAIT
}
private String description;
private Long duration;
private String errorMessage;
private String fromActivity;
private APIList screenshots;
private Type type;
private String httpMethod;
private int responseCode;
private long timestamp;
private String requestBody;
private String responseBody;
private String uri;
public APITestCaseRunStep() {
}
public APITestCaseRunStep(
Long id, String description, String fromActivity, String errorMessage, Long duration, String type) {
super(id);
this.description = description;
this.fromActivity = fromActivity;
this.errorMessage = errorMessage;
this.duration = duration;
this.type = APITestCaseRunStep.Type.valueOf(type.toUpperCase());
}
@SuppressWarnings("squid:S107")
public APITestCaseRunStep(
Long id, Long duration, String httpMethod, int responseCode, long timestamp, String requestBody,
String responseBody, String uri) {
super(id);
this.description = String.format("%s - %s", httpMethod, uri);
this.duration = duration;
this.type = Type.HTTP;
this.httpMethod = httpMethod;
this.responseCode = responseCode;
this.timestamp = timestamp;
this.requestBody = requestBody;
this.responseBody = responseBody;
this.uri = uri;
this.screenshots = new APIList<>();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getFromActivity() {
return fromActivity;
}
public void setFromActivity(String fromActivity) {
this.fromActivity = fromActivity;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Long getDuration() {
return duration;
}
public void setDuration(Long duration) {
this.duration = duration;
}
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public String getHttpMethod() {
return httpMethod;
}
public void setHttpMethod(String httpMethod) {
this.httpMethod = httpMethod;
}
public int getResponseCode() {
return responseCode;
}
public void setResponseCode(int responseCode) {
this.responseCode = responseCode;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public String getRequestBody() {
return requestBody;
}
public void setRequestBody(String requestBody) {
this.requestBody = requestBody;
}
public String getResponseBody() {
return responseBody;
}
public void setResponseBody(String responseBody) {
this.responseBody = responseBody;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public APIList getScreenshots() {
return screenshots;
}
public void setScreenshots(APIList screenshots) {
this.screenshots = screenshots;
}
@Override
@JsonIgnore
protected void clone(T from) {
APITestCaseRunStep apiTestCaseRunStep = (APITestCaseRunStep) from;
cloneBase(from);
this.description = apiTestCaseRunStep.description;
this.duration = apiTestCaseRunStep.duration;
this.errorMessage = apiTestCaseRunStep.errorMessage;
this.fromActivity = apiTestCaseRunStep.fromActivity;
this.screenshots = apiTestCaseRunStep.screenshots;
this.type = apiTestCaseRunStep.type;
this.httpMethod = apiTestCaseRunStep.httpMethod;
this.responseCode = apiTestCaseRunStep.responseCode;
this.timestamp = apiTestCaseRunStep.timestamp;
this.requestBody = apiTestCaseRunStep.requestBody;
this.responseBody = apiTestCaseRunStep.responseBody;
this.uri = apiTestCaseRunStep.uri;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy