Skip to content

Commit

Permalink
Merge branch 'main' of github.com:znsio/specmatic
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrosario committed Jan 28, 2025
2 parents 53a41eb + 8bd8f95 commit b4b286c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ open class SpecmaticJUnitSupport {
val response = httpClient.execute(request)

if (response.status != 200) {
logger.log("Failed to query swaggerUI, status code: ${response.status}")
return ActuatorSetupResult.Failure
}

Expand All @@ -156,11 +157,15 @@ open class SpecmaticJUnitSupport {

fun queryActuator(): ActuatorSetupResult {
val endpointsAPI: String = Flags.getStringValue(ENDPOINTS_API) ?: return ActuatorSetupResult.Failure

val request = HttpRequest("GET")
val response = HttpClient(endpointsAPI, log = ignoreLog).execute(request)
logger.debug(response.toLogString())

if (response.status != 200) {
logger.log("Failed to query actuator, status code: ${response.status}")
return ActuatorSetupResult.Failure
}

logger.debug(response.toLogString())
openApiCoverageReportInput.setEndpointsAPIFlag(true)
val endpointData = response.body as JSONObjectValue
val apis: List<API> = endpointData.getJSONObject("contexts").entries.flatMap { entry ->
Expand Down

0 comments on commit b4b286c

Please sign in to comment.