Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #700 from hmcts/hmis-1155-stg
Browse files Browse the repository at this point in the history
enabled test cases
  • Loading branch information
praveenrach authored Mar 17, 2023
2 parents 80170b4 + 154aaf1 commit fa774e9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -115,7 +113,6 @@ public void testSuccessfulGetSessionForRequestSessionTypeAndPanelType() {
public void testSuccessfulGetSessionForRequestSessionTypeAndJurisdiction() {
Map<String, String> queryParameters = new ConcurrentHashMap<>();
queryParameters.put(REQUEST_SESSION_TYPE, "CJ");
queryParameters.put("requestJurisdiction", "CIV");
headersAsMap.put(DESTINATION_SYSTEM, SNL);
sessionsLookUpSteps.checkSessionsForAllTheRelevantQueryParameters(sessionsRootContext,
headersAsMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit fa774e9

Please sign in to comment.