-
Notifications
You must be signed in to change notification settings - Fork 2
RDM-4217 - Create Case Data with document attachment in perftest env #16
base: master
Are you sure you want to change the base?
Changes from 18 commits
4bdc0bb
27ce73d
a3bd088
6daf565
26ecfa1
15a4e77
7e87c7e
74f8a73
738cfc8
baaa325
5c83999
6de74a7
c21ae2f
491138f
caf42db
f78ff5c
94744e4
10bbf06
212dae4
3134fb5
d007f60
d77d02f
ea80273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ results/ | |
src.zip | ||
.DS_Store | ||
/gatling.log | ||
*.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Thu Apr 11 15:34:33 BST 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ localhost { | |
"1547820791714750", "1547036690988904", "1545234546871901", "1548253985508219", "1547200037389206"] | ||
//getCaseUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/:case_reference" | ||
getCaseUrl = "internal/cases/:case_reference" | ||
// getPaginationMetadataUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/pagination_metadata?state=CaseCreated" | ||
// getPaginationMetadataUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/pagination_metadata?state=CaseCreated" | ||
getPaginationMetadataUrl = "caseworkers/"${userCcdId}"/jurisdictions/PROBATE/case-types/GrantOfRepresentation/cases/pagination_metadata?state=CaseCreated&case.PersonLastName=unknown" | ||
createCaseUrl = "caseworkers/"${userCcdId}"/jurisdictions/SSCS/case-types/Benefit/cases" | ||
getUserProfileUrl = "caseworkers/538/profile" | ||
|
@@ -245,19 +245,37 @@ cnp_perftest { | |
oAuth2clientSecret = "${IDAM_OAUTH2_CLIENT_SECRET}" | ||
|
||
cases = ["1559642192860544"] | ||
getCaseUrl = "internal/cases/:case_reference" | ||
ccdCaseMgmtUrl = "https://ccd-case-management-web-perftest.service.core-compute-perftest.internal" | ||
getCaseUrl = "aggregated/caseworkers/a2fe2e87-94f7-44a9-a272-5c413a4775c0/jurisdictions/AUTOTEST1/case-types/AAT/cases/1531212825013102" | ||
getCaseUrlV2 = "internal/cases/1559642192860544" | ||
createCaseUrl = "caseworkers/a2fe2e87-94f7-44a9-a272-5c413a4775c0/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
validateCaseUrl = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/cases" | ||
getUserProfileUrl = "caseworkers/176475/profile" | ||
getUserProfileUrl = "caseworkers/a2fe2e87-94f7-44a9-a272-5c413a4775c0/profile" | ||
getUserProfileUrlV2 = "caseworkers/539560/profile" | ||
searchCases = "aggregated/caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/cases?state=CaseCreated" | ||
getPaginationMetadataUrl = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/cases/pagination_metadata?state=CaseCreated" | ||
saveEventUrl = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/CASETYPE2/cases/1531207599597587/events" | ||
searchInputDetails = "aggregated/caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/inputs" | ||
workbasketInputDetails = "/aggregated/caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/work-basket-inputs" | ||
getPrintableDocumentsForEvent = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/CASETYPE2/cases/1531207599597587/documents" | ||
validateCaseDetails = "caseworkers/176475/jurisdictions/AUTOTEST1/case-types/AAT/validate" | ||
docStoreBashURL = "https://dm-store-perftest.service.core-compute-perftest.internal" | ||
ESSearch = "searchCases" | ||
docStoreBashURL123 = "https://dm-store-perftest.service.core-compute-perftest.internal" | ||
docStoreBashURL = "https://gateway-ccd.perftest.platform.hmcts.net" | ||
prodSSCSWorkBasket = "aggregated/caseworkers/560966/jurisdictions/SSCS/case-types/Benefit/cases?view=WORKBASKET&page=1&case.caseReference=test1234567" | ||
prodSSCSPagination = "caseworkers/560966/jurisdictions/SSCS/case-types/Benefit/cases/pagination_metadata?case.caseReference=test123456" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
prodDIVORCED8caseReference = "aggregated/caseworkers/560966/jurisdictions/DIVORCE/case-types/DIVORCE/cases?page=1&case.D8caseReference=EZ12D81234" | ||
prodDIVORCED8caseReferencePagination = "caseworkers/560966/jurisdictions/DIVORCE/case-types/DIVORCE/cases/pagination_metadata?case.D8caseReference=EZ12D81234" | ||
createCaseDIVUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. createCaseDIVUrl, createCaseSSCSUrl, createCaseCMCUrl... all duplicated. Needs sorting out |
||
createCaseSSCSUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createCaseCMCUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createCaseProbateGrantApplicationUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createCaseProbateCaveatApplicationUrl = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createIACaseAppURL = "caseworkers/81d4aa29-7ba2-4884-a5a4-e2a0211bfe7c/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createFPLCaseAppURL = "caseworkers/77a5a58b-4d17-43b1-8df4-5cccd6cb1472/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createFRCaseAppURL = "caseworkers/44d5d0eb-0739-49e6-8c5e-bd556ef633d2/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
createETHOSCaseAppURL = "caseworkers/b1d866d5-2e78-454a-b18a-95020d0bb603/jurisdictions/:jurisdictions_reference/case-types/:casetype_reference/cases" | ||
saveEventETHOSUploadDocsUrl = "caseworkers/30b48b61-7abf-4747-9270-8e86f466c0d6/jurisdictions/PUBLICLAW/case-types/TRIB_MVP_3_TYPE_Manc/cases/1559571632599539/events" | ||
} | ||
|
||
cnp_saat { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
filename | ||
1MB.pdf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
package uk.gov.hmcts.ccd.corecasedata.scenarios | ||
|
||
import io.gatling.core.Predef._ | ||
import io.gatling.http.Predef._ | ||
import uk.gov.hmcts.ccd.util.{CcdTokenGenerator, PerformanceTestsConfig} | ||
|
||
import scala.concurrent.duration._ | ||
import scala.util.Random | ||
|
||
|
||
object CreateDIVCaseDataKJ extends PerformanceTestsConfig { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you rename this object to CreateDIVCaseData without KJ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is not needed under scenario folder so removed |
||
|
||
// val EventId = "applyForGrant" | ||
private val rng: Random = new Random() | ||
private def d8MarriagePetitionerName(): String = rng.alphanumeric.take(10).mkString | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could have created this definition probably in PerformanceTestConfig or another abstract class CreateCaseData with a generic name and used it in the scenario like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed about this already for each case field we need to enter data with different length so would prefer to keep it like this. |
||
private def d8MarriageRespondentName(): String = rng.alphanumeric.take(10).mkString | ||
private def d8PetitionerEmail(): String = rng.alphanumeric.take(10).mkString | ||
private def d8caseReference(): Int = rng.nextInt(9999) | ||
private def d8PetitionerPhoneNumber(): Int = rng.nextInt(99999999) | ||
private def d8PetitionerFirstName(): String = rng.alphanumeric.take(10).mkString | ||
private def d8PetitionerLastName(): String = rng.alphanumeric.take(10).mkString | ||
private def d8RespondentFirstName(): String = rng.alphanumeric.take(10).mkString | ||
private def d8RespondentLastName(): String = rng.alphanumeric.take(10).mkString | ||
private def d8DerivedPetitionerCurrentFullName(): String = rng.alphanumeric.take(10).mkString | ||
private def caseSummaryText(): String = rng.alphanumeric.take(20).mkString | ||
private def caseDescriptionText(): String = rng.alphanumeric.take(30).mkString | ||
private def burnid(): Int = rng.nextInt(99999999) | ||
private def d8MarriageDate(): Int = rng.nextInt(999) | ||
|
||
// val EventId = "CREATE" | ||
val randcaseType = new Random(System.currentTimeMillis()) | ||
val caseEventTypeValue = Array("CREATE") | ||
val caseTypeValue_random_index = randcaseType.nextInt(caseEventTypeValue.length) | ||
val EventId = caseEventTypeValue(caseTypeValue_random_index) | ||
def PickCaseType(): String = EventId | ||
//def PickCaseType(): String = caseEventTypeValue(randcaseType.nextInt(caseEventTypeValue.length)) | ||
|
||
println("caseTypeText Value " + EventId) | ||
println("caseTypeText Value " + PickCaseType()) | ||
|
||
var CreateCaseUrl = caseDataUrl(config.getString("createCaseDIVUrl")) | ||
|
||
println("create case url: " + CreateCaseUrl) | ||
|
||
val caseTypeValue = Array("DIVORCE") | ||
//val caseTypeValue = Array("ATCASETYPE1","ATCASETYPE2","ATCASETYPE3","ATCASETYPE4") | ||
val jurisdictionsValue = Array("DIVORCE") | ||
|
||
val rand = new Random(System.currentTimeMillis()) | ||
val caseType_random_index = rand.nextInt(caseTypeValue.length) | ||
|
||
val jurisdictions_random_index = rand.nextInt(jurisdictionsValue.length) | ||
|
||
if(!CreateCaseUrl.contains(":casetype_reference")) | ||
{ | ||
CreateCaseUrl | ||
} | ||
else{ | ||
CreateCaseUrl = CreateCaseUrl.replace(":casetype_reference", caseTypeValue(caseType_random_index)) | ||
} | ||
|
||
println("create case url: " + CreateCaseUrl) | ||
|
||
if(!CreateCaseUrl.contains(":jurisdictions_reference")) | ||
{ | ||
CreateCaseUrl | ||
} | ||
else{ | ||
CreateCaseUrl = CreateCaseUrl.replace(":jurisdictions_reference", jurisdictionsValue(jurisdictions_random_index)) | ||
} | ||
|
||
println("create case url: " + CreateCaseUrl) | ||
val CreateCaseTokenUrl = s"${CreateCaseUrl.replaceAll("cases", "")}event-triggers/$EventId/token" | ||
|
||
|
||
println("create case url: " + CreateCaseUrl) | ||
println("create case token url: " + CreateCaseTokenUrl) | ||
|
||
val EventBodyMain =StringBody("""{"data":{"D8legalProcess":"divorce","createdDate":"2018-10-10","D8ScreenHasMarriageBroken":"No","D8ScreenHasRespondentAddress":"Yes","D8ScreenHasMarriageCert":"No","D8ScreenHasPrinter":"Yes","D8DivorceWho":"husband","D8MarriageIsSameSexCouple":"No","D8InferredPetitionerGender":"male","D8InferredRespondentGender":"female","D8MarriedInUk":"Yes","D8CertificateInEnglish":"Yes","D8CertifiedTranslation":"No","D8MarriagePlaceOfMarriage":"London","D8CountryName":"UK","D8PetitionerNameDifferentToMarriageCert":"No","D8PetitionerPhoneNumber":"07${D8PetitionerPhoneNumber}","D8DerivedPetitionerCurrentFullName":"Robert Del monte ${D8DerivedPetitionerCurrentFullName}","D8PetitionerNameChangedHow":["marriageCertificate","deedPoll"],"D8PetitionerNameChangedHowOtherDetails":"Namechangedwithnoreason","D8PetitionerContactDetailsConfidential":"keep","D8PetitionerHomeAddress":{"AddressLine1":"14AvenueRoad","AddressLine2":"RevenueLane","AddressLine3":null,"PostCode":"W45XR","PostTown":"Chiswick","County":"Middlesex","Country":"UK"},"D8DerivedPetitionerHomeAddress":"Sameasabove","D8PetitionerCorrespondenceAddress":{"AddressLine1":null,"AddressLine2":null,"AddressLine3":null,"PostCode":null,"PostTown":null,"County":null,"Country":null},"D8DerivedPetitionerCorrespondenceAddr":"Sameasabove","D8PetitionerCorrespondenceUseHomeAddress":"Yes","D8RespondentNameAsOnMarriageCertificate":"Yes","D8DerivedRespondentCurrentName":"Dimarta","D8DerivedRespondentSolicitorDetails":"NotKnown","D8RespondentHomeAddress":{"AddressLine1":"15AvenueRoad","AddressLine2":"RevenueLane","AddressLine3":null,"PostCode":"W45XR","PostTown":"Chiswick","County":"Middlesex","Country":"UK"},"D8DerivedRespondentHomeAddress":"sameasabove","D8RespondentCorrespondenceAddress":{"AddressLine1":null,"AddressLine2":null,"AddressLine3":null,"PostCode":null,"PostTown":null,"County":null,"Country":null},"D8DerivedRespondentCorrespondenceAddr":"sameasabove","D8RespondentSolicitorName":"RickSick","D8RespondentSolicitorCompany":"DivorcedSolicitors","D8RespondentCorrespondenceSendToSol":"Yes","D8RespondentSolicitorAddress":{"AddressLine1":"16AvenueRoad","AddressLine2":"RevenueLane","AddressLine3":null,"PostCode":"W45XR","PostTown":"Chiswick","County":"Middlesex","Country":"UK"},"D8DerivedRespondentSolicitorAddr":"sameasabove","D8RespondentCorrespondenceUseHomeAddress":"Yes","D8RespondentKnowsHomeAddress":"Yes","D8RespondentLivesAtLastAddress":"No","D8LivingArrangementsTogetherSeparated":"Yes","D8LivingArrangementsLastLivedTogether":"No","D8LivingArrangementsLiveTogether":"Yes","D8LivingArrangementsLastLivedTogethAddr":{"AddressLine1":null,"AddressLine2":null,"AddressLine3":null,"PostCode":null,"PostTown":null,"County":null,"Country":null},"D8DerivedLivingArrangementsLastLivedAddr":"sameasabove","D8LegalProceedings":"No","D8LegalProceedingsRelated":["property","marriage"],"D8LegalProceedingsDetails":null,"D8ReasonForDivorce":"separation-2-years","D8DerivedStatementOfCase":null,"D8ReasonForDivorceBehaviourDetails":null,"D8ReasonForDivorceDesertionDate":"2019-12-12","D8ReasonForDivorceDesertionAgreed":"No","D8ReasonForDivorceDesertionDetails":null,"D8ReasonForDivorceSeperationDate":"2017-10-10","D8ReasonForDivorceAdultery3rdPartyFName":null,"D8ReasonForDivorceAdultery3rdPartyLName":null,"D8DerivedReasonForDivorceAdultery3dPtyNm":null,"D8ReasonForDivorceAdulteryDetails":"notknown","D8ReasonForDivorceAdulteryKnowWhen":"Yes","D8ReasonForDivorceAdulteryWishToName":"No","D8ReasonForDivorceAdulteryKnowWhere":"Yes","D8ReasonForDivorceAdulteryWhereDetails":"notknown","D8ReasonForDivorceAdulteryWhenDetails":"notknown","D8ReasonForDivorceAdulteryIsNamed":"Yes","D8ReasonForDivorceAdultery3rdAddress":{"AddressLine1":"17AvenueRoad","AddressLine2":"RevenueLane","AddressLine3":null,"PostCode":"W45XR","PostTown":"Chiswick","County":"Middlesex","Country":"UK"},"D8DerivedReasonForDivorceAdultery3rdAddr":"sameasabove","D8FinancialOrder":"No","D8FinancialOrderFor":["petitioner"],"D8HelpWithFeesAppliedForFees":"Yes","D8HelpWithFeesReferenceNumber":null,"D8PaymentMethod":"card","D8DivorceCostsClaim":"No","D8DivorceIsNamed":"No","D8DivorceClaimFrom":["respondent","correspondent"],"D8JurisdictionConfidentLegal":"Yes","D8JurisdictionConnection":["A","C","E","F"],"D8JurisdictionLastTwelveMonths":"Yes","D8JurisdictionPetitionerDomicile":"No","D8JurisdictionPetitionerResidence":"Yes","D8JurisdictionRespondentDomicile":"No","D8JurisdictionRespondentResidence":"Yes","D8JurisdictionHabituallyResLast6Months":"No","Payments":[],"D8DocumentsUploaded":[],"D8DocumentsGenerated":[],"D8StatementOfTruth":"No","D8Cohort":"onlineSubmissionPrivateBeta","AosLetterHolderId":null,"D8caseReference":"EZ12D8${D8caseReference}","D8DivorceUnit":"eastMidlands","D8MarriageDate":"1${D8MarriageDate}-10-10","D8MarriagePetitionerName":"Francis Dela Cruz ${D8MarriagePetitionerName}","D8MarriageRespondentName":"Cruz Dela Francis ${D8MarriageRespondentName}","D8PetitionerFirstName":"Della ${D8PetitionerFirstName}","D8PetitionerLastName":"Francis ${D8PetitionerLastName}","D8PetitionerEmail":"dela_${D8PetitionerEmail}@francis.com","D8RespondentFirstName":"Dimello ${D8RespondentFirstName}","D8RespondentLastName":"Best ${D8RespondentLastName}","D8HelpWithFeesNeedHelp":"Yes","dueDate":"2019-10-10","SolPaymentHowToPay":"feePayByAccount","burnID":"10${burnID}","receivedDate":"2019-01-10"},"event":{"id":"create","summary": "Performance Testing Event summary ${CaseSummaryText}","description": "Performance Testing Event description ${CaseDescriptionText}"},"event_token": """" + "${eventToken}" + """","ignore_warning":false,"draft_id":null}""") | ||
|
||
|
||
val token = CcdTokenGenerator.generateGatewayS2SToken() | ||
val userToken = CcdTokenGenerator.generateWebUserToken() | ||
|
||
|
||
val CreateDIVCaseDataSCN = scenario("Create DIV Case Data").during(TotalRunDuration minutes) { | ||
exec( | ||
_.setAll( | ||
("D8MarriagePetitionerName", d8MarriagePetitionerName()), | ||
("D8MarriageRespondentName", d8MarriageRespondentName()), | ||
("D8caseReference", d8caseReference()), | ||
("D8PetitionerPhoneNumber",d8PetitionerPhoneNumber()), | ||
("D8PetitionerFirstName",d8PetitionerFirstName()), | ||
("D8PetitionerLastName",d8PetitionerLastName()), | ||
("D8DerivedPetitionerCurrentFullName",d8DerivedPetitionerCurrentFullName()), | ||
("CaseSummaryText",caseSummaryText()), | ||
("CaseDescriptionText",caseDescriptionText()), | ||
("D8PetitionerEmail", d8PetitionerEmail()), | ||
("burnID",burnid()), | ||
("D8RespondentFirstName",d8RespondentFirstName()), | ||
("D8RespondentLastName",d8RespondentLastName()), | ||
("PickCaseEventType",PickCaseType()), | ||
("D8MarriageDate", d8MarriageDate()) | ||
) | ||
).exec( | ||
//http("get create case event token") | ||
http("TX01_CCD_CreateCaseEndpoint_Divorce_createcase_eventtoken") | ||
.get(CreateCaseTokenUrl) | ||
.header("ServiceAuthorization", token) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status.is(200),jsonPath("$.token").saveAs("eventToken")) | ||
).exec( | ||
//http("create case data") | ||
http("TX02_CCD_CreateCaseEndpoint_Divorce_createcasedata") | ||
.post(CreateCaseUrl) | ||
.body(EventBodyMain).asJson | ||
.header("ServiceAuthorization", token) | ||
.header("Authorization", userToken) | ||
.header("Content-Type","application/json") | ||
.check(status is 201) | ||
) | ||
|
||
.pause(MinThinkTime seconds, MaxThinkTime seconds) | ||
} | ||
|
||
|
||
val waitForNextIteration = pace(MinWaitForNextIteration seconds, MaxWaitForNextIteration seconds) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docStoreBashURL123? what does that means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docStoreBashURL123 not needed. removed