finapps 5.0.2 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/finapps.gemspec +2 -2
- data/lib/finapps/version.rb +1 -1
- data/lib/tasks/releaser.rake +3 -4
- data/spec/rest/alert_definitions_spec.rb +1 -1
- data/spec/rest/alert_occurrences_spec.rb +1 -1
- data/spec/rest/consumers_portfolios_spec.rb +1 -1
- data/spec/rest/operators_spec.rb +1 -1
- data/spec/rest/orders_spec.rb +3 -3
- data/spec/rest/portfolio_reports_spec.rb +1 -1
- data/spec/rest/portfolios_available_consumers_spec.rb +1 -1
- data/spec/rest/portfolios_consumers_spec.rb +3 -3
- data/spec/rest/portfolios_spec.rb +1 -1
- data/spec/spec_helper.rb +4 -0
- data/spec/support/fake_api.rb +131 -117
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cc8f3182020dea8fb734048141cf00d287e70d107e71006671b88ed2f81d9fa
|
4
|
+
data.tar.gz: 8d21a3acc5bb62ce331672b0bceff88d46096d49d3200d9e9e0129fece5a192e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53ec19d9a43dccfa1b3ba605b4216a5001ab26e1c30bf1dbf318120e1648ea83486a467d94fbf87b4563c359bc194c2ca95bd531bb5086d141238b515d84c9ba
|
7
|
+
data.tar.gz: f30df20bf25322843b993c1a5bbf484e5d3eff0d9cd0b663bde45e013241279610c07a2d49abc3d2029a0d1a5a34b2dd87ae360ab55c8bf20e82c135048c23ca
|
data/finapps.gemspec
CHANGED
@@ -20,9 +20,9 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = Dir['spec/**/*.rb']
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_runtime_dependency 'finapps_core', '~>
|
23
|
+
spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.0'
|
24
24
|
|
25
|
-
spec.add_development_dependency 'bundler', '~> 2.0',
|
25
|
+
spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
|
26
26
|
spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
|
27
27
|
spec.add_development_dependency 'gem-release', '~> 2.0', '>= 2.0.3'
|
28
28
|
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.2'
|
data/lib/finapps/version.rb
CHANGED
data/lib/tasks/releaser.rake
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
desc 'Bumps the version to the next patch level, tags and pushes the code to
|
4
|
-
origin repository
|
4
|
+
origin repository'
|
5
5
|
task :bump do
|
6
6
|
system 'gem bump --tag --push --skip-ci'
|
7
7
|
end
|
8
8
|
|
9
|
-
desc '
|
10
|
-
origin repository and releases the gem. BOOM!'
|
9
|
+
desc 'Releases the gem and pushes any tags to the origin repository'
|
11
10
|
task :release do
|
12
11
|
system 'gem release --push'
|
13
|
-
end
|
12
|
+
end
|
@@ -35,7 +35,7 @@ RSpec.describe FinApps::REST::AlertDefinitions do
|
|
35
35
|
it('returns no error messages') { expect(errors).to be_empty }
|
36
36
|
it 'builds query and sends proper request' do
|
37
37
|
list
|
38
|
-
url = "#{
|
38
|
+
url = "#{versioned_api_path}/portfolio/alerts/definitions?page=2&requested=25&" \
|
39
39
|
'sort=-created_date'
|
40
40
|
expect(WebMock).to have_requested(:get, url)
|
41
41
|
end
|
@@ -35,7 +35,7 @@ RSpec.describe FinApps::REST::AlertOccurrences do
|
|
35
35
|
it('returns no error messages') { expect(errors).to be_empty }
|
36
36
|
it 'builds query and sends proper request' do
|
37
37
|
list
|
38
|
-
url = "#{
|
38
|
+
url = "#{versioned_api_path}/portfolio/alerts/occurrences?" \
|
39
39
|
'filter=%7B%22portfolio_id%22:%22valid_id%22%7D&page=2&requested=25&sort=-created_date'
|
40
40
|
expect(WebMock).to have_requested(:get, url)
|
41
41
|
end
|
@@ -45,7 +45,7 @@ RSpec.describe FinApps::REST::ConsumersPortfolios do
|
|
45
45
|
it('returns no error messages') { expect(errors).to be_empty }
|
46
46
|
it 'builds query and sends proper request' do
|
47
47
|
list
|
48
|
-
url = "#{
|
48
|
+
url = "#{versioned_api_path}/consumers/#{id}/portfolios?page=2&" \
|
49
49
|
'requested=25&sort=-created_date'
|
50
50
|
expect(WebMock).to have_requested(:get, url)
|
51
51
|
end
|
data/spec/rest/operators_spec.rb
CHANGED
@@ -34,7 +34,7 @@ RSpec.describe FinApps::REST::Operators, 'initialized with valid FinApps::Client
|
|
34
34
|
it('returns no error messages') { expect(error_messages).to be_empty }
|
35
35
|
it 'builds query and sends proper request' do
|
36
36
|
list
|
37
|
-
url = "#{
|
37
|
+
url = "#{versioned_api_path}/operators?filter=%7B%22last_name%22:%22term%22," \
|
38
38
|
'%22role%22:2%7D&page=2&requested=25&sort=date_created'
|
39
39
|
expect(WebMock).to have_requested(:get, url)
|
40
40
|
end
|
data/spec/rest/orders_spec.rb
CHANGED
@@ -88,7 +88,7 @@ RSpec.describe FinApps::REST::Orders do
|
|
88
88
|
it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty }
|
89
89
|
it 'builds query and sends proper request' do
|
90
90
|
subject
|
91
|
-
url = "#{
|
91
|
+
url = "#{versioned_api_path}/orders?filter=%7B%22$or%22:%5B%7B%22public_id%22:" \
|
92
92
|
'%7B%22$regex%22:%22%5Eterm%22,%22$options%22:%22i%22%7D%7D,%7B%22applicant.last_name%22:%22term%22%7D' \
|
93
93
|
',%7B%22assignment.last_name%22:%22term%22%7D,%7B%22requestor.reference_no%22:%7B%22$regex%22:%22%5E' \
|
94
94
|
'term%22,%22$options%22:%22i%22%7D%7D%5D,%22status%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.' \
|
@@ -98,7 +98,7 @@ RSpec.describe FinApps::REST::Orders do
|
|
98
98
|
it 'builds query and sends proper request with searchTerm/relation exclusivity' do
|
99
99
|
params[:searchTerm] = nil
|
100
100
|
subject
|
101
|
-
url = "#{
|
101
|
+
url = "#{versioned_api_path}/orders?filter=%7B%22status%22:%7B%22$in%22:%5B1," \
|
102
102
|
'7%5D%7D,%22assignment.operator_id%22:%22valid_operator%22,%22$or%22:%5B%7B%22public_id%22:%7B%22$in' \
|
103
103
|
'%22:%5B%22valid_order_id%22%5D%7D%7D,%7B%22original_order_id%22:%7B%22$in%22:%5B%22valid_order_id%22' \
|
104
104
|
'%5D%7D%7D%5D%7D&page=2&requested=25&sort=status'
|
@@ -107,7 +107,7 @@ RSpec.describe FinApps::REST::Orders do
|
|
107
107
|
it 'builds null assignment query properly when supplied w/ empty string' do
|
108
108
|
FinApps::REST::Orders.new(client).list(assignment: '')
|
109
109
|
|
110
|
-
url = "#{
|
110
|
+
url = "#{versioned_api_path}/orders?filter=%7B%22assignment.operator_id%22:null%7D"
|
111
111
|
expect(WebMock).to have_requested(:get, url)
|
112
112
|
end
|
113
113
|
end
|
@@ -35,7 +35,7 @@ RSpec.describe FinApps::REST::PortfolioReports do
|
|
35
35
|
it('returns no error messages') { expect(errors).to be_empty }
|
36
36
|
it 'builds query and sends proper request' do
|
37
37
|
list
|
38
|
-
url = "#{
|
38
|
+
url = "#{versioned_api_path}/portfolio/reports?page=2&requested=25&" \
|
39
39
|
'sort=-created_date'
|
40
40
|
expect(WebMock).to have_requested(:get, url)
|
41
41
|
end
|
@@ -45,7 +45,7 @@ RSpec.describe FinApps::REST::PortfoliosAvailableConsumers do
|
|
45
45
|
it('returns no error messages') { expect(errors).to be_empty }
|
46
46
|
it 'builds query and sends proper request' do
|
47
47
|
list
|
48
|
-
url = "#{
|
48
|
+
url = "#{versioned_api_path}/portfolios/#{id}/consumers/available?page=2&" \
|
49
49
|
'requested=25&sort=-created_date'
|
50
50
|
expect(WebMock).to have_requested(:get, url)
|
51
51
|
end
|
@@ -45,7 +45,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
45
45
|
it('returns no error messages') { expect(errors).to be_empty }
|
46
46
|
it 'builds query and sends proper request' do
|
47
47
|
list
|
48
|
-
url = "#{
|
48
|
+
url = "#{versioned_api_path}/portfolios/#{portfolio_id}/consumers?page=2&" \
|
49
49
|
'requested=25&sort=-created_date'
|
50
50
|
expect(WebMock).to have_requested(:get, url)
|
51
51
|
end
|
@@ -93,7 +93,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
93
93
|
it('returns no error messages') { expect(errors).to be_empty }
|
94
94
|
it('builds correct url') do
|
95
95
|
create
|
96
|
-
url = "#{
|
96
|
+
url = "#{versioned_api_path}/portfolios/#{portfolio_id}/consumers"
|
97
97
|
expect(WebMock).to have_requested(:post, url)
|
98
98
|
end
|
99
99
|
end
|
@@ -122,7 +122,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
|
|
122
122
|
it('returns no error messages') { expect(errors).to be_empty }
|
123
123
|
it('builds correct url') do
|
124
124
|
create
|
125
|
-
url = "#{
|
125
|
+
url = "#{versioned_api_path}/portfolios/#{portfolio_id}/consumers/#{params}"
|
126
126
|
expect(WebMock).to have_requested(:post, url)
|
127
127
|
end
|
128
128
|
end
|
@@ -35,7 +35,7 @@ RSpec.describe FinApps::REST::Portfolios do
|
|
35
35
|
it('returns no error messages') { expect(errors).to be_empty }
|
36
36
|
it 'builds query and sends proper request' do
|
37
37
|
list
|
38
|
-
url = "#{
|
38
|
+
url = "#{versioned_api_path}/portfolios?page=2&requested=25&sort=-created_date"
|
39
39
|
expect(WebMock).to have_requested(:get, url)
|
40
40
|
end
|
41
41
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/fake_api.rb
CHANGED
@@ -4,15 +4,19 @@ require 'sinatra/base'
|
|
4
4
|
|
5
5
|
# the FakeApi class is used to mock API requests while testing.
|
6
6
|
class FakeApi < Sinatra::Base
|
7
|
+
def self.version_path
|
8
|
+
"v#{FinAppsCore::REST::Defaults::API_VERSION}"
|
9
|
+
end
|
10
|
+
|
7
11
|
# resource
|
8
|
-
post(
|
9
|
-
get(
|
10
|
-
get(
|
11
|
-
put(
|
12
|
-
delete(
|
12
|
+
post("/#{version_path}/resources") { json_response 201, 'resource.json' }
|
13
|
+
get("/#{version_path}/resources/:id") { json_response 200, 'resource.json' }
|
14
|
+
get("/#{version_path}/resources") { json_response 200, 'resources.json' }
|
15
|
+
put("/#{version_path}/resources") { json_response 201, 'resource.json' }
|
16
|
+
delete("/#{version_path}/resources/:id") { status 202 }
|
13
17
|
|
14
18
|
# plaid
|
15
|
-
post(
|
19
|
+
post("/#{version_path}/p/webhook") do
|
16
20
|
tenant_token = request.env['HTTP_X_TENANT_TOKEN']
|
17
21
|
if tenant_token == 'invalid_tenant_token'
|
18
22
|
json_response 404, 'resource_not_found.json'
|
@@ -22,11 +26,11 @@ class FakeApi < Sinatra::Base
|
|
22
26
|
end
|
23
27
|
|
24
28
|
# version
|
25
|
-
get(
|
29
|
+
get("/#{version_path}/version") { 'Version => 2.1.29-.20161208.172810' }
|
26
30
|
|
27
31
|
# tenants
|
28
|
-
get(
|
29
|
-
put(
|
32
|
+
get("/#{version_path}/settings/tenant") { json_response 200, 'tenant_settings.json' }
|
33
|
+
put("/#{version_path}/settings/tenant") do
|
30
34
|
request.body.rewind
|
31
35
|
request_payload = JSON.parse request.body.read
|
32
36
|
if request_payload['bad_params']
|
@@ -35,8 +39,8 @@ class FakeApi < Sinatra::Base
|
|
35
39
|
status 204
|
36
40
|
end
|
37
41
|
end
|
38
|
-
get(
|
39
|
-
put(
|
42
|
+
get("/#{version_path}/settings/app") { json_response 200, 'tenant_app_settings.json' }
|
43
|
+
put("/#{version_path}/settings/app") do
|
40
44
|
request.body.rewind
|
41
45
|
request_payload = JSON.parse request.body.read
|
42
46
|
if request_payload['pdf_statement_months']
|
@@ -47,22 +51,22 @@ class FakeApi < Sinatra::Base
|
|
47
51
|
end
|
48
52
|
|
49
53
|
# orders
|
50
|
-
post(
|
51
|
-
post(
|
52
|
-
get(
|
53
|
-
get(
|
54
|
-
get(
|
55
|
-
get(
|
56
|
-
get(
|
57
|
-
get(
|
58
|
-
put(
|
59
|
-
put(
|
60
|
-
put(
|
61
|
-
put(
|
62
|
-
put(
|
63
|
-
put(
|
64
|
-
put(
|
65
|
-
put(
|
54
|
+
post("/#{version_path}/orders/valid_token") { json_response 200, 'order_token.json' }
|
55
|
+
post("/#{version_path}/orders/invalid_token") { json_response 404, 'resource_not_found.json' }
|
56
|
+
get("/#{version_path}/orders/valid_id") { json_response 200, 'order.json' }
|
57
|
+
get("/#{version_path}/orders") { json_response 200, 'orders.json' }
|
58
|
+
get("/#{version_path}/orders/valid_id/report.:format") { json_response 200, 'order_report.json' }
|
59
|
+
get("/#{version_path}/orders/invalid_id/report.:format") { json_response 404, 'resource_not_found.json' }
|
60
|
+
get("/#{version_path}/orders/valid_id/status") { json_response 200, 'order_status.json' }
|
61
|
+
get("/#{version_path}/orders/invalid_id/status") { json_response 404, 'resource_not_found.json' }
|
62
|
+
put("/#{version_path}/orders/valid_id/cancel") { status 204 }
|
63
|
+
put("/#{version_path}/orders/invalid_id/cancel") { json_response 404, 'resource_not_found.json' }
|
64
|
+
put("/#{version_path}/orders/valid_id/notify") { status 204 }
|
65
|
+
put("/#{version_path}/orders/invalid_id/notify") { json_response 404, 'resource_not_found.json' }
|
66
|
+
put("/#{version_path}/orders/valid_id/refresh") { json_response 200, 'order_refresh.json' }
|
67
|
+
put("/#{version_path}/orders/invalid_id/refresh") { json_response 404, 'resource_not_found.json' }
|
68
|
+
put("/#{version_path}/orders/invalid_id") { json_response 404, 'resource_not_found.json' }
|
69
|
+
put("/#{version_path}/orders/valid_id") do
|
66
70
|
request.body.rewind
|
67
71
|
request_payload = JSON.parse request.body.read
|
68
72
|
if request_payload['accounts'] == 'valid_account'
|
@@ -71,7 +75,7 @@ class FakeApi < Sinatra::Base
|
|
71
75
|
json_response 400, 'invalid_request_body.json'
|
72
76
|
end
|
73
77
|
end
|
74
|
-
post(
|
78
|
+
post("/#{version_path}/orders") do
|
75
79
|
request.body.rewind
|
76
80
|
request_payload = JSON.parse request.body.read
|
77
81
|
if %w[applicant institutions product].all? {|s| request_payload.key? s }
|
@@ -82,30 +86,34 @@ class FakeApi < Sinatra::Base
|
|
82
86
|
end
|
83
87
|
|
84
88
|
# institutions
|
85
|
-
get(
|
86
|
-
get(
|
87
|
-
post(
|
88
|
-
get(
|
89
|
-
get(
|
90
|
-
get(
|
89
|
+
get("/#{version_path}/institutions/site/valid_site_id/form") { json_response 200, 'institution_login_form.json' }
|
90
|
+
get("/#{version_path}/institutions/site/invalid_site_id/form") { json_response 400, 'invalid_institution_id.json' }
|
91
|
+
post("/#{version_path}/institutions/site/valid_site_id/add") { json_response 200, 'institution_add.json' }
|
92
|
+
get("/#{version_path}/institutions/search/:search_term") { json_response 200, 'institutions_search_list.json' }
|
93
|
+
get("/#{version_path}/institutions/routing/:routing_number") { json_response 200, 'institutions_routing_number.json' }
|
94
|
+
get("/#{version_path}/institutions/site/:site_id") { json_response 200, 'institutions_routing_number.json' }
|
91
95
|
|
92
96
|
# user institutions
|
93
|
-
get(
|
94
|
-
get(
|
95
|
-
|
96
|
-
|
97
|
-
get(
|
98
|
-
|
99
|
-
|
100
|
-
put(
|
101
|
-
put(
|
102
|
-
put(
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
97
|
+
get("/#{version_path}/institutions/consumer/valid_id/status") { json_response 200, 'user_institution_status.json' }
|
98
|
+
get("/#{version_path}/institutions/consumer/invalid_id/status") do
|
99
|
+
json_response 400, 'invalid_user_institution_id.json'
|
100
|
+
end
|
101
|
+
get("/#{version_path}/institutions/consumer") { json_response 200, 'user_institutions_list.json' }
|
102
|
+
get("/#{version_path}/institutions/consumer/valid_id") { json_response 200, 'user_institutions_show.json' }
|
103
|
+
get("/#{version_path}/institutions/consumer/invalid_id") { json_response 400, 'invalid_user_institution_id.json' }
|
104
|
+
put("/#{version_path}/institutions/consumer/refresh") { json_response 200, 'user_institutions_refresh_all.json' }
|
105
|
+
put("/#{version_path}/institutions/consumer/valid_id/credentials") { json_response 200, 'institution_add.json' }
|
106
|
+
put("/#{version_path}/institutions/consumer/invalid_id/credentials") do
|
107
|
+
json_response 400, 'invalid_user_institution_id.json'
|
108
|
+
end
|
109
|
+
put("/#{version_path}/institutions/consumer/valid_id/mfa") { json_response 200, 'institution_add.json' }
|
110
|
+
put("/#{version_path}/institutions/consumer/invalid_id/mfa") { json_response 400, 'invalid_user_institution_id.json' }
|
111
|
+
delete("/#{version_path}/institutions/consumer/valid_id") { status 204 }
|
112
|
+
delete("/#{version_path}/institutions/consumer/invalid_id") { json_response 400, 'invalid_user_institution_id.json' }
|
113
|
+
get("/#{version_path}/institutions/consumer/valid_id/form") { json_response 200, 'institution_login_form.json' }
|
114
|
+
get("/#{version_path}/institutions/consumer/invalid_id/form") { json_response 400, 'invalid_institution_id.json' }
|
115
|
+
put("/#{version_path}/institutions/refresh") { json_response 200, 'user_institution_refresh.json' }
|
116
|
+
put("/#{version_path}/institutions/consumer/valid_consumer_institution_id/refresh") do
|
109
117
|
request.body.rewind
|
110
118
|
request_payload = JSON.parse request.body.read
|
111
119
|
if request_payload['token'] == 'invalid_token'
|
@@ -116,9 +124,9 @@ class FakeApi < Sinatra::Base
|
|
116
124
|
end
|
117
125
|
|
118
126
|
# consumers
|
119
|
-
get(
|
120
|
-
get(
|
121
|
-
post(
|
127
|
+
get("/#{version_path}/consumers/valid_public_id") { json_response 200, 'user.json' }
|
128
|
+
get("/#{version_path}/consumers/invalid_public_id") { json_response 404, 'resource_not_found.json' }
|
129
|
+
post("/#{version_path}/consumers") do
|
122
130
|
request.body.rewind
|
123
131
|
request_payload = JSON.parse request.body.read
|
124
132
|
if request_payload['password']
|
@@ -127,31 +135,31 @@ class FakeApi < Sinatra::Base
|
|
127
135
|
json_response 400, 'invalid_request_body.json'
|
128
136
|
end
|
129
137
|
end
|
130
|
-
put(
|
131
|
-
put(
|
132
|
-
put(
|
133
|
-
put(
|
134
|
-
delete(
|
135
|
-
delete(
|
136
|
-
post(
|
138
|
+
put("/#{version_path}/consumers/valid_public_id") { status 204 }
|
139
|
+
put("/#{version_path}/consumers/invalid_public_id") { json_response 400, 'invalid_user_id.json' }
|
140
|
+
put("/#{version_path}/consumers/valid_public_id/password") { json_response 200, 'user.json' }
|
141
|
+
put("/#{version_path}/consumers/invalid_public_id/password") { json_response 404, 'resource_not_found.json' }
|
142
|
+
delete("/#{version_path}/consumers/valid_public_id") { status 204 }
|
143
|
+
delete("/#{version_path}/consumers/invalid_public_id") { json_response 404, 'resource_not_found.json' }
|
144
|
+
post("/#{version_path}/logout") { status 204 }
|
137
145
|
|
138
146
|
# accounts
|
139
|
-
get(
|
140
|
-
get(
|
147
|
+
get("/#{version_path}/accounts/valid_id/statement/valid_id") { json_response 200, 'fake_pdf_statement.json' }
|
148
|
+
get("/#{version_path}/accounts/invalid_id/statement/valid_id") { json_response 404, 'resource_not_found.json' }
|
141
149
|
|
142
150
|
# operators
|
143
|
-
get(
|
144
|
-
get(
|
145
|
-
get(
|
146
|
-
delete(
|
147
|
-
delete(
|
148
|
-
post(
|
149
|
-
put(
|
150
|
-
put(
|
151
|
-
put(
|
152
|
-
put(
|
153
|
-
post(
|
154
|
-
post(
|
151
|
+
get("/#{version_path}/operators") { json_response 200, 'operator_list.json' }
|
152
|
+
get("/#{version_path}/operators/invalid_id") { json_response 404, 'resource_not_found.json' }
|
153
|
+
get("/#{version_path}/operators/valid_id") { json_response 200, 'operator.json' }
|
154
|
+
delete("/#{version_path}/operators/invalid_id") { json_response 404, 'resource_not_found.json' }
|
155
|
+
delete("/#{version_path}/operators/valid_id") { status 204 }
|
156
|
+
post("/#{version_path}/operators/password/change") { json_response 200, 'operator.json' }
|
157
|
+
put("/#{version_path}/operators/invalid_id") { json_response 404, 'resource_not_found.json' }
|
158
|
+
put("/#{version_path}/operators/valid_id") { json_response 200, 'operator.json' }
|
159
|
+
put("/#{version_path}/operators/valid_id/assign") { status 204 }
|
160
|
+
put("/#{version_path}/operators/invalid_id/assign") { json_response 404, 'resource_not_found.json' }
|
161
|
+
post("/#{version_path}/operators/password/forgot") { json_response 200, 'operator_forgot_password.json' }
|
162
|
+
post("/#{version_path}/operators/password/reset") do
|
155
163
|
request.body.rewind
|
156
164
|
request_payload = JSON.parse request.body.read
|
157
165
|
if request_payload['params'] == 'valid'
|
@@ -160,7 +168,7 @@ class FakeApi < Sinatra::Base
|
|
160
168
|
json_response 400, 'invalid_request_body.json'
|
161
169
|
end
|
162
170
|
end
|
163
|
-
post(
|
171
|
+
post("/#{version_path}/operators") do
|
164
172
|
request.body.rewind
|
165
173
|
request_payload = JSON.parse request.body.read
|
166
174
|
if request_payload['params'] == 'valid'
|
@@ -171,7 +179,7 @@ class FakeApi < Sinatra::Base
|
|
171
179
|
end
|
172
180
|
|
173
181
|
# session
|
174
|
-
post(
|
182
|
+
post("/#{version_path}/login") do
|
175
183
|
request.body.rewind
|
176
184
|
request_payload = JSON.parse request.body.read
|
177
185
|
if request_payload['password'] == 'valid_password'
|
@@ -180,12 +188,12 @@ class FakeApi < Sinatra::Base
|
|
180
188
|
json_response(401, 'unauthorized.json')
|
181
189
|
end
|
182
190
|
end
|
183
|
-
post(
|
191
|
+
post("/#{version_path}/operators/login") { json_response 200, 'operator.json' }
|
184
192
|
|
185
193
|
# password resets
|
186
|
-
post(
|
187
|
-
post(
|
188
|
-
put(
|
194
|
+
post("/#{version_path}/tenant/valid_user_id/password") { json_response 200, 'password_reset_token.json' }
|
195
|
+
post("/#{version_path}/tenant/invalid_user_id/password") { json_response 404, 'resource_not_found.json' }
|
196
|
+
put("/#{version_path}/tenant/valid_user_id/password") do
|
189
197
|
request.body.rewind
|
190
198
|
request_payload = JSON.parse request.body.read
|
191
199
|
if request_payload['token'] == 'valid_token'
|
@@ -194,16 +202,16 @@ class FakeApi < Sinatra::Base
|
|
194
202
|
json_response(400, 'invalid_request_body.json')
|
195
203
|
end
|
196
204
|
end
|
197
|
-
put(
|
205
|
+
put("/#{version_path}/tenant/invalid_user_id/password") { json_response 404, 'resource_not_found.json' }
|
198
206
|
|
199
207
|
# products
|
200
|
-
get(
|
208
|
+
get("/#{version_path}/products") { json_response 200, 'products.json' }
|
201
209
|
|
202
210
|
# portfolios
|
203
|
-
get(
|
204
|
-
get(
|
205
|
-
get(
|
206
|
-
post(
|
211
|
+
get("/#{version_path}/portfolios") { json_response 200, 'portfolios.json' }
|
212
|
+
get("/#{version_path}/portfolios/valid_id") { json_response 200, 'portfolio.json' }
|
213
|
+
get("/#{version_path}/portfolios/invalid_id") { json_response 404, 'resource_not_found.json' }
|
214
|
+
post("/#{version_path}/portfolios") do
|
207
215
|
request.body.rewind
|
208
216
|
request_payload = JSON.parse request.body.read
|
209
217
|
if request_payload['product'] == 'invalid'
|
@@ -212,57 +220,63 @@ class FakeApi < Sinatra::Base
|
|
212
220
|
json_response(200, 'portfolio.json')
|
213
221
|
end
|
214
222
|
end
|
215
|
-
put(
|
216
|
-
put(
|
217
|
-
delete(
|
218
|
-
delete(
|
223
|
+
put("/#{version_path}/portfolios/valid_id") { json_response 200, 'portfolio.json' }
|
224
|
+
put("/#{version_path}/portfolios/invalid_id") { json_response 404, 'resource_not_found.json' }
|
225
|
+
delete("/#{version_path}/portfolios/valid_id") { status 204 }
|
226
|
+
delete("/#{version_path}/portfolios/invalid_id") { json_response 404, 'resource_not_found.json' }
|
219
227
|
|
220
228
|
# alert definitions
|
221
|
-
get(
|
222
|
-
get(
|
223
|
-
get(
|
229
|
+
get("/#{version_path}/portfolio/alerts/definitions") { json_response 200, 'alert_definitions.json' }
|
230
|
+
get("/#{version_path}/portfolio/alerts/definitions/valid_id") { json_response 200, 'alert_definition.json' }
|
231
|
+
get("/#{version_path}/portfolio/alerts/definitions/invalid_id") { json_response 404, 'resource_not_found.json' }
|
224
232
|
|
225
233
|
# alert occurrences
|
226
|
-
get(
|
234
|
+
get("/#{version_path}/portfolio/alerts/occurrences") { json_response 200, 'alert_occurrences.json' }
|
227
235
|
|
228
236
|
# portfolios alerts
|
229
|
-
get(
|
230
|
-
get(
|
231
|
-
put(
|
232
|
-
put(
|
233
|
-
delete(
|
234
|
-
delete(
|
237
|
+
get("/#{version_path}/portfolios/valid_id/alerts") { json_response 200, 'portfolios_alerts.json' }
|
238
|
+
get("/#{version_path}/portfolios/invalid_id/alerts") { json_response 404, 'resource_not_found.json' }
|
239
|
+
put("/#{version_path}/portfolios/valid_id/alerts/valid_id") { status 204 }
|
240
|
+
put("/#{version_path}/portfolios/invalid_id/alerts/invalid_id") { json_response 404, 'resource_not_found.json' }
|
241
|
+
delete("/#{version_path}/portfolios/valid_id/alerts/valid_id") { status 204 }
|
242
|
+
delete("/#{version_path}/portfolios/invalid_id/alerts/invalid_id") { json_response 404, 'resource_not_found.json' }
|
235
243
|
|
236
244
|
# portfolios consumers
|
237
|
-
get(
|
238
|
-
get(
|
239
|
-
post(
|
240
|
-
post(
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
+
get("/#{version_path}/portfolios/valid_id/consumers") { json_response 200, 'portfolios_consumers.json' }
|
246
|
+
get("/#{version_path}/portfolios/invalid_id/consumers") { json_response 404, 'resource_not_found.json' }
|
247
|
+
post("/#{version_path}/portfolios/valid_id/consumers") { status 204 }
|
248
|
+
post("/#{version_path}/portfolios/invalid_id/consumers") do
|
249
|
+
json_response 400, 'multiple_consumer_subscribe_error.json'
|
250
|
+
end
|
251
|
+
post("/#{version_path}/portfolios/valid_id/consumers/valid_id") { status 204 }
|
252
|
+
post("/#{version_path}/portfolios/invalid_id/consumers/invalid_id") do
|
253
|
+
json_response 400, 'single_consumer_subscribe_error.json'
|
254
|
+
end
|
255
|
+
delete("/#{version_path}/portfolios/valid_id/consumers/valid_id") { status 204 }
|
256
|
+
delete("/#{version_path}/portfolios/invalid_id/consumers/invalid_id") { json_response 404, 'resource_not_found.json' }
|
245
257
|
|
246
258
|
# portfolios available consumers
|
247
|
-
get(
|
259
|
+
get("/#{version_path}/portfolios/:id/consumers/available") do
|
260
|
+
json_response 200, 'portfolios_available_consumers.json'
|
261
|
+
end
|
248
262
|
|
249
263
|
# consumers portfolios
|
250
|
-
get(
|
251
|
-
get(
|
264
|
+
get("/#{version_path}/consumers/valid_id/portfolios") { json_response 200, 'portfolios.json' }
|
265
|
+
get("/#{version_path}/consumers/invalid_id/portfolios") { json_response 404, 'resource_not_found.json' }
|
252
266
|
|
253
267
|
# portfolio reports
|
254
|
-
get(
|
268
|
+
get("/#{version_path}/portfolio/reports") { json_response 200, 'portfolio_reports.json' }
|
255
269
|
|
256
270
|
# relevance
|
257
|
-
get(
|
271
|
+
get("/#{version_path}/relevance/ruleset/names") { json_response 200, 'relevance_ruleset_names.json' }
|
258
272
|
|
259
273
|
# errors
|
260
|
-
get(
|
261
|
-
get(
|
262
|
-
get(
|
274
|
+
get("/#{version_path}/client_error") { json_response 400, 'error.json' }
|
275
|
+
get("/#{version_path}/server_error") { status 500 }
|
276
|
+
get("/#{version_path}/proxy_error") { status 407 }
|
263
277
|
|
264
278
|
# timeout
|
265
|
-
get(
|
279
|
+
get("/#{version_path}/orders/timeout") { status 419 }
|
266
280
|
|
267
281
|
private
|
268
282
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 5.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '5.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 5.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|