Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Add test and changed list of works to sorted set of works
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-farache authored and openshift-merge-robot committed Jul 27, 2023
1 parent a5ff137 commit f0c4c7a
Show file tree
Hide file tree
Showing 10 changed files with 258 additions and 75 deletions.
15 changes: 13 additions & 2 deletions workflow-service-sdk/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1242,10 +1242,12 @@ components:
type: object
WorkDefinitionResponseDTO:
example:
cronExpression: cronExpression
outputs:
- EXCEPTION
- EXCEPTION
processingType: SEQUENTIAL
workFlowCheckerMappingDefinitionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
works:
- null
- null
Expand All @@ -1259,6 +1261,8 @@ components:
properties:
author:
type: string
cronExpression:
type: string
id:
format: uuid
type: string
Expand All @@ -1285,6 +1289,9 @@ components:
- PARALLEL
- OTHER
type: string
workFlowCheckerMappingDefinitionId:
format: uuid
type: string
workType:
enum:
- TASK
Expand Down Expand Up @@ -1420,10 +1427,12 @@ components:
cronExpression: cronExpression
processingType: SEQUENTIAL
works:
- outputs:
- cronExpression: cronExpression
outputs:
- EXCEPTION
- EXCEPTION
processingType: SEQUENTIAL
workFlowCheckerMappingDefinitionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
works:
- null
- null
Expand All @@ -1434,10 +1443,12 @@ components:
parameters:
key:
key: "{}"
- outputs:
- cronExpression: cronExpression
outputs:
- EXCEPTION
- EXCEPTION
processingType: SEQUENTIAL
workFlowCheckerMappingDefinitionId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
works:
- null
- null
Expand Down
2 changes: 2 additions & 0 deletions workflow-service-sdk/docs/WorkDefinitionResponseDTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**author** | **String** | | [optional] |
|**cronExpression** | **String** | | [optional] |
|**id** | **UUID** | | [optional] |
|**name** | **String** | | [optional] |
|**outputs** | [**List<OutputsEnum>**](#List<OutputsEnum>) | | [optional] |
|**parameters** | **Map<String, Map<String, Object>>** | | [optional] |
|**processingType** | [**ProcessingTypeEnum**](#ProcessingTypeEnum) | | [optional] |
|**workFlowCheckerMappingDefinitionId** | **UUID** | | [optional] |
|**workType** | [**WorkTypeEnum**](#WorkTypeEnum) | | [optional] |
|**works** | [**Set<WorkDefinitionResponseDTO>**](WorkDefinitionResponseDTO.md) | | [optional] |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public class WorkDefinitionResponseDTO {
@SerializedName(SERIALIZED_NAME_AUTHOR)
private String author;

public static final String SERIALIZED_NAME_CRON_EXPRESSION = "cronExpression";

@SerializedName(SERIALIZED_NAME_CRON_EXPRESSION)
private String cronExpression;

public static final String SERIALIZED_NAME_ID = "id";

@SerializedName(SERIALIZED_NAME_ID)
Expand Down Expand Up @@ -181,6 +186,11 @@ public ProcessingTypeEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName(SERIALIZED_NAME_PROCESSING_TYPE)
private ProcessingTypeEnum processingType;

public static final String SERIALIZED_NAME_WORK_FLOW_CHECKER_MAPPING_DEFINITION_ID = "workFlowCheckerMappingDefinitionId";

@SerializedName(SERIALIZED_NAME_WORK_FLOW_CHECKER_MAPPING_DEFINITION_ID)
private UUID workFlowCheckerMappingDefinitionId;

/**
* Gets or Sets workType
*/
Expand Down Expand Up @@ -266,6 +276,25 @@ public void setAuthor(String author) {
this.author = author;
}

public WorkDefinitionResponseDTO cronExpression(String cronExpression) {

this.cronExpression = cronExpression;
return this;
}

/**
* Get cronExpression
* @return cronExpression
**/
@javax.annotation.Nullable
public String getCronExpression() {
return cronExpression;
}

public void setCronExpression(String cronExpression) {
this.cronExpression = cronExpression;
}

public WorkDefinitionResponseDTO id(UUID id) {

this.id = id;
Expand Down Expand Up @@ -377,6 +406,25 @@ public void setProcessingType(ProcessingTypeEnum processingType) {
this.processingType = processingType;
}

public WorkDefinitionResponseDTO workFlowCheckerMappingDefinitionId(UUID workFlowCheckerMappingDefinitionId) {

this.workFlowCheckerMappingDefinitionId = workFlowCheckerMappingDefinitionId;
return this;
}

/**
* Get workFlowCheckerMappingDefinitionId
* @return workFlowCheckerMappingDefinitionId
**/
@javax.annotation.Nullable
public UUID getWorkFlowCheckerMappingDefinitionId() {
return workFlowCheckerMappingDefinitionId;
}

public void setWorkFlowCheckerMappingDefinitionId(UUID workFlowCheckerMappingDefinitionId) {
this.workFlowCheckerMappingDefinitionId = workFlowCheckerMappingDefinitionId;
}

public WorkDefinitionResponseDTO workType(WorkTypeEnum workType) {

this.workType = workType;
Expand Down Expand Up @@ -433,30 +481,37 @@ public boolean equals(Object o) {
}
WorkDefinitionResponseDTO workDefinitionResponseDTO = (WorkDefinitionResponseDTO) o;
return Objects.equals(this.author, workDefinitionResponseDTO.author)
&& Objects.equals(this.cronExpression, workDefinitionResponseDTO.cronExpression)
&& Objects.equals(this.id, workDefinitionResponseDTO.id)
&& Objects.equals(this.name, workDefinitionResponseDTO.name)
&& Objects.equals(this.outputs, workDefinitionResponseDTO.outputs)
&& Objects.equals(this.parameters, workDefinitionResponseDTO.parameters)
&& Objects.equals(this.processingType, workDefinitionResponseDTO.processingType)
&& Objects.equals(this.workFlowCheckerMappingDefinitionId,
workDefinitionResponseDTO.workFlowCheckerMappingDefinitionId)
&& Objects.equals(this.workType, workDefinitionResponseDTO.workType)
&& Objects.equals(this.works, workDefinitionResponseDTO.works);
}

@Override
public int hashCode() {
return Objects.hash(author, id, name, outputs, parameters, processingType, workType, works);
return Objects.hash(author, cronExpression, id, name, outputs, parameters, processingType,
workFlowCheckerMappingDefinitionId, workType, works);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WorkDefinitionResponseDTO {\n");
sb.append(" author: ").append(toIndentedString(author)).append("\n");
sb.append(" cronExpression: ").append(toIndentedString(cronExpression)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" outputs: ").append(toIndentedString(outputs)).append("\n");
sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n");
sb.append(" processingType: ").append(toIndentedString(processingType)).append("\n");
sb.append(" workFlowCheckerMappingDefinitionId: ")
.append(toIndentedString(workFlowCheckerMappingDefinitionId)).append("\n");
sb.append(" workType: ").append(toIndentedString(workType)).append("\n");
sb.append(" works: ").append(toIndentedString(works)).append("\n");
sb.append("}");
Expand All @@ -482,11 +537,13 @@ private String toIndentedString(Object o) {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("author");
openapiFields.add("cronExpression");
openapiFields.add("id");
openapiFields.add("name");
openapiFields.add("outputs");
openapiFields.add("parameters");
openapiFields.add("processingType");
openapiFields.add("workFlowCheckerMappingDefinitionId");
openapiFields.add("workType");
openapiFields.add("works");

Expand Down Expand Up @@ -530,6 +587,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
String.format("Expected the field `author` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("author").toString()));
}
if ((jsonObj.get("cronExpression") != null && !jsonObj.get("cronExpression").isJsonNull())
&& !jsonObj.get("cronExpression").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(
"Expected the field `cronExpression` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("cronExpression").toString()));
}
if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`",
Expand All @@ -553,6 +616,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
"Expected the field `processingType` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("processingType").toString()));
}
if ((jsonObj.get("workFlowCheckerMappingDefinitionId") != null
&& !jsonObj.get("workFlowCheckerMappingDefinitionId").isJsonNull())
&& !jsonObj.get("workFlowCheckerMappingDefinitionId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(
"Expected the field `workFlowCheckerMappingDefinitionId` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("workFlowCheckerMappingDefinitionId").toString()));
}
if ((jsonObj.get("workType") != null && !jsonObj.get("workType").isJsonNull())
&& !jsonObj.get("workType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ public class WorkFlowDefinitionResponseDTO {
@SerializedName(SERIALIZED_NAME_CREATE_DATE)
private Date createDate;

public static final String SERIALIZED_NAME_FALLBACK_WORKFLOW = "fallbackWorkflow";

@SerializedName(SERIALIZED_NAME_FALLBACK_WORKFLOW)
private String fallbackWorkflow;

public static final String SERIALIZED_NAME_CRON_EXPRESSION = "cronExpression";

@SerializedName(SERIALIZED_NAME_CRON_EXPRESSION)
private String cronExpression;

public static final String SERIALIZED_NAME_FALLBACK_WORKFLOW = "fallbackWorkflow";

@SerializedName(SERIALIZED_NAME_FALLBACK_WORKFLOW)
private String fallbackWorkflow;

public static final String SERIALIZED_NAME_ID = "id";

@SerializedName(SERIALIZED_NAME_ID)
Expand Down Expand Up @@ -251,42 +251,42 @@ public void setCreateDate(Date createDate) {
this.createDate = createDate;
}

public WorkFlowDefinitionResponseDTO fallbackWorkflow(String fallbackWorkflow) {
public WorkFlowDefinitionResponseDTO cronExpression(String cronExpression) {

this.fallbackWorkflow = fallbackWorkflow;
this.cronExpression = cronExpression;
return this;
}

/**
* Get fallbackWorkflow
* @return fallbackWorkflow
* Get cronExpression
* @return cronExpression
**/
@javax.annotation.Nullable
public String getFallbackWorkflow() {
return fallbackWorkflow;
public String getCronExpression() {
return cronExpression;
}

public void setFallbackWorkflow(String fallbackWorkflow) {
this.fallbackWorkflow = fallbackWorkflow;
public void setCronExpression(String cronExpression) {
this.cronExpression = cronExpression;
}

public WorkFlowDefinitionResponseDTO cronExpression(String cronExpression) {
public WorkFlowDefinitionResponseDTO fallbackWorkflow(String fallbackWorkflow) {

this.cronExpression = cronExpression;
this.fallbackWorkflow = fallbackWorkflow;
return this;
}

/**
* Get cronExpression
* @return cronExpression
* Get fallbackWorkflow
* @return fallbackWorkflow
**/
@javax.annotation.Nullable
public String getCronExpression() {
return cronExpression;
public String getFallbackWorkflow() {
return fallbackWorkflow;
}

public void setCronExpression(String cronExpression) {
this.cronExpression = cronExpression;
public void setFallbackWorkflow(String fallbackWorkflow) {
this.fallbackWorkflow = fallbackWorkflow;
}

public WorkFlowDefinitionResponseDTO id(UUID id) {
Expand Down Expand Up @@ -482,8 +482,8 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(author, createDate, cronExpression, id, modifyDate, name, parameters, processingType,
properties, rollbackWorkflow, type, works);
return Objects.hash(author, createDate, cronExpression, fallbackWorkflow, id, modifyDate, name, parameters,
processingType, properties, type, works);
}

@Override
Expand All @@ -492,8 +492,8 @@ public String toString() {
sb.append("class WorkFlowDefinitionResponseDTO {\n");
sb.append(" author: ").append(toIndentedString(author)).append("\n");
sb.append(" createDate: ").append(toIndentedString(createDate)).append("\n");
sb.append(" fallbackWorkflow: ").append(toIndentedString(fallbackWorkflow)).append("\n");
sb.append(" cronExpression: ").append(toIndentedString(cronExpression)).append("\n");
sb.append(" fallbackWorkflow: ").append(toIndentedString(fallbackWorkflow)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" modifyDate: ").append(toIndentedString(modifyDate)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
Expand Down
8 changes: 8 additions & 0 deletions workflow-service/generated/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,9 @@
"author" : {
"type" : "string"
},
"cronExpression" : {
"type" : "string"
},
"id" : {
"type" : "string",
"format" : "uuid"
Expand Down Expand Up @@ -1686,11 +1689,16 @@
"type" : "string",
"enum" : [ "SEQUENTIAL", "PARALLEL", "OTHER" ]
},
"workFlowCheckerMappingDefinitionId" : {
"type" : "string",
"format" : "uuid"
},
"workType" : {
"type" : "string",
"enum" : [ "TASK", "WORKFLOW", "CHECKER" ]
},
"works" : {
"uniqueItems" : true,
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/WorkDefinitionResponseDTO"
Expand Down
Loading

0 comments on commit f0c4c7a

Please sign in to comment.