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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d21ac7f066d91c0cd706dd59814a2d86641d88cfead188872954b9f338042adf
4
- data.tar.gz: 130223187e893f18eefc45d4975852e427ea23d290f88f3606a1114bbcf85b16
3
+ metadata.gz: 7cc8f3182020dea8fb734048141cf00d287e70d107e71006671b88ed2f81d9fa
4
+ data.tar.gz: 8d21a3acc5bb62ce331672b0bceff88d46096d49d3200d9e9e0129fece5a192e
5
5
  SHA512:
6
- metadata.gz: 0edc414fe207a06dbf6497c40b906968ae21f54e1e5889d21c37c7c498b4e09f703b4a3e97f6a4d758535b2a3559ed6895cdc390d4bcc9df88a916ca401e82d5
7
- data.tar.gz: 978fc6fdcfae357fa3107cff35d5cc2d81110978cafee7e835f67cd6ac8cdce785cd94bc7472a7a99872983eaf2c9a61b83323b90dea4f344bf5906c2b83caeb
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', '~> 4.0', '>= 4.0.7'
23
+ spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.0'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
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'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '5.0.2'
4
+ VERSION = '5.0.3'
5
5
  end
@@ -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 and releases the gem. BOOM!'
4
+ origin repository'
5
5
  task :bump do
6
6
  system 'gem bump --tag --push --skip-ci'
7
7
  end
8
8
 
9
- desc 'Bumps the version to the next patch level, tags and pushes the code to
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolio/alerts/definitions?page=2&requested=25&" \
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolio/alerts/occurrences?" \
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/consumers/#{id}/portfolios?page=2&" \
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
@@ -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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/operators?filter=%7B%22last_name%22:%22term%22," \
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
@@ -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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/orders?filter=%7B%22$or%22:%5B%7B%22public_id%22:" \
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/orders?filter=%7B%22status%22:%7B%22$in%22:%5B1," \
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/orders?filter=%7B%22assignment.operator_id%22:null%7D"
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolio/reports?page=2&requested=25&" \
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolios/#{id}/consumers/available?page=2&" \
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolios/#{portfolio_id}/consumers?page=2&" \
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolios/#{portfolio_id}/consumers"
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolios/#{portfolio_id}/consumers/#{params}"
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 = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/portfolios?page=2&requested=25&sort=-created_date"
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
@@ -41,3 +41,7 @@ VALID_CREDENTIALS = { identifier: '49fb918d-7e71-44dd-7378-58f19606df2a',
41
41
 
42
42
  RESULTS = 0
43
43
  ERROR_MESSAGES = 1
44
+
45
+ def versioned_api_path
46
+ "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v#{FinAppsCore::REST::Defaults::API_VERSION}"
47
+ end
@@ -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('/v3/resources') { json_response 201, 'resource.json' }
9
- get('/v3/resources/:id') { json_response 200, 'resource.json' }
10
- get('/v3/resources') { json_response 200, 'resources.json' }
11
- put('/v3/resources') { json_response 201, 'resource.json' }
12
- delete('/v3/resources/:id') { status 202 }
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('/v3/p/webhook') do
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('/v3/version') { 'Version => 2.1.29-.20161208.172810' }
29
+ get("/#{version_path}/version") { 'Version => 2.1.29-.20161208.172810' }
26
30
 
27
31
  # tenants
28
- get('/v3/settings/tenant') { json_response 200, 'tenant_settings.json' }
29
- put('/v3/settings/tenant') do
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('/v3/settings/app') { json_response 200, 'tenant_app_settings.json' }
39
- put('/v3/settings/app') do
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('/v3/orders/valid_token') { json_response 200, 'order_token.json' }
51
- post('/v3/orders/invalid_token') { json_response 404, 'resource_not_found.json' }
52
- get('/v3/orders/valid_id') { json_response 200, 'order.json' }
53
- get('/v3/orders') { json_response 200, 'orders.json' }
54
- get('/v3/orders/valid_id/report.:format') { json_response 200, 'order_report.json' }
55
- get('/v3/orders/invalid_id/report.:format') { json_response 404, 'resource_not_found.json' }
56
- get('/v3/orders/valid_id/status') { json_response 200, 'order_status.json' }
57
- get('/v3/orders/invalid_id/status') { json_response 404, 'resource_not_found.json' }
58
- put('/v3/orders/valid_id/cancel') { status 204 }
59
- put('/v3/orders/invalid_id/cancel') { json_response 404, 'resource_not_found.json' }
60
- put('/v3/orders/valid_id/notify') { status 204 }
61
- put('/v3/orders/invalid_id/notify') { json_response 404, 'resource_not_found.json' }
62
- put('/v3/orders/valid_id/refresh') { json_response 200, 'order_refresh.json' }
63
- put('/v3/orders/invalid_id/refresh') { json_response 404, 'resource_not_found.json' }
64
- put('/v3/orders/invalid_id') { json_response 404, 'resource_not_found.json' }
65
- put('/v3/orders/valid_id') do
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('/v3/orders') do
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('/v3/institutions/site/valid_site_id/form') { json_response 200, 'institution_login_form.json' }
86
- get('/v3/institutions/site/invalid_site_id/form') { json_response 400, 'invalid_institution_id.json' }
87
- post('/v3/institutions/site/valid_site_id/add') { json_response 200, 'institution_add.json' }
88
- get('/v3/institutions/search/:search_term') { json_response 200, 'institutions_search_list.json' }
89
- get('/v3/institutions/routing/:routing_number') { json_response 200, 'institutions_routing_number.json' }
90
- get('/v3/institutions/site/:site_id') { json_response 200, 'institutions_routing_number.json' }
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('/v3/institutions/consumer/valid_id/status') { json_response 200, 'user_institution_status.json' }
94
- get('/v3/institutions/consumer/invalid_id/status') { json_response 400, 'invalid_user_institution_id.json' }
95
- get('/v3/institutions/consumer') { json_response 200, 'user_institutions_list.json' }
96
- get('/v3/institutions/consumer/valid_id') { json_response 200, 'user_institutions_show.json' }
97
- get('/v3/institutions/consumer/invalid_id') { json_response 400, 'invalid_user_institution_id.json' }
98
- put('/v3/institutions/consumer/refresh') { json_response 200, 'user_institutions_refresh_all.json' }
99
- put('/v3/institutions/consumer/valid_id/credentials') { json_response 200, 'institution_add.json' }
100
- put('/v3/institutions/consumer/invalid_id/credentials') { json_response 400, 'invalid_user_institution_id.json' }
101
- put('/v3/institutions/consumer/valid_id/mfa') { json_response 200, 'institution_add.json' }
102
- put('/v3/institutions/consumer/invalid_id/mfa') { json_response 400, 'invalid_user_institution_id.json' }
103
- delete('/v3/institutions/consumer/valid_id') { status 204 }
104
- delete('/v3/institutions/consumer/invalid_id') { json_response 400, 'invalid_user_institution_id.json' }
105
- get('/v3/institutions/consumer/valid_id/form') { json_response 200, 'institution_login_form.json' }
106
- get('/v3/institutions/consumer/invalid_id/form') { json_response 400, 'invalid_institution_id.json' }
107
- put('/v3/institutions/refresh') { json_response 200, 'user_institution_refresh.json' }
108
- put('/v3/institutions/consumer/valid_consumer_institution_id/refresh') do
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('/v3/consumers/valid_public_id') { json_response 200, 'user.json' }
120
- get('/v3/consumers/invalid_public_id') { json_response 404, 'resource_not_found.json' }
121
- post('/v3/consumers') do
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('/v3/consumers/valid_public_id') { status 204 }
131
- put('/v3/consumers/invalid_public_id') { json_response 400, 'invalid_user_id.json' }
132
- put('/v3/consumers/valid_public_id/password') { json_response 200, 'user.json' }
133
- put('/v3/consumers/invalid_public_id/password') { json_response 404, 'resource_not_found.json' }
134
- delete('/v3/consumers/valid_public_id') { status 204 }
135
- delete('/v3/consumers/invalid_public_id') { json_response 404, 'resource_not_found.json' }
136
- post('/v3/logout') { status 204 }
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('/v3/accounts/valid_id/statement/valid_id') { json_response 200, 'fake_pdf_statement.json' }
140
- get('/v3/accounts/invalid_id/statement/valid_id') { json_response 404, 'resource_not_found.json' }
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('/v3/operators') { json_response 200, 'operator_list.json' }
144
- get('/v3/operators/invalid_id') { json_response 404, 'resource_not_found.json' }
145
- get('/v3/operators/valid_id') { json_response 200, 'operator.json' }
146
- delete('/v3/operators/invalid_id') { json_response 404, 'resource_not_found.json' }
147
- delete('/v3/operators/valid_id') { status 204 }
148
- post('/v3/operators/password/change') { json_response 200, 'operator.json' }
149
- put('/v3/operators/invalid_id') { json_response 404, 'resource_not_found.json' }
150
- put('/v3/operators/valid_id') { json_response 200, 'operator.json' }
151
- put('/v3/operators/valid_id/assign') { status 204 }
152
- put('/v3/operators/invalid_id/assign') { json_response 404, 'resource_not_found.json' }
153
- post('/v3/operators/password/forgot') { json_response 200, 'operator_forgot_password.json' }
154
- post('/v3/operators/password/reset') do
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('/v3/operators') do
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('/v3/login') do
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('/v3/operators/login') { json_response 200, 'operator.json' }
191
+ post("/#{version_path}/operators/login") { json_response 200, 'operator.json' }
184
192
 
185
193
  # password resets
186
- post('/v3/tenant/valid_user_id/password') { json_response 200, 'password_reset_token.json' }
187
- post('/v3/tenant/invalid_user_id/password') { json_response 404, 'resource_not_found.json' }
188
- put('/v3/tenant/valid_user_id/password') do
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('/v3/tenant/invalid_user_id/password') { json_response 404, 'resource_not_found.json' }
205
+ put("/#{version_path}/tenant/invalid_user_id/password") { json_response 404, 'resource_not_found.json' }
198
206
 
199
207
  # products
200
- get('/v3/products') { json_response 200, 'products.json' }
208
+ get("/#{version_path}/products") { json_response 200, 'products.json' }
201
209
 
202
210
  # portfolios
203
- get('/v3/portfolios') { json_response 200, 'portfolios.json' }
204
- get('/v3/portfolios/valid_id') { json_response 200, 'portfolio.json' }
205
- get('/v3/portfolios/invalid_id') { json_response 404, 'resource_not_found.json' }
206
- post('/v3/portfolios') do
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('/v3/portfolios/valid_id') { json_response 200, 'portfolio.json' }
216
- put('/v3/portfolios/invalid_id') { json_response 404, 'resource_not_found.json' }
217
- delete('/v3/portfolios/valid_id') { status 204 }
218
- delete('/v3/portfolios/invalid_id') { json_response 404, 'resource_not_found.json' }
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('/v3/portfolio/alerts/definitions') { json_response 200, 'alert_definitions.json' }
222
- get('/v3/portfolio/alerts/definitions/valid_id') { json_response 200, 'alert_definition.json' }
223
- get('/v3/portfolio/alerts/definitions/invalid_id') { json_response 404, 'resource_not_found.json' }
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('/v3/portfolio/alerts/occurrences') { json_response 200, 'alert_occurrences.json' }
234
+ get("/#{version_path}/portfolio/alerts/occurrences") { json_response 200, 'alert_occurrences.json' }
227
235
 
228
236
  # portfolios alerts
229
- get('/v3/portfolios/valid_id/alerts') { json_response 200, 'portfolios_alerts.json' }
230
- get('/v3/portfolios/invalid_id/alerts') { json_response 404, 'resource_not_found.json' }
231
- put('/v3/portfolios/valid_id/alerts/valid_id') { status 204 }
232
- put('/v3/portfolios/invalid_id/alerts/invalid_id') { json_response 404, 'resource_not_found.json' }
233
- delete('/v3/portfolios/valid_id/alerts/valid_id') { status 204 }
234
- delete('/v3/portfolios/invalid_id/alerts/invalid_id') { json_response 404, 'resource_not_found.json' }
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('/v3/portfolios/valid_id/consumers') { json_response 200, 'portfolios_consumers.json' }
238
- get('/v3/portfolios/invalid_id/consumers') { json_response 404, 'resource_not_found.json' }
239
- post('/v3/portfolios/valid_id/consumers') { status 204 }
240
- post('/v3/portfolios/invalid_id/consumers') { json_response 400, 'multiple_consumer_subscribe_error.json' }
241
- post('/v3/portfolios/valid_id/consumers/valid_id') { status 204 }
242
- post('/v3/portfolios/invalid_id/consumers/invalid_id') { json_response 400, 'single_consumer_subscribe_error.json' }
243
- delete('/v3/portfolios/valid_id/consumers/valid_id') { status 204 }
244
- delete('/v3/portfolios/invalid_id/consumers/invalid_id') { json_response 404, 'resource_not_found.json' }
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('/v3/portfolios/:id/consumers/available') { json_response 200, 'portfolios_available_consumers.json' }
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('/v3/consumers/valid_id/portfolios') { json_response 200, 'portfolios.json' }
251
- get('/v3/consumers/invalid_id/portfolios') { json_response 404, 'resource_not_found.json' }
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('/v3/portfolio/reports') { json_response 200, 'portfolio_reports.json' }
268
+ get("/#{version_path}/portfolio/reports") { json_response 200, 'portfolio_reports.json' }
255
269
 
256
270
  # relevance
257
- get('/v3/relevance/ruleset/names') { json_response 200, 'relevance_ruleset_names.json' }
271
+ get("/#{version_path}/relevance/ruleset/names") { json_response 200, 'relevance_ruleset_names.json' }
258
272
 
259
273
  # errors
260
- get('/v3/client_error') { json_response 400, 'error.json' }
261
- get('/v3/server_error') { status 500 }
262
- get('/v3/proxy_error') { status 407 }
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('/v3/orders/timeout') { status 419 }
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.2
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-16 00:00:00.000000000 Z
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: '4.0'
19
+ version: '5.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 4.0.7
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: '4.0'
29
+ version: '5.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 4.0.7
32
+ version: 5.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement