Привет
У меня есть спецификация:

{
"openapi": "3.1.0",
"info": {
"title": "Dummy API",
"description": "Sample contract first API. More information on the details of OpenApi 3.0 can be found here: https://swagger.io/docs/specification/about/",
"version": "0.0.1"
},
"paths": {
"/messages": {
"description": "Operations with message resources.",
"get": {
"operationId": "getAllMessages",
"tags": [
"messages"
],
"summary": "Returns all messages.",
"parameters": [
{
"ref": "#/components/parameters/offset"
          },
          {
            "ref": "#/components/parameters/limit"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"description": "Collection of messages",
"type": "array",
"items": {
"ref": "#/components/schemas/MessageResponse"
                  }
                },
                "examples": {
                  "example1": {
                    "summary": "An example of returned messages",
                    "value": [
                      {
                        "id": 1,
                        "text": "Message 1"
                      },
                      {
                        "id": 2,
                        "text": "Message 2"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createMessage",
        "tags": [
          "messages"
        ],
        "summary": "Returns created message with ID",
        "description": "This operation allows saving a message",
        "requestBody": {
          "description": "JSON object containing message information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "ref": "#/components/schemas/MessageRequest"
},
"examples": {
"example1": {
"summary": "An example of message",
"value": {
"text": "Message 1"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Created successfully",
"content": {
"application/json": {
"schema": {
"ref": "#/components/schemas/MessageResponse"
                },
                "examples": {
                  "example1": {
                    "summary": "An example of returned message",
                    "value": {
                      "id": 1,
                      "text": "Message 1"
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "URL to the newly created message",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{id}": {
      "description": "Operations with message resources.",
      "get": {
        "operationId": "getMessageById",
        "tags": [
          "messages"
        ],
        "summary": "Returns a message by ID",
        "description": "This operation allows retrieving a previously saved message by its ID.",
        "parameters": [
          {
            "ref": "#/components/parameters/messageId"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"ref": "#/components/schemas/MessageResponse"
                },
                "examples": {
                  "example1": {
                    "summary": "An example of returned message",
                    "value": {
                      "id": 1,
                      "text": "Message 1"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Object not found"
          }
        }
      },
      "put": {
        "operationId": "editMessage",
        "tags": [
          "messages"
        ],
        "summary": "Edits a previously created message by ID",
        "description": "This operation allows editing a message",
        "parameters": [
          {
            "ref": "#/components/parameters/messageId"
}
],
"requestBody": {
"description": "JSON object containing message information",
"required": true,
"content": {
"application/json": {
"schema": {
"ref": "#/components/schemas/MessageRequest"
              },
              "examples": {
                "example1": {
                  "summary": "An example of message",
                  "value": {
                    "text": "Message 1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Edited successfully"
          },
          "404": {
            "description": "Object not found"
          }
        }
      },
      "delete": {
        "operationId": "deleteMessage",
        "tags": [
          "messages"
        ],
        "summary": "Deletes a previously created message by ID",
        "description": "This operation allows deleting a message",
        "parameters": [
          {
            "ref": "#/components/parameters/messageId"
}
],
"responses": {
"204": {
"description": "Deleted successfully"
},
"404": {
"description": "Object not found"
}
}
}
},
"/tasks": {
"description": "Operations with long-running tasks.",
"post": {
"operationId": "createTask",
"tags": [
"tasks"
],
"summary": "Returns created task with ID",
"description": "This operation allows creating a task",
"requestBody": {
"description": "JSON object containing task information",
"required": true,
"content": {
"application/json": {
"schema": {
"ref": "#/components/schemas/TaskRequest"
              },
              "examples": {
                "example1": {
                  "summary": "An example of task",
                  "value": {
                    "data": "Task 1 data"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Task accepted",
            "content": {
              "application/json": {
                "schema": {
                  "ref": "#/components/schemas/TaskStatusResponse"
},
"examples": {
"example1": {
"summary": "An example of returned task status",
"value": {
"status": "IN_PROGRESS",
"monitor": "/tasks/1"
}
}
}
}
}
}
}
}
},
"/tasks/{id}": {
"description": "Operations with long-running tasks.",
"get": {
"operationId": "getTaskById",
"tags": [
"tasks"
],
"summary": "Returns a task by ID",
"description": "This operation allows retrieving a previously submitted task by its ID.",
"parameters": [
{
"ref": "#/components/parameters/taskId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "ref": "#/components/schemas/TaskResponse"
},
"examples": {
"example1": {
"summary": "An example of returned task",
"value": {
"id": 1,
"data": "Task 1 data",
"status": "SUCCESS"
}
}
}
}
}
},
"404": {
"description": "Object not found"
}
}
}
}
},
"components": {
"parameters": {
"messageId": {
"name": "id",
"in": "path",
"description": "Message ID",
"required": true,
"schema": {
"ref": "#/components/schemas/MessageID"
        },
        "example": 1234
      },
      "offset": {
        "name": "offset",
        "in": "query",
        "description": "Number of items to skip",
        "required": false,
        "schema": {
          "description": "Number of items to skip",
          "type": "integer",
          "minimum": 0,
          "maximum": 1000,
          "default": 0
        },
        "example": 10
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "description": "Maximum number of items returned by operation",
        "required": false,
        "schema": {
          "description": "Maximum number of items returned by operation",
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "default": 1000
        },
        "example": 10
      },
      "taskId": {
        "name": "id",
        "in": "path",
        "description": "Message ID",
        "required": true,
        "schema": {
          "ref": "#/components/schemas/TaskID"
},
"example": 1234
}
},
"schemas": {
"MessageRequest": {
"description": "Schema of a message object",
"type": "object",
"properties": {
"text": {
"ref": "#/components/schemas/MessageText"
          }
        },
        "required": [
          "text"
        ]
      },
      "MessageResponse": {
        "description": "Schema of a message object",
        "type": "object",
        "properties": {
          "id": {
            "ref": "#/components/schemas/MessageID"
},
"text": {
"ref": "#/components/schemas/MessageText"
          }
        }
      },
      "MessageID": {
        "description": "Message ID",
        "type": "string",
        "minLength": 1,
        "maxLength": 1000,
        "pattern": "\\d+",
        "readOnly": true
      },
      "MessageText": {
        "description": "Message text",
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
      },
      "TaskRequest": {
        "description": "Schema of a task request",
        "type": "object",
        "properties": {
          "data": {
            "ref": "#/components/schemas/TaskData"
}
},
"required": [
"data"
]
},
"TaskStatusResponse": {
"description": "Schema of a task status response",
"type": "object",
"properties": {
"status": {
"ref": "#/components/schemas/TaskStatus"
          },
          "monitor": {
            "description": "URL to monitor task progress",
            "type": "string",
            "readOnly": true
          }
        }
      },
      "TaskResponse": {
        "description": "Schema of a task response",
        "type": "object",
        "properties": {
          "id": {
            "ref": "#/components/schemas/TaskID"
},
"data": {
"ref": "#/components/schemas/TaskData"
          },
          "status": {
            "ref": "#/components/schemas/TaskStatus"
}
}
},
"TaskID": {
"description": "Task ID",
"type": "string",
"minLength": 1,
"maxLength": 1000,
"pattern": "\d+",
"readOnly": true
},
"TaskData": {
"description": "Task data",
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"TaskStatus": {
"description": "Task status",
"type": "string",
"enum": [
"CREATED",
"IN_PROGRESS",
"SUCCESS",
"FAILURE"
],
"readOnly": true
}
}
}
}

Напиши по 3 теста для аждого метода. Используй restTemplate. URL http://localhost:8080