-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from ministryofjustice/EMP-348-set-up-int-tes…
…ts-with-wiremock EMP-348: Run integration tests with wiremock
- Loading branch information
Showing
8 changed files
with
307 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
import { SuperAgentRequest } from 'superagent' | ||
import { stubFor } from './wiremock' | ||
|
||
export default { | ||
stubCrm5Api: ({ usn }: { usn: string }): SuperAgentRequest => | ||
stubFor({ | ||
request: { | ||
method: 'GET', | ||
urlPattern: `/api/internal/v1/equinity/crm5/${usn}`, | ||
}, | ||
response: { | ||
status: 200, | ||
headers: { | ||
'Content-Type': 'application/json;charset=UTF-8', | ||
}, | ||
jsonBody: { | ||
formDetails: { | ||
usn, | ||
hasPreviousApplication: 'No', | ||
previousApplicationRef: '', | ||
appealedPrevDecision: 'No', | ||
appealedPrevDecisionDetails: '', | ||
urgent: 'Yes', | ||
urgencyReason: 'Urgent', | ||
Firm: { | ||
firmAddress: '1 Some Street', | ||
firmName: 'Some form', | ||
firmPhone: '999999999', | ||
firmSupplierNo: '123ABC', | ||
firmContactName: 'Some contact', | ||
firmSolicitorName: 'Some solicitor', | ||
firmSolicitorRef: 'REF', | ||
}, | ||
CaseDetails: { | ||
levelOfWork: 'Advocacy', | ||
cwCriminalProceeding: false, | ||
cwCriminalInvestigation: false, | ||
cwCcrc: false, | ||
cwAppealsReview: false, | ||
cwPrisonLaw: true, | ||
}, | ||
ClientDetails: { | ||
firstName: 'John', | ||
surname: 'Doe', | ||
maritalStatus: 'Married', | ||
dateOfBirth: '1970-01-01T00:00:00.000+00:00', | ||
address: { | ||
postcode: 'XX0 XXX', | ||
addressLine1: '1 Some Street', | ||
addressLine2: 'Some Hill', | ||
city: 'Some city', | ||
county: 'Some county', | ||
}, | ||
UFN: 'Ufn', | ||
}, | ||
AdviceAssistance: { | ||
transferFromSolicitor: '', | ||
adviceCriteria: '', | ||
laaAdviceAssistance: { | ||
providedAdvice: '', | ||
notes: '', | ||
}, | ||
}, | ||
CapitalDetails: { | ||
isUnder18: 'No', | ||
numOfDependants: 2, | ||
clientSavings: 60000, | ||
partnerSavings: 40000, | ||
totalSavings: 100000, | ||
}, | ||
IncomeDetails: { | ||
hasIncomeSupport: false, | ||
weeklyClientIncome: 60000, | ||
weeklyPartnerIncome: 40000, | ||
weeklyIncomeWithoutDeduction: 100000, | ||
incomeTaxDeductions: 3000, | ||
niDeductions: 1500, | ||
partnerDeductions: 750, | ||
socialFundDeductions: 500, | ||
dependantChildrenUnder15: 90, | ||
deductionUnder15: 90, | ||
dependantChildrenOver16: 90, | ||
deductionOver16: 90, | ||
totalDeductions: 5930, | ||
totalWeeklyIncome: 100000, | ||
}, | ||
Proceedings: { | ||
TypeOfProceedings: { | ||
preCharge: '', | ||
appealProceedings: '', | ||
prisonLaw: '', | ||
}, | ||
DetailsOfProceedings: { | ||
dateOfNextHearing: '2024-08-02T00:00:00.000+00:00', | ||
isCounselInstructed: 'Yes', | ||
}, | ||
}, | ||
CourtAppealFunding: { | ||
hasCourtAppeal: 'Yes', | ||
appealDetails: '', | ||
benefitOfCourt: 'Yes', | ||
expertReport: 'Yes', | ||
}, | ||
AllCosts: { | ||
AccruedCosts: { | ||
Attendance: { | ||
time: '12:00:00', | ||
cost: 100.0, | ||
}, | ||
Preparation: { | ||
time: '13:00:00', | ||
cost: 200.0, | ||
}, | ||
Advocacy: { | ||
time: '14:00:00', | ||
cost: 300.0, | ||
}, | ||
Travel: { | ||
time: '15:00:00', | ||
cost: 400.0, | ||
}, | ||
Waiting: { | ||
time: '16:00:00', | ||
cost: 500.0, | ||
}, | ||
Letters: { | ||
total: 2.0, | ||
cost: 600.0, | ||
}, | ||
TelephoneCalls: { | ||
total: 3.0, | ||
cost: 700.0, | ||
}, | ||
Mileage: { | ||
total: 4.0, | ||
cost: 800.0, | ||
}, | ||
OtherDisbursement: { | ||
cost: 900.0, | ||
}, | ||
TotalCost: { | ||
cost: 4500.0, | ||
}, | ||
}, | ||
AnticipatedCosts: { | ||
Attendance: { | ||
time: '21:00:00', | ||
cost: 150.0, | ||
}, | ||
Preparation: { | ||
time: '20:00:00', | ||
cost: 250.0, | ||
}, | ||
Advocacy: { | ||
time: '19:00:00', | ||
cost: 350.0, | ||
}, | ||
Travel: { | ||
time: '18:00:00', | ||
cost: 450.0, | ||
}, | ||
Waiting: { | ||
time: '17:00:00', | ||
cost: 550.0, | ||
}, | ||
Letters: { | ||
total: 9.0, | ||
cost: 650.0, | ||
}, | ||
TelephoneCalls: { | ||
total: 8.0, | ||
cost: 750.0, | ||
}, | ||
Mileage: { | ||
total: 7.0, | ||
cost: 850.0, | ||
}, | ||
OtherDisbursement: { | ||
cost: 950.0, | ||
}, | ||
TotalCost: { | ||
cost: 4950.0, | ||
}, | ||
}, | ||
NewLimitRequest: { | ||
cost: 9450.0, | ||
}, | ||
}, | ||
CaseHistory: { | ||
summary: '', | ||
additionalInfo: '', | ||
}, | ||
Solicitor: { | ||
declaration: { | ||
date: '2024-02-14T00:00:00.000+00:00', | ||
name: 'DOE', | ||
}, | ||
certification: { | ||
date: '2024-02-14T00:00:00.000+00:00', | ||
name: 'DOE', | ||
}, | ||
}, | ||
OfficeUseOnly: { | ||
decision: '', | ||
}, | ||
StatementOfCase: 'Statement of case.', | ||
DetailsOfWorkCompleted: 'Details of work completed', | ||
DetailsOfApplication: 'Details of application', | ||
}, | ||
evidenceFiles: { | ||
files: [ | ||
{ | ||
key: '0000.att', | ||
type: 'SomeAttachment', | ||
name: 'some_attachment.pdf', | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { SuperAgentRequest } from 'superagent' | ||
import { stubFor } from './wiremock' | ||
|
||
export default { | ||
stubSearchApi: ({ type, typeName }: { type: number; typeName: string }): SuperAgentRequest => | ||
stubFor({ | ||
request: { | ||
method: 'GET', | ||
urlPattern: `/api/internal/v1/equinity/search/\\?type=${type}&page=0&pageSize=10`, | ||
}, | ||
response: { | ||
status: 200, | ||
headers: { | ||
'Content-Type': 'application/json;charset=UTF-8', | ||
}, | ||
jsonBody: { | ||
results: [ | ||
{ | ||
usn: 1234567, | ||
type: typeName, | ||
clientName: 'Doe', | ||
originatedDate: '2022-08-18', | ||
submittedDate: '2022-08-24', | ||
providerAccount: '123ABC', | ||
providerName: '123ABC, 1 SOME DR', | ||
status: 'Completed', | ||
}, | ||
{ | ||
usn: 2345678, | ||
type: typeName, | ||
clientName: 'Doe2', | ||
originatedDate: '2022-09-18', | ||
submittedDate: '2022-09-24', | ||
providerAccount: '234BCD', | ||
providerName: '234BCD, 1 SOME ST', | ||
status: 'Completed', | ||
}, | ||
{ | ||
usn: 3456789, | ||
type: typeName, | ||
clientName: 'Doe3', | ||
originatedDate: '2022-10-18', | ||
submittedDate: '2022-10-24', | ||
providerAccount: '345CDE', | ||
providerName: '345CDE, 1 SOME LANE', | ||
status: 'Completed', | ||
}, | ||
], | ||
paging: { | ||
size: 10, | ||
number: 0, | ||
total: 3, | ||
itemsPage: 10, | ||
itemsTotal: 3, | ||
}, | ||
}, | ||
}, | ||
}), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters