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 #635 from hmcts/hmis-1063-dev
Browse files Browse the repository at this point in the history
Hmis 1063 dev
  • Loading branch information
Ravipati89 authored Oct 11, 2022
2 parents 327f9be + c7f3437 commit c3d5b29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
16 changes: 2 additions & 14 deletions infrastructure/template/api-op-elinks-health-policy.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
<policies>
<inbound>
<send-request ignore-error="false" timeout="20" response-variable-name="snlClientResponse" mode="new">
<set-url>https://#{keyVaultHost}#/secrets/snl-client-app-client/?api-version=7.0</set-url>
<set-method>GET</set-method>
<authentication-managed-identity resource="https://vault.azure.net" />
</send-request>
<set-variable name="elinksToken" value="@{
var secret = ((IResponse)context.Variables["elinksOAuthToken"]).Body.As<JObject>();
return secret["value"].ToString();
}" />
<set-header name="Authorization" exists-action="override">
<value>@("Bearer " + (String)context.Variables["elinksToken"])</value>
</set-header>
<rewrite-uri template="/people?updated_since=4018-04-10 " copy-unmatched-params="true" />
<set-backend-service base-url="https://jo-staging.elinks.judiciary.uk/api/" />
<rewrite-uri template="/healthcheck" copy-unmatched-params="true" />
<set-backend-service base-url="https://#{elinksHost}#/api/" />
</inbound>
<backend>
<base />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

import static io.restassured.RestAssured.given;
import static org.junit.jupiter.api.Assertions.assertEquals;

@Slf4j
@Disabled("Failing due to issue, to be re-enabled in future ticket once fix implemented")
@SpringBootTest(classes = {Application.class})
@ActiveProfiles("smoke")
@DisplayName("Smoke Test for the HMI People Context")
@SuppressWarnings("java:S2187")
class PeopleApiSmokeTest extends SmokeTest {

@Value("${peopleHealthcheck}")
private String peopleHealthcheck;
private String peopleHealthcheck = "https://hmi-apim.test.platform.hmcts.net/hmi/elinks-health";

@BeforeAll
public void initialiseValues() throws Exception {
Expand All @@ -39,10 +38,15 @@ public void initialiseValues() throws Exception {
@Test
@DisplayName("Smoke Test to test the people endpoint")
void testPeopleHmiApiGet() {
Response response = RestClient.makeGetRequest(getHeadersAsMap(),
getAuthorizationToken(),
getRootContext());

Response response = makeGetRequest(getRootContext());
assertEquals(HttpStatus.OK.value(), response.getStatusCode());
}
}

public static Response makeGetRequest(final String rootContext) {
Response response = given()
.baseUri(rootContext)
.when()
.get();
return response;
}
}

0 comments on commit c3d5b29

Please sign in to comment.