Package com.privalia.qa.utils
Class SwaggerUtils
- java.lang.Object
-
- com.privalia.qa.utils.SwaggerUtils
-
public class SwaggerUtils extends Object
Additional operations with rest api spec (swagger).
-
-
Constructor Summary
Constructors Constructor Description SwaggerUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHost()
Get swagger server host.SwaggerMethod
getMethod(String operationId)
Prepared request and returns the method and base path for the request based on the swagger specio.swagger.v3.oas.models.OpenAPI
getSpec()
Get swagger spec.com.atlassian.oai.validator.restassured.OpenApiValidationFilter
getValidator()
Get swagger validator.void
initialize(String path, Integer server)
Read the swagger spec.Boolean
isSecured()
Swagger server is secured.
-
-
-
Method Detail
-
getSpec
public io.swagger.v3.oas.models.OpenAPI getSpec()
Get swagger spec.- Returns:
- OpenAPI
-
isSecured
public Boolean isSecured()
Swagger server is secured.- Returns:
- Boolean
-
getHost
public String getHost()
Get swagger server host.- Returns:
- String
-
getValidator
public com.atlassian.oai.validator.restassured.OpenApiValidationFilter getValidator()
Get swagger validator.- Returns:
- OpenApiValidationFilter
-
initialize
public void initialize(String path, Integer server) throws MalformedURLException
Read the swagger spec.- Parameters:
path
- File path to swagger spec or URI to swagger specserver
- Server index to which requests will be sent (default: 0)- Throws:
MalformedURLException
- MalformedURLException
-
getMethod
public SwaggerMethod getMethod(String operationId)
Prepared request and returns the method and base path for the request based on the swagger spec- Parameters:
operationId
- Operation ID from swagger spec- Returns:
- SwaggerMethod
-
-