From 17a0cfe936262b06fb8027bc9729ce813f5d28b5 Mon Sep 17 00:00:00 2001 From: Russell Dodd Date: Mon, 25 Nov 2024 15:16:33 +0000 Subject: [PATCH] Add a couple of log messages for welcome endpoint. --- build.gradle | 1 + .../java/uk/gov/hmcts/opal/controllers/GetWelcomeTest.java | 3 +++ .../java/uk/gov/hmcts/opal/controllers/RootController.java | 3 +++ src/main/resources/application.yaml | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 332812fe7..226e05b4b 100644 --- a/build.gradle +++ b/build.gradle @@ -298,6 +298,7 @@ dependencies { integrationTestCompileOnly 'org.projectlombok:lombok:1.18.34' integrationTestAnnotationProcessor 'org.projectlombok:lombok:1.18.34' + implementation group: 'org.apache.xmlgraphics', name: 'fop', version: '2.10' implementation group: 'org.apache.xmlgraphics', name: 'fop-core', version: '2.10' implementation group: 'org.apache.xmlgraphics', name: 'fop-events', version: '2.10' diff --git a/src/integrationTest/java/uk/gov/hmcts/opal/controllers/GetWelcomeTest.java b/src/integrationTest/java/uk/gov/hmcts/opal/controllers/GetWelcomeTest.java index 51fc97b45..e5deb71fc 100644 --- a/src/integrationTest/java/uk/gov/hmcts/opal/controllers/GetWelcomeTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/opal/controllers/GetWelcomeTest.java @@ -1,5 +1,6 @@ package uk.gov.hmcts.opal.controllers; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -16,6 +17,7 @@ @WebMvcTest @ContextConfiguration(classes = RootController.class) @ActiveProfiles({"integration"}) +@Slf4j(topic = "GetWelcomeTest") class GetWelcomeTest { @Autowired @@ -24,6 +26,7 @@ class GetWelcomeTest { @DisplayName("Should welcome upon root request with 200 response code") @Test void welcomeRootEndpoint() throws Exception { + log.info(":welcomeRootEndpoint:"); MvcResult response = mockMvc.perform(get("/")).andExpect(status().isOk()).andReturn(); assertThat(response.getResponse().getContentAsString()).startsWith("Welcome"); diff --git a/src/main/java/uk/gov/hmcts/opal/controllers/RootController.java b/src/main/java/uk/gov/hmcts/opal/controllers/RootController.java index 8442db494..de1fe7485 100644 --- a/src/main/java/uk/gov/hmcts/opal/controllers/RootController.java +++ b/src/main/java/uk/gov/hmcts/opal/controllers/RootController.java @@ -1,6 +1,7 @@ package uk.gov.hmcts.opal.controllers; import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @@ -12,6 +13,7 @@ */ @RestController @Tag(name = "Root Controller") +@Slf4j(topic = "RootController") public class RootController { /** @@ -25,6 +27,7 @@ public class RootController { */ @GetMapping("/") public ResponseEntity welcome() { + log.info(":welcome:"); return ok("Welcome to opal-fines-service"); } } diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index f775a5338..1cc7d0c8b 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -148,7 +148,7 @@ opal: file-handler-job: cron: ${OPAL_FILE_HANDLER_JOB_CRON:0 0 * * * ?} frontend: - url: ${OPAL_FRONTEND_URL:http://localhost:4200} + url: ${OPAL_FRONTEND_URL:http://localhost:4200} azure: active-directory-justice-auth-uri: https://login.microsoftonline.com testing-support-endpoints: