diff --git a/Jenkinsfile_CNP b/Jenkinsfile_CNP index 4dd42760c91..8921a4b89d6 100644 --- a/Jenkinsfile_CNP +++ b/Jenkinsfile_CNP @@ -38,6 +38,14 @@ def secrets = [ secret('tya-link', 'SSCS_TRACK_YOUR_APPEAL_LINK'), secret('evidence-share-topic-shared-access-key', 'AMQP_PASSWORD'), + // hearing-api + secret('idam-s2s-api', 'IDAM_S2S_URL'), + secret('caseworker-ref-api', 'CASEWORKER_REF_API_URL'), + secret('ccd-api', 'CORE_CASE_DATA_API_URL'), + secret('judicial-ref-api', 'JUDICIAL_REF_API_URL'), + secret('s2s-micro', 'IDAM_S2S_AUTH_MICROSERVICES'), + secret('common-ref-data-api', 'COMMON_REF_API_URL'), + // e2es secret('test-e2e-caseofficer-username', 'TEST_CASEOFFICER_USERNAME'), secret('test-e2e-caseofficer-password', 'TEST_CASEOFFICER_PASSWORD'), diff --git a/charts/sscs-tribunals-api/values.hearings.preview.template.yaml b/charts/sscs-tribunals-api/values.hearings.preview.template.yaml index 2a78840b5b2..5d9f2087843 100644 --- a/charts/sscs-tribunals-api/values.hearings.preview.template.yaml +++ b/charts/sscs-tribunals-api/values.hearings.preview.template.yaml @@ -50,7 +50,7 @@ java: SUBSCRIPTION_NAME: "${SERVICE_NAME}-servicebus-main-topic" AMQP_HOST: "sscs-sb-preview.servicebus.windows.net" AMQP_USERNAME: "RootManageSharedAccessKey" - HEARINGS_EVENT_QUEUE_NAME: ${SERVICE_NAME}-servicebus-tribunals-to-hearing-api + HEARINGS_EVENT_QUEUE_NAME: "${SERVICE_NAME}-servicebus-tribunals-to-hearing-api" ROBOTICS_EMAIL_FROM: "sscs@hmcts.net" ROBOTICS_EMAIL_TO: "fake" ROBOTICS_EMAIL_SCOTTISH_TO: "fake2" @@ -67,6 +67,26 @@ java: HOURS_END_TIME: 23 RUN_DB_MIGRATION_ON_STARTUP: true TEST_RECIPIENTS_POSTCODE: "*" + HMC_HEARINGS_LISTENING_ENABLED: true + TRIBUNALS_HEARINGS_LISTENING_ENABLED: true + EXUI_API_URL: "https://${SERVICE_NAME}-xui" + IDAM_S2S_URL: "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal" + CASEWORKER_REF_API_URL: "http://rd-caseworker-ref-api-aat.service.core-compute-aat.internal" + COMMON_REF_API_URL: "http://rd-commondata-api-aat.service.core-compute-aat.internal" + JUDICIAL_REF_API_URL: "http://rd-judicial-api-aat.service.core-compute-aat.internal" + HMC_API_URL: "http://hmc-cft-hearing-service-aat.service.core-compute-aat.internal" + #Messaging + HMC_HEARINGS_TOPIC_NAME: "hmc-to-cft-aat" + HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-4056" + TRIBUNALS_EVENT_QUEUE_NAME: "${SERVICE_NAME}-servicebus-tribunals-to-hearing-api" + TRIBUNALS_EVENT_QUEUE_POLICY_NAME: "RootManageSharedAccessKey" + TRIBUNALS_EVENT_QUEUE_NAMESPACE: "sscs-sb-preview" + HMC_HEARINGS_TOPIC_NAMESPACE: "hmc-servicebus-aat" + HMC_DEPLOYMENT_ID: "deployment-${SERVICE_NAME}" + HMC_DEPLOYMENT_FILTER_ENABLED: true + HEARINGS_CASE_UPDATE_V2_ENABLED: true + ADJOURNMENT_ENABLED: true + BYPASS_HEARING_API_SERVICE: true secrets: JOB_SCHEDULER_DB_PASSWORD: secretRef: postgres @@ -77,6 +97,9 @@ java: AMQP_PASSWORD: secretRef: sscs-sb-preview key: primaryKey + TRIBUNALS_EVENT_QUEUE_ACCESS_KEY: + secretRef: sscs-sb-preview + key: primaryKey postgresql: enabled: false diff --git a/charts/sscs-tribunals-api/values.preview.template.yaml b/charts/sscs-tribunals-api/values.preview.template.yaml index 49a85022bf8..c311c3b2259 100644 --- a/charts/sscs-tribunals-api/values.preview.template.yaml +++ b/charts/sscs-tribunals-api/values.preview.template.yaml @@ -44,6 +44,7 @@ java: CITIZEN_LOGIN_SERVICE_V2: true ADD_LINK_TO_OTHER_ASSOCIATED_CASES_V2: true BYPASS_NOTIFICATIONS_SERVICE: true + BYPASS_HEARING_API_SERVICE: true HANDLE_CCD_CALLBACKMAP_V2: true TESTING_SUPPORT_ENABLED: true TOPIC_NAME: "${SERVICE_NAME}-servicebus-main-topic" @@ -148,7 +149,7 @@ xui-webapp: SERVICES_IDAM_API_URL: https://idam-api.aat.platform.hmcts.net SERVICES_S2S: http://rpe-service-auth-provider-aat.service.core-compute-aat.internal SERVICES_HEARINGS_COMPONENT_API: http://jurisdiction-hearings-api-aat.service.core-compute-aat.internal - SERVICES_HEARINGS_COMPONENT_API_SSCS: http://${SERVICE_NAME}-sscs-hearings-api + SERVICES_HEARINGS_COMPONENT_API_SSCS: http://${SERVICE_NAME}-java SERVICES_PRD_LOCATION_API: http://rd-location-ref-api-aat.service.core-compute-aat.internal SERVICES_PRD_JUDICIAL_API: http://rd-judicial-api-aat.service.core-compute-aat.internal SERVICES_PRD_COMMONDATA_API: http://rd-commondata-api-aat.service.core-compute-aat.internal @@ -584,7 +585,7 @@ redis: sscs-hearings-api: enabled: true java: - image: "hmctspublic.azurecr.io/sscs/hearings-api:latest" #Change to pr if required + image: "hmctspublic.azurecr.io/sscs/hearings-api:pr-646" #Change to pr if required releaseNameOverride: ${SERVICE_NAME}-sscs-hearings-api ingressHost: hearings-${SERVICE_FQDN} environment: @@ -604,7 +605,7 @@ sscs-hearings-api: #Messaging HMC_HEARINGS_LISTENING_ENABLED: true HMC_HEARINGS_TOPIC_NAME: "hmc-to-cft-aat" - HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-3973" + HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-4056" TRIBUNALS_HEARINGS_LISTENING_ENABLED: true TRIBUNALS_EVENT_QUEUE_NAME: ${SERVICE_NAME}-servicebus-tribunals-to-hearing-api TRIBUNALS_EVENT_QUEUE_POLICY_NAME: RootManageSharedAccessKey @@ -615,6 +616,7 @@ sscs-hearings-api: CORE_CASE_DATA_CASE_TYPE_ID: Benefit-${CHANGE_ID} HEARINGS_CASE_UPDATE_V2_ENABLED: true ADJOURNMENT_ENABLED: true + BYPASS_HEARING_API_SERVICE: true secrets: TRIBUNALS_EVENT_QUEUE_ACCESS_KEY: secretRef: sscs-sb-preview diff --git a/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/controller/ServiceHearingsControllerTest.java b/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/controller/ServiceHearingsControllerTest.java index 813a0f988e1..7818b2434a8 100644 --- a/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/controller/ServiceHearingsControllerTest.java +++ b/src/IntegrationTests/java/uk/gov/hmcts/reform/sscs/controller/ServiceHearingsControllerTest.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.util.List; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -31,7 +30,6 @@ @SpringBootTest @AutoConfigureMockMvc(addFilters = false) @ActiveProfiles("integration") -@Disabled("Please remove this line when Hearing api bypass feature flag is true") class ServiceHearingsControllerTest { private static final long CASE_ID = 1625080769409918L; diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/HearingsJmsConfig.java b/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/HearingsJmsConfig.java index 1d1fb56e2d2..9a56dc53bbe 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/HearingsJmsConfig.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/HearingsJmsConfig.java @@ -37,23 +37,23 @@ public class HearingsJmsConfig { @Value("${azure.service-bus.hmc-to-hearings-api.idleTimeout}") private Long idleTimeout; - @Bean - @ConditionalOnProperty({"feature.bypass-hearing-api-service.enabled", "flags.hmc-to-hearings-api.enabled"}) - public ConnectionFactory hmcHearingJmsConnectionFactory(@Value("${spring.application.name}") final String clientId) { + @Value("${spring.application.name}") + private String clientId; + + private ConnectionFactory hmcHearingJmsConnectionFactory() { String connection = String.format(AMQP_CONNECTION_STRING_TEMPLATE, namespace + connectionPostfix, idleTimeout); JmsConnectionFactory jmsConnectionFactory = new JmsConnectionFactory(connection); jmsConnectionFactory.setUsername(username); jmsConnectionFactory.setPassword(password); jmsConnectionFactory.setClientID(clientId); - return new CachingConnectionFactory(jmsConnectionFactory); } @Bean @ConditionalOnProperty({"feature.bypass-hearing-api-service.enabled", "flags.hmc-to-hearings-api.enabled"}) public JmsListenerContainerFactory hmcHearingsEventTopicContainerFactory( - ConnectionFactory hmcHearingJmsConnectionFactory, DefaultJmsListenerContainerFactoryConfigurer configurer) { + ConnectionFactory hmcHearingJmsConnectionFactory = hmcHearingJmsConnectionFactory(); DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); factory.setConnectionFactory(hmcHearingJmsConnectionFactory); factory.setReceiveTimeout(receiveTimeout); diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/TribunalsHearingsJmsConfig.java b/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/TribunalsHearingsJmsConfig.java index ae6ab73535c..531fa5f33f6 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/TribunalsHearingsJmsConfig.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/config/jms/TribunalsHearingsJmsConfig.java @@ -41,8 +41,10 @@ public class TribunalsHearingsJmsConfig { @Value("${azure.service-bus.amqp-connection-string-template:amqps://%1s?amqp.idleTimeout=%2d}") public String amqpConnectionStringTemplate; - @Bean - public ConnectionFactory tribunalsHearingsJmsConnectionFactory(@Value("${spring.application.name}") final String clientId) { + @Value("${spring.application.name}") + private String clientId; + + private ConnectionFactory tribunalsHearingsJmsConnectionFactory() { String connection = String.format(amqpConnectionStringTemplate, namespace + connectionPostfix, idleTimeout); JmsConnectionFactory jmsConnectionFactory = new JmsConnectionFactory(connection); jmsConnectionFactory.setUsername(username); @@ -53,8 +55,8 @@ public ConnectionFactory tribunalsHearingsJmsConnectionFactory(@Value("${spring. @Bean public JmsListenerContainerFactory tribunalsHearingsEventQueueContainerFactory( - ConnectionFactory tribunalsHearingsJmsConnectionFactory, DefaultJmsListenerContainerFactoryConfigurer defaultJmsListenerContainerFactoryConfigurer) { + ConnectionFactory tribunalsHearingsJmsConnectionFactory = tribunalsHearingsJmsConnectionFactory(); DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); factory.setConnectionFactory(tribunalsHearingsJmsConnectionFactory); factory.setReceiveTimeout(receiveTimeout); diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/HmcHearingsEventTopicListener.java b/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/HmcHearingsEventTopicListener.java index 4af23ca63ee..afa8abf72e4 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/HmcHearingsEventTopicListener.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/HmcHearingsEventTopicListener.java @@ -54,7 +54,9 @@ public HmcHearingsEventTopicListener(@Value("${sscs.serviceCode}") String sscsSe ) public void onMessage(JmsBytesMessage message) throws JMSException, HmcEventProcessingException { - if (!isByPassHearingServiceEnabled && isDeploymentFilterEnabled && !isMessageReleventForDeployment(message)) { + log.info("isByPassHearingServiceEnabled && isDeploymentFilterEnabled ------------------------> {}, {}", isByPassHearingServiceEnabled, + isDeploymentFilterEnabled); + if (isDeploymentFilterEnabled && !isMessageReleventForDeployment(message)) { return; } diff --git a/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventQueueListener.java b/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventQueueListener.java index 5fec62bf156..00b28def5f7 100644 --- a/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventQueueListener.java +++ b/src/main/java/uk/gov/hmcts/reform/sscs/jms/listener/TribunalsHearingsEventQueueListener.java @@ -40,6 +40,7 @@ public class TribunalsHearingsEventQueueListener { ) public void handleIncomingMessage(HearingRequest message) throws TribunalsEventProcessingException, GetCaseException, UpdateCaseException { + log.info("isByPassHearingServiceEnabled ------------------------> {}", isByPassHearingServiceEnabled); if (!isByPassHearingServiceEnabled) { return; }