org.openmetadata.schema.api.tests.CreateTestCase Maven / Gradle / Ivy
package org.openmetadata.schema.api.tests;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.processing.Generated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.openmetadata.schema.CreateEntity;
import org.openmetadata.schema.tests.TestCaseParameterValue;
import org.openmetadata.schema.type.EntityReference;
/**
* CreateTestCaseRequest
*
* Test is a test definition to capture data quality tests.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"name",
"description",
"displayName",
"testDefinition",
"entityLink",
"testSuite",
"parameterValues",
"owners",
"computePassedFailedRowCount",
"useDynamicAssertion"
})
@Generated("jsonschema2pojo")
public class CreateTestCase implements CreateEntity
{
/**
* Name that identifies a test definition and test case.
* (Required)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Name that identifies a test definition and test case.")
@Pattern(regexp = "^((?!::).)*$")
@Size(min = 1)
@NotNull
private String name;
/**
* Text in Markdown format.@om-field-type
*
*/
@JsonProperty("description")
@JsonPropertyDescription("Text in Markdown format.")
private String description;
/**
* Display Name that identifies this test.
*
*/
@JsonProperty("displayName")
@JsonPropertyDescription("Display Name that identifies this test.")
private String displayName;
/**
* A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.
* (Required)
*
*/
@JsonProperty("testDefinition")
@JsonPropertyDescription("A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.")
@Size(min = 1, max = 3072)
@NotNull
private String testDefinition;
/**
* Link to an entity or field within an entity using this format `<#E::{entities}::{entityType}::{field}::{arrayFieldName}::{arrayFieldValue}`.
* (Required)
*
*/
@JsonProperty("entityLink")
@JsonPropertyDescription("Link to an entity or field within an entity using this format `<#E::{entities}::{entityType}::{field}::{arrayFieldName}::{arrayFieldValue}`.")
@Pattern(regexp = "(?U)^<#E::\\w+::[\\w'\\- .&/:+\"\\\\()$#%]+>$")
@NotNull
private String entityLink;
/**
* A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.
* (Required)
*
*/
@JsonProperty("testSuite")
@JsonPropertyDescription("A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.")
@Size(min = 1, max = 3072)
@NotNull
private String testSuite;
@JsonProperty("parameterValues")
@Valid
private List parameterValues = new ArrayList();
/**
* Entity Reference List
*
* This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database.
*
*/
@JsonProperty("owners")
@JsonPropertyDescription("This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database.")
@Valid
private List owners = null;
/**
* Compute the passed and failed row count for the test case.
*
*/
@JsonProperty("computePassedFailedRowCount")
@JsonPropertyDescription("Compute the passed and failed row count for the test case.")
private Boolean computePassedFailedRowCount = false;
/**
* If the test definition supports it, use dynamic assertion to evaluate the test case.
*
*/
@JsonProperty("useDynamicAssertion")
@JsonPropertyDescription("If the test definition supports it, use dynamic assertion to evaluate the test case.")
private Boolean useDynamicAssertion = false;
/**
* Name that identifies a test definition and test case.
* (Required)
*
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* Name that identifies a test definition and test case.
* (Required)
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
public CreateTestCase withName(String name) {
this.name = name;
return this;
}
/**
* Text in Markdown format.@om-field-type
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* Text in Markdown format.@om-field-type
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
public CreateTestCase withDescription(String description) {
this.description = description;
return this;
}
/**
* Display Name that identifies this test.
*
*/
@JsonProperty("displayName")
public String getDisplayName() {
return displayName;
}
/**
* Display Name that identifies this test.
*
*/
@JsonProperty("displayName")
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public CreateTestCase withDisplayName(String displayName) {
this.displayName = displayName;
return this;
}
/**
* A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.
* (Required)
*
*/
@JsonProperty("testDefinition")
public String getTestDefinition() {
return testDefinition;
}
/**
* A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.
* (Required)
*
*/
@JsonProperty("testDefinition")
public void setTestDefinition(String testDefinition) {
this.testDefinition = testDefinition;
}
public CreateTestCase withTestDefinition(String testDefinition) {
this.testDefinition = testDefinition;
return this;
}
/**
* Link to an entity or field within an entity using this format `<#E::{entities}::{entityType}::{field}::{arrayFieldName}::{arrayFieldValue}`.
* (Required)
*
*/
@JsonProperty("entityLink")
public String getEntityLink() {
return entityLink;
}
/**
* Link to an entity or field within an entity using this format `<#E::{entities}::{entityType}::{field}::{arrayFieldName}::{arrayFieldValue}`.
* (Required)
*
*/
@JsonProperty("entityLink")
public void setEntityLink(String entityLink) {
this.entityLink = entityLink;
}
public CreateTestCase withEntityLink(String entityLink) {
this.entityLink = entityLink;
return this;
}
/**
* A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.
* (Required)
*
*/
@JsonProperty("testSuite")
public String getTestSuite() {
return testSuite;
}
/**
* A unique name that identifies an entity. Example for table 'DatabaseService.Database.Schema.Table'.
* (Required)
*
*/
@JsonProperty("testSuite")
public void setTestSuite(String testSuite) {
this.testSuite = testSuite;
}
public CreateTestCase withTestSuite(String testSuite) {
this.testSuite = testSuite;
return this;
}
@JsonProperty("parameterValues")
public List getParameterValues() {
return parameterValues;
}
@JsonProperty("parameterValues")
public void setParameterValues(List parameterValues) {
this.parameterValues = parameterValues;
}
public CreateTestCase withParameterValues(List parameterValues) {
this.parameterValues = parameterValues;
return this;
}
/**
* Entity Reference List
*
* This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database.
*
*/
@JsonProperty("owners")
public List getOwners() {
return owners;
}
/**
* Entity Reference List
*
* This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database.
*
*/
@JsonProperty("owners")
public void setOwners(List owners) {
this.owners = owners;
}
public CreateTestCase withOwners(List owners) {
this.owners = owners;
return this;
}
/**
* Compute the passed and failed row count for the test case.
*
*/
@JsonProperty("computePassedFailedRowCount")
public Boolean getComputePassedFailedRowCount() {
return computePassedFailedRowCount;
}
/**
* Compute the passed and failed row count for the test case.
*
*/
@JsonProperty("computePassedFailedRowCount")
public void setComputePassedFailedRowCount(Boolean computePassedFailedRowCount) {
this.computePassedFailedRowCount = computePassedFailedRowCount;
}
public CreateTestCase withComputePassedFailedRowCount(Boolean computePassedFailedRowCount) {
this.computePassedFailedRowCount = computePassedFailedRowCount;
return this;
}
/**
* If the test definition supports it, use dynamic assertion to evaluate the test case.
*
*/
@JsonProperty("useDynamicAssertion")
public Boolean getUseDynamicAssertion() {
return useDynamicAssertion;
}
/**
* If the test definition supports it, use dynamic assertion to evaluate the test case.
*
*/
@JsonProperty("useDynamicAssertion")
public void setUseDynamicAssertion(Boolean useDynamicAssertion) {
this.useDynamicAssertion = useDynamicAssertion;
}
public CreateTestCase withUseDynamicAssertion(Boolean useDynamicAssertion) {
this.useDynamicAssertion = useDynamicAssertion;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(CreateTestCase.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("name");
sb.append('=');
sb.append(((this.name == null)?"":this.name));
sb.append(',');
sb.append("description");
sb.append('=');
sb.append(((this.description == null)?"":this.description));
sb.append(',');
sb.append("displayName");
sb.append('=');
sb.append(((this.displayName == null)?"":this.displayName));
sb.append(',');
sb.append("testDefinition");
sb.append('=');
sb.append(((this.testDefinition == null)?"":this.testDefinition));
sb.append(',');
sb.append("entityLink");
sb.append('=');
sb.append(((this.entityLink == null)?"":this.entityLink));
sb.append(',');
sb.append("testSuite");
sb.append('=');
sb.append(((this.testSuite == null)?"":this.testSuite));
sb.append(',');
sb.append("parameterValues");
sb.append('=');
sb.append(((this.parameterValues == null)?"":this.parameterValues));
sb.append(',');
sb.append("owners");
sb.append('=');
sb.append(((this.owners == null)?"":this.owners));
sb.append(',');
sb.append("computePassedFailedRowCount");
sb.append('=');
sb.append(((this.computePassedFailedRowCount == null)?"":this.computePassedFailedRowCount));
sb.append(',');
sb.append("useDynamicAssertion");
sb.append('=');
sb.append(((this.useDynamicAssertion == null)?"":this.useDynamicAssertion));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.computePassedFailedRowCount == null)? 0 :this.computePassedFailedRowCount.hashCode()));
result = ((result* 31)+((this.displayName == null)? 0 :this.displayName.hashCode()));
result = ((result* 31)+((this.testSuite == null)? 0 :this.testSuite.hashCode()));
result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode()));
result = ((result* 31)+((this.useDynamicAssertion == null)? 0 :this.useDynamicAssertion.hashCode()));
result = ((result* 31)+((this.entityLink == null)? 0 :this.entityLink.hashCode()));
result = ((result* 31)+((this.owners == null)? 0 :this.owners.hashCode()));
result = ((result* 31)+((this.testDefinition == null)? 0 :this.testDefinition.hashCode()));
result = ((result* 31)+((this.parameterValues == null)? 0 :this.parameterValues.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof CreateTestCase) == false) {
return false;
}
CreateTestCase rhs = ((CreateTestCase) other);
return (((((((((((this.computePassedFailedRowCount == rhs.computePassedFailedRowCount)||((this.computePassedFailedRowCount!= null)&&this.computePassedFailedRowCount.equals(rhs.computePassedFailedRowCount)))&&((this.displayName == rhs.displayName)||((this.displayName!= null)&&this.displayName.equals(rhs.displayName))))&&((this.testSuite == rhs.testSuite)||((this.testSuite!= null)&&this.testSuite.equals(rhs.testSuite))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.useDynamicAssertion == rhs.useDynamicAssertion)||((this.useDynamicAssertion!= null)&&this.useDynamicAssertion.equals(rhs.useDynamicAssertion))))&&((this.entityLink == rhs.entityLink)||((this.entityLink!= null)&&this.entityLink.equals(rhs.entityLink))))&&((this.owners == rhs.owners)||((this.owners!= null)&&this.owners.equals(rhs.owners))))&&((this.testDefinition == rhs.testDefinition)||((this.testDefinition!= null)&&this.testDefinition.equals(rhs.testDefinition))))&&((this.parameterValues == rhs.parameterValues)||((this.parameterValues!= null)&&this.parameterValues.equals(rhs.parameterValues))));
}
}