Skip to content

Commit

Permalink
Test added for major creditor ref data and file names changed for cou…
Browse files Browse the repository at this point in the history
…rts and offences
  • Loading branch information
rajanigandra authored and rajanigandra committed May 22, 2024
1 parent 9064e22 commit 983a484
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ public class Constants {
public static final String COURTS_REF_DATA_URI = "/api/court/ref-data/";
public static final String LJA_REF_DATA_URI = "/api/local-justice-area/ref-data/";
public static final String OFFENCES_REF_DATA_URI = "/api/offence/ref-data/";

public static final String MAJOR_CREDITORS_URI = "/api/major-creditor/";
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import static uk.gov.hmcts.opal.config.Constants.COURTS_REF_DATA_URI;
import static uk.gov.hmcts.opal.steps.BearerTokenStepDef.getToken;

public class Courts extends BaseStepDef {
public class CourtsStepDef extends BaseStepDef {

@When("I make a request to the court ref data api with")
public void getRequestToCourtsRefData() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package uk.gov.hmcts.opal.steps;

import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import net.serenitybdd.rest.SerenityRest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


import static net.serenitybdd.rest.SerenityRest.then;
import static uk.gov.hmcts.opal.config.Constants.MAJOR_CREDITORS_URI;

import static uk.gov.hmcts.opal.steps.BearerTokenStepDef.getToken;

public class MajorCreditorsStepDef extends BaseStepDef {

static Logger log = LoggerFactory.getLogger(OffencesStepDef.class.getName());

@When("I make a request to the major creditors ref data api filter by major creditor id {int}")
public void getRequestToMajorCreditorsBy(int majorCreditorId) {
log.info("THE URL----" + getTestUrl() + MAJOR_CREDITORS_URI);

SerenityRest
.given()
.accept("*/*")
.header("Authorization", "Bearer " + getToken())
.contentType("application/json")
.when()
.get(getTestUrl() + MAJOR_CREDITORS_URI + majorCreditorId)
.then().log().all();
}

@Then("the major creditors ref data matching to result")
public void theMajorCreditorsRefDataMatchingToResult() {
then().assertThat()
.statusCode(200);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import static uk.gov.hmcts.opal.steps.BearerTokenStepDef.getToken;


public class Offences extends BaseStepDef {
public class OffencesStepDef extends BaseStepDef {

static Logger log = LoggerFactory.getLogger(Offences.class.getName());
static Logger log = LoggerFactory.getLogger(OffencesStepDef.class.getName());

@When("I make a request to the offence ref data api filtering by cjs code {string}")
public void getRequestToOffencesRefData(String filter) {
Expand All @@ -28,6 +28,7 @@ public void getRequestToOffencesRefData(String filter) {

}


@Then("the LJA ref data matching to result")
@Then("the court ref data matching to result")
@Then("the offence ref data matching to result")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Verifying the end points for the Major Creditors

@PO-349 @Opal
Scenario: Verifying the end points for the major creditors
Given I am testing as the "opal-test@hmcts.net" user
When I make a request to the major creditors ref data api filter by major creditor id 15
Then the major creditors ref data matching to result

0 comments on commit 983a484

Please sign in to comment.