|
| 1 | +package uk.gov.justice.digital.hmpps.hmppsintegrationapi.smoke |
| 2 | + |
| 3 | +import io.kotest.assertions.json.shouldEqualJson |
| 4 | +import io.kotest.core.spec.style.DescribeSpec |
| 5 | +import io.kotest.matchers.shouldBe |
| 6 | +import org.springframework.http.HttpStatus |
| 7 | +import uk.gov.justice.digital.hmpps.hmppsintegrationapi.extensions.removeWhitespaceAndNewlines |
| 8 | +import uk.gov.justice.digital.hmpps.hmppsintegrationapi.helpers.IntegrationAPIHttpClient |
| 9 | + |
| 10 | +class AuthoriseConfigTest : DescribeSpec( |
| 11 | + { |
| 12 | + val httpClient = IntegrationAPIHttpClient() |
| 13 | + |
| 14 | + it("returns authorise config") { |
| 15 | + |
| 16 | + val response = httpClient.performAuthorised("v1/config/authorisation", "config-test") |
| 17 | + |
| 18 | + response.statusCode().shouldBe(HttpStatus.OK.value()) |
| 19 | + response.body().shouldEqualJson( |
| 20 | + """ |
| 21 | + { |
| 22 | + "automated-test-client": [ |
| 23 | + "/v1/persons", |
| 24 | + "/v1/persons/.*", |
| 25 | + "/v1/persons/.*/images", |
| 26 | + "/v1/images/.*", |
| 27 | + "/v1/persons/.*/addresses", |
| 28 | + "/v1/persons/.*/offences", |
| 29 | + "/v1/persons/.*/alerts", |
| 30 | + "/v1/persons/.*/sentences", |
| 31 | + "/v1/persons/.*/sentences/latest-key-dates-and-adjustments", |
| 32 | + "/v1/persons/.*/risks/scores", |
| 33 | + "/v1/persons/.*/needs", |
| 34 | + "/v1/persons/.*/risks", |
| 35 | + "/v1/persons/.*/reported-adjudications", |
| 36 | + "/v1/persons/.*/case-notes", |
| 37 | + "/v1/persons/.*/person-responsible-officer", |
| 38 | + "/v1/epf/person-details/.*/.*", |
| 39 | + "/health", |
| 40 | + "/health/ping", |
| 41 | + "/health/readiness", |
| 42 | + "/health/liveness", |
| 43 | + "/info" |
| 44 | + ], |
| 45 | + "config-test": [ |
| 46 | + "/v1/config/authorisation" |
| 47 | + ] |
| 48 | + } |
| 49 | + """.removeWhitespaceAndNewlines(), |
| 50 | + ) |
| 51 | + } |
| 52 | + }, |
| 53 | +) |
0 commit comments