Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEAT-106: Standardise endpoints #231

Merged
merged 7 commits into from
Sep 22, 2023

Conversation

psoleckimoj
Copy link
Contributor

@psoleckimoj psoleckimoj commented Sep 21, 2023

Attempt to bring health and info endpoints inline with the Kotlin template.

@tpmcgowan
Copy link
Contributor

Managed to get this the integration tests to pass with the following changes to two files (it wouldn't let me comment directly on the PR changes as they weren't bits you've touched.... 🙄 )

Looks like you've changed the json format for /health; so just updating for that. Although it now passes, probably worth checking that what's returned at http://localhost:3007/health is what you're intending!

diff --git a/integration_tests/e2e/health.cy.ts b/integration_tests/e2e/health.cy.ts
index afa496b..e0d54e5 100644
--- a/integration_tests/e2e/health.cy.ts
+++ b/integration_tests/e2e/health.cy.ts
@@ -26,8 +26,8 @@ context('Healthcheck', () => {
       cy.task('stubTokenVerificationPing', 500)
 
       cy.request({ url: '/health', method: 'GET', failOnStatusCode: false }).then(response => {
-        expect(response.body.checks.hmppsAuth).to.equal('OK')
-        expect(response.body.checks.tokenVerification).to.contain({ status: 500, retries: 2 })
+        expect(response.body.components.hmppsAuth.status).to.equal('UP')
+        expect(response.body.components.tokenVerification.status).to.contain({ status: 500, retries: 2 })
       })
     })
   })
diff --git a/integration_tests/mockApis/tokenVerification.ts b/integration_tests/mockApis/tokenVerification.ts
index 1b9d47a..17be392 100644
--- a/integration_tests/mockApis/tokenVerification.ts
+++ b/integration_tests/mockApis/tokenVerification.ts
@@ -11,7 +11,7 @@ export default {
       response: {
         status,
         headers: { 'Content-Type': 'application/json;charset=UTF-8' },
-        jsonBody: { status: 'UP' },
+        jsonBody: { status: 'DOWN' },
       },
     }),
   stubVerifyToken: (active = true): SuperAgentRequest =>

@psoleckimoj psoleckimoj marked this pull request as ready for review September 21, 2023 20:54
.circleci/config.yml Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@andrewrlee andrewrlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewrlee andrewrlee merged commit a04c1e7 into main Sep 22, 2023
4 checks passed
@andrewrlee andrewrlee deleted the feature/HEAT-106-standardise-endpoints branch September 22, 2023 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants