-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#1156): provide test api generator
- Loading branch information
Showing
115 changed files
with
12,632 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
core/citrus-api/src/main/java/org/citrusframework/testapi/GeneratedApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.citrusframework.testapi; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Interface representing a generated API from an OpenAPI specification. | ||
* Provides methods to retrieve metadata about the API such as title, version, | ||
* prefix, and information extensions. | ||
*/ | ||
public interface GeneratedApi { | ||
|
||
/** | ||
* Retrieves the title of the OpenAPI specification, as specified in the info section of the API. | ||
* | ||
* @return the title of the OpenAPI specification | ||
*/ | ||
String getApiTitle(); | ||
|
||
/** | ||
* Retrieves the version of the OpenAPI specification, as specified in the info section of the API. | ||
* | ||
* @return the version of the OpenAPI specification | ||
*/ | ||
String getApiVersion(); | ||
|
||
/** | ||
* Retrieves the prefix used for the API, as specified in the API generation configuration. | ||
* | ||
* @return the prefix used for the API | ||
*/ | ||
String getApiPrefix(); | ||
|
||
/** | ||
* Retrieves the specification extensions of the OpenAPI defined in the "info" section. | ||
* <p> | ||
* Specification extensions, also known as vendor extensions, are custom key-value pairs used to describe extra | ||
* functionality not covered by the standard OpenAPI Specification. These properties start with "x-". | ||
* This method collects only the extensions defined in the "info" section of the API. | ||
* </p> | ||
* | ||
* @return a map containing the specification extensions defined in the "info" section of the API, | ||
* where keys are extension names and values are extension values | ||
*/ | ||
Map<String, String> getApiInfoExtensions(); | ||
} |
29 changes: 29 additions & 0 deletions
29
core/citrus-api/src/main/java/org/citrusframework/testapi/GeneratedApiRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.citrusframework.testapi; | ||
|
||
/** | ||
* Interface representing a generated API request corresponding to an operation in an OpenAPI specification. | ||
* Provides methods to retrieve metadata about the request such as operation name, HTTP method, and path. | ||
*/ | ||
public interface GeneratedApiRequest { | ||
|
||
/** | ||
* Retrieves the name of the OpenAPI operation associated with the request. | ||
* | ||
* @return the name of the OpenAPI operation | ||
*/ | ||
String getOperationName(); | ||
|
||
/** | ||
* Retrieves the HTTP method used for the request. | ||
* | ||
* @return the HTTP method used for the request (e.g., GET, POST) | ||
*/ | ||
String getMethod(); | ||
|
||
/** | ||
* Retrieves the path used for the request. | ||
* | ||
* @return the path used for the request | ||
*/ | ||
String getPath(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...rus-base/src/main/java/org/citrusframework/testapi/ApiActionBuilderCustomizerService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.citrusframework.testapi; | ||
|
||
import org.citrusframework.TestAction; | ||
import org.citrusframework.actions.SendMessageAction.SendMessageActionBuilder; | ||
import org.citrusframework.context.TestContext; | ||
|
||
/** | ||
* Implementors of this interface are used to customize the SendMessageActionBuilder with application specific information. E.g. cookies | ||
* or transactionIds. | ||
*/ | ||
public interface ApiActionBuilderCustomizerService { | ||
<T extends SendMessageActionBuilder<?,?,?>> T build(GeneratedApi generatedApi, TestAction action, TestContext context, T builder); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.