@@ -2,6 +2,7 @@ package api.http.benchmark
2
2
3
3
import com .typesafe .config .ConfigFactory
4
4
import hmda .api .protocol .admin .WriteInstitutionProtocol
5
+ import hmda .model .institution .Institution
5
6
import io .gatling .core .Predef ._
6
7
import io .gatling .http .Predef ._
7
8
@@ -43,97 +44,29 @@ class FilingSimulation extends Simulation with WriteInstitutionProtocol {
43
44
exec(http(" Create Institution" )
44
45
.post(s " http:// $host: $adminPort/institutions " )
45
46
.body(StringBody (
46
- s """
47
- {
48
- "otherLenderCode": 0,
49
- "parent": {
50
- "respondentId": "-1",
51
- "city": "",
52
- "name": "",
53
- "state": "",
54
- "idRssd": -1
55
- },
56
- "activityYear": 2017,
57
- "cra": false,
58
- "assets": 35788,
59
- "agency": "ncua",
60
- "hmdaFilerFlag": false,
61
- "respondent": {
62
- "city": "HONOLULU",
63
- "name": "HAWAIIAN ELECTRIC EMPLOYEES FEDERAL CREDIT UNION",
64
- "externalId": {
65
- "value": "1869",
66
- "externalIdType": {
67
- "code": "ncua-charter-id",
68
- "name": "NCUA Charter Number"
69
- }
70
- },
71
- "state": "HI",
72
- "fipsStateNumber": "15"
73
- },
74
- "topHolder": {
75
- "city": "",
76
- "name": "",
77
- "state": "",
78
- "country": "",
79
- "idRssd": -1
80
- },
81
- "externalIds": [
82
- {
83
- "value": ${JsString (institutionId)},
84
- "externalIdType": {
85
- "code": "rssd-id",
86
- "name": "RSSD ID"
87
- }
88
- },
89
- {
90
- "value": "0",
91
- "externalIdType": {
92
- "code": "fdic-certificate-number",
93
- "name": "FDIC Certificate Number"
94
- }
95
- },
96
- {
97
- "value": "1869",
98
- "externalIdType": {
99
- "code": "ncua-charter-id",
100
- "name": "NCUA Charter Number"
101
- }
102
- },
103
- {
104
- "value": "0",
105
- "externalIdType": {
106
- "code": "occ-charter-id",
107
- "name": "OCC Charter Number"
108
- }
109
- },
110
- {
111
- "value": "990073423",
112
- "externalIdType": {
113
- "code": "federal-tax-id",
114
- "name": "Federal Tax ID"
115
- }
116
- }
117
- ],
118
- "id": ${JsString (institutionId)},
119
- "emailDomains": [
120
- ""
121
- ],
122
- "institutionType": "credit-union"
123
- }
124
- """ .stripMargin
125
- )).asJSON)
47
+ Institution .empty.copy(id = institutionId, activityYear = 2017 ).toJson.toString
48
+ )).asJSON
49
+ .check(status is 201 ))
50
+ }
51
+
52
+ def filings (institutionId : String ) = {
53
+ exec(http(" List Filings" )
54
+ .get(s " /institutions/ $institutionId/filings/2017 " )
55
+ .header(" cfpb-hmda-institutions" , institutionId)
56
+ .check(status is 200 ))
126
57
}
127
58
}
128
59
129
60
val listInstitutions = scenario(" List Institutions" ).exec(InstitutionScenario .list(" 4277" ))
130
61
val createInstitutions = scenario(" Create Institutions" ).exec(InstitutionScenario .create(" 4277" ))
62
+ val listFilings = scenario(" List Filings" ).exec(InstitutionScenario .filings(" 4277" ))
131
63
132
64
setUp(
133
65
listInstitutions.inject(
134
66
atOnceUsers(1 )
135
- ),
136
- createInstitutions.inject(atOnceUsers(1 ))
67
+ ).protocols(httpProtocol),
68
+ createInstitutions.inject(atOnceUsers(1 )).protocols(httpProtocol),
69
+ listFilings.inject(atOnceUsers(1 ))
137
70
.protocols(httpProtocol)
138
71
)
139
72
0 commit comments