From 154aaf11edfaac3e61c356d7ce9012d9def31f80 Mon Sep 17 00:00:00 2001 From: praveenrach Date: Thu, 16 Mar 2023 17:57:01 +0000 Subject: [PATCH] enabled test cases --- .../hmi/functional/people/PeopleTest.java | 2 -- .../hmi/functional/sessions/SessionsLookUpTest.java | 3 --- .../videohearing/CloneVideoHearingTest.java | 2 -- .../hmi/smoke/crime/CrimeApiSmokeTest.java | 2 -- .../hmi/smoke/people/PeopleApiSmokeTest.java | 13 +++++++------ 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/people/PeopleTest.java b/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/people/PeopleTest.java index d5b22ec07..f12d42f44 100644 --- a/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/people/PeopleTest.java +++ b/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/people/PeopleTest.java @@ -6,7 +6,6 @@ import net.thucydides.core.annotations.Steps; import org.junit.Before; import org.junit.Test; -import org.junit.jupiter.api.Disabled; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; @@ -29,7 +28,6 @@ @SpringBootTest(classes = {Application.class}) @ActiveProfiles("functional") @SuppressWarnings({"java:S2699", "PMD.UseDiamondOperator"}) -@Disabled("Disabled until http error code 503 has been fixed!") public class PeopleTest extends FunctionalTest { @Value("${peopleRootContext}") diff --git a/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/sessions/SessionsLookUpTest.java b/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/sessions/SessionsLookUpTest.java index 6d9a332a6..0deba79ad 100644 --- a/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/sessions/SessionsLookUpTest.java +++ b/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/sessions/SessionsLookUpTest.java @@ -5,7 +5,6 @@ import net.thucydides.core.annotations.Narrative; import net.thucydides.core.annotations.Steps; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; @@ -27,7 +26,6 @@ @SpringBootTest(classes = {Application.class}) @ActiveProfiles("functional") @SuppressWarnings({"PMD.TooManyMethods"}) -@Ignore public class SessionsLookUpTest extends FunctionalTest { private static final String REQUEST_SESSION_TYPE = "requestSessionType"; @@ -115,7 +113,6 @@ public void testSuccessfulGetSessionForRequestSessionTypeAndPanelType() { public void testSuccessfulGetSessionForRequestSessionTypeAndJurisdiction() { Map queryParameters = new ConcurrentHashMap<>(); queryParameters.put(REQUEST_SESSION_TYPE, "CJ"); - queryParameters.put("requestJurisdiction", "CIV"); headersAsMap.put(DESTINATION_SYSTEM, SNL); sessionsLookUpSteps.checkSessionsForAllTheRelevantQueryParameters(sessionsRootContext, headersAsMap, diff --git a/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/videohearing/CloneVideoHearingTest.java b/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/videohearing/CloneVideoHearingTest.java index 142d015e8..bc8576f7c 100644 --- a/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/videohearing/CloneVideoHearingTest.java +++ b/src/functionalTest/java/uk/gov/hmcts/futurehearings/hmi/functional/videohearing/CloneVideoHearingTest.java @@ -5,7 +5,6 @@ import net.thucydides.core.annotations.Steps; import org.junit.Before; import org.junit.Test; -import org.junit.jupiter.api.Disabled; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; @@ -40,7 +39,6 @@ public void initialiseValues() throws Exception { super.initialiseValues(); } - @Disabled("This Test is skipped as we are getting service unavailable - 503") @Test public void testCloneVideoHearingWithValidHearingIdAndNoPayload() { headersAsMap = createStandardHmiHeader(SNL, "VH"); diff --git a/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/crime/CrimeApiSmokeTest.java b/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/crime/CrimeApiSmokeTest.java index 18723ac4e..ead9df81a 100644 --- a/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/crime/CrimeApiSmokeTest.java +++ b/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/crime/CrimeApiSmokeTest.java @@ -3,7 +3,6 @@ import io.restassured.response.Response; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; @@ -21,7 +20,6 @@ @ActiveProfiles("smoke") @DisplayName("Smoke Test for the HMI Hearing Context") @SuppressWarnings({"java:S2187", "PMD.LawOfDemeter"}) -@Disabled public class CrimeApiSmokeTest extends SmokeTest { @Value("${crimeHealthCheckRootContext}") diff --git a/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/people/PeopleApiSmokeTest.java b/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/people/PeopleApiSmokeTest.java index 381d9273b..4cc5e90d3 100644 --- a/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/people/PeopleApiSmokeTest.java +++ b/src/smokeTest/java/uk/gov/hmcts/futurehearings/hmi/smoke/people/PeopleApiSmokeTest.java @@ -3,13 +3,14 @@ import io.restassured.response.Response; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.test.context.ActiveProfiles; import uk.gov.hmcts.futurehearings.hmi.Application; +import uk.gov.hmcts.futurehearings.hmi.smoke.common.rest.RestClient; import uk.gov.hmcts.futurehearings.hmi.smoke.common.test.SmokeTest; import static io.restassured.RestAssured.given; @@ -20,23 +21,23 @@ @ActiveProfiles("smoke") @DisplayName("Smoke Test for the HMI People Context") @SuppressWarnings({"java:S2187", "PMD.LawOfDemeter"}) -@Disabled("Disabled until http error code 503 has been fixed!") class PeopleApiSmokeTest extends SmokeTest { - private static final String PEOPLE_HEALTH_CHECK = "https://hmi-apim.test.platform.hmcts.net/hmi/elinks-health"; + @Value("${peopleHealthcheck}") + private String peopleHealthcheck; @BeforeAll @Override public void initialiseValues() throws Exception { super.initialiseValuesDefault(); - setRootContext(PEOPLE_HEALTH_CHECK); + setRootContext(peopleHealthcheck); } @Test @DisplayName("Smoke Test to test the people endpoint") void testPeopleHmiApiGet() { - Response response = makeGetRequest(getRootContext()); - assertEquals(HttpStatus.OK.value(), response.getStatusCode(), "Response codes should match"); + Response response = RestClient.makeGetRequest(getRootContext()); + assertEquals(HttpStatus.OK.value(), response.getStatusCode(), "Response codes do not match"); } public static Response makeGetRequest(final String rootContext) {