configuration_service 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.yardopts +3 -0
- data/README.rdoc +26 -27
- data/lib/configuration_service/base.rb +34 -30
- data/lib/configuration_service/configuration.rb +13 -9
- data/lib/configuration_service/errors.rb +1 -4
- data/lib/configuration_service/factory/environment_context/env_dict.rb +1 -1
- data/lib/configuration_service/factory/environment_context.rb +31 -32
- data/lib/configuration_service/factory.rb +1 -5
- data/lib/configuration_service/provider/broken.rb +3 -3
- data/lib/configuration_service/provider/stub.rb +16 -19
- data/lib/configuration_service/provider/stub_store.rb +33 -13
- data/lib/configuration_service/provider.rb +3 -4
- data/lib/configuration_service/provider_registry.rb +21 -17
- data/lib/configuration_service/test/orchestration_provider.rb +114 -104
- data/lib/configuration_service/test/orchestration_provider_registry.rb +21 -15
- data/lib/configuration_service/test/orchestrator.rb +63 -44
- data/lib/configuration_service/test/orchestrator_environment_factory.rb +22 -9
- data/lib/configuration_service/test/response.rb +55 -27
- data/lib/configuration_service/test/stub_orchestration_provider.rb +45 -37
- data/lib/configuration_service/test.rb +7 -6
- data/lib/configuration_service/version.rb +1 -1
- data/lib/configuration_service.rb +3 -3
- metadata +3 -2
- data/README.md +0 -34
@@ -14,24 +14,24 @@ module ConfigurationService
|
|
14
14
|
# It keeps no domain state, because that would couple it to the
|
15
15
|
# service implementation. By making no assumptions at all about the API
|
16
16
|
# or data, it allows implementors to produce service implementations
|
17
|
-
# that do not adhere to the anticipated ConfigurationService::Base API,
|
18
|
-
# by writing their own
|
17
|
+
# that do not adhere to the anticipated {ConfigurationService::Base} API,
|
18
|
+
# by writing their own test orchestration provider from scratch
|
19
|
+
# instead of extending {ConfigurationService::Test::OrchestrationProvider}.
|
19
20
|
#
|
20
|
-
# However, implementors who are trying to produce ConfigurationService::Base
|
21
|
-
# providers should extend OrchestrationProvider,
|
22
|
-
# compatible provider API.
|
21
|
+
# However, implementors who are trying to produce {ConfigurationService::Base}
|
22
|
+
# providers should extend {ConfigurationService::Test::OrchestrationProvider},
|
23
|
+
# which anticipates a compatible provider API.
|
23
24
|
#
|
24
|
-
# Note that the
|
25
|
-
# a test artifact (Response or similar)
|
26
|
-
# to wrap responses from the service
|
25
|
+
# Note that the +@response+ instance variable is not domain state; it is
|
26
|
+
# a test artifact ({ConfigurationService::Test::Response} or similar)
|
27
|
+
# that orchestration providers use to wrap responses from the configuration service.
|
27
28
|
#
|
28
29
|
class Orchestrator
|
29
30
|
|
30
31
|
##
|
31
|
-
# Return a new orchestrator initialized with a new instance of +provider_class+.
|
32
32
|
#
|
33
|
-
#
|
34
|
-
#
|
33
|
+
# @param [Class] provider_class
|
34
|
+
# the test orchestration provider class, which should have a default/nullary constructor
|
35
35
|
#
|
36
36
|
def initialize(provider_class)
|
37
37
|
@provider = provider_class.new
|
@@ -68,9 +68,9 @@ module ConfigurationService
|
|
68
68
|
##
|
69
69
|
# Return a published configuration fixture
|
70
70
|
#
|
71
|
-
# E.g. as arranged by #given_existing_configuration.
|
71
|
+
# E.g. as arranged by {#given_existing_configuration}.
|
72
72
|
#
|
73
|
-
#
|
73
|
+
# @todo replace with predicate: this exposes domain state
|
74
74
|
#
|
75
75
|
def existing_configuration
|
76
76
|
@provider.existing_configuration
|
@@ -79,24 +79,25 @@ module ConfigurationService
|
|
79
79
|
##
|
80
80
|
# Return the revision of a published configuration fixture
|
81
81
|
#
|
82
|
-
# E.g. as arranged by #given_existing_configuration.
|
82
|
+
# E.g. as arranged by {#given_existing_configuration}.
|
83
83
|
#
|
84
|
-
#
|
84
|
+
# @todo replace with predicate: this exposes domain state
|
85
85
|
#
|
86
86
|
def existing_revision
|
87
87
|
@provider.existing_revision
|
88
88
|
end
|
89
89
|
|
90
90
|
##
|
91
|
-
# Authorize the next
|
91
|
+
# Authorize the next publish or request activity
|
92
92
|
#
|
93
|
-
#
|
93
|
+
# @param [Symbol] activity
|
94
|
+
# Valid activities (as per {ConfigurationService::Test::OrchestrationProvider::ACTIVITY_ROLE_MAP}) are:
|
94
95
|
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
96
|
+
# * +:requesting_configurations+
|
97
|
+
# * +:publishing_configurations+
|
98
|
+
# * +:nothing+
|
98
99
|
#
|
99
|
-
# Where possible, the orchestration provider should authorize +:nothing+
|
100
|
+
# Where possible, the test orchestration provider should authorize +:nothing+
|
100
101
|
# by providing valid credentials that don't allow operations on the
|
101
102
|
# configuration +identifier+ that it tests against.
|
102
103
|
#
|
@@ -108,60 +109,69 @@ module ConfigurationService
|
|
108
109
|
##
|
109
110
|
# Remove any previous authorization
|
110
111
|
#
|
111
|
-
# E.g. as arranged by #authorize.
|
112
|
+
# E.g. as arranged by {#authorize}.
|
112
113
|
#
|
113
114
|
def deauthorize
|
114
115
|
@provider.deauthorize
|
115
116
|
end
|
116
117
|
|
117
118
|
##
|
118
|
-
#
|
119
|
+
# Request configuration from the service under test
|
119
120
|
#
|
120
|
-
# The provider is expected to wrap the response in a Response
|
121
|
-
# simimlar) and return that.
|
121
|
+
# The test orchestration provider is expected to wrap the response in a {ConfigurationService::Test::Response}
|
122
|
+
# (or simimlar) and return that.
|
122
123
|
#
|
123
124
|
def request_configuration
|
124
125
|
@response = @provider.request_configuration
|
125
126
|
end
|
126
127
|
|
127
128
|
##
|
128
|
-
#
|
129
|
+
# Publish configuration through the service under test
|
129
130
|
#
|
130
|
-
# The provider is expected to wrap the response in a Response
|
131
|
-
# simimlar) and return that.
|
131
|
+
# The test orchestration provider is expected to wrap the response in a {ConfigurationService::Test::Response}
|
132
|
+
# (or simimlar) and return that.
|
132
133
|
#
|
133
134
|
def publish_configuration
|
134
135
|
@response = @provider.publish_configuration
|
135
136
|
end
|
136
137
|
|
137
138
|
##
|
138
|
-
#
|
139
|
+
# Whether the last publish or request was allowed
|
140
|
+
#
|
141
|
+
# @see ConfigurationService::Test::Response::Success#allowed?
|
142
|
+
# @see ConfigurationService::Test::Response::Failure#allowed?
|
139
143
|
#
|
140
144
|
def request_allowed?
|
141
145
|
@response.allowed?
|
142
146
|
end
|
143
147
|
|
144
148
|
##
|
145
|
-
#
|
149
|
+
# Whether the last publish or request was allowed but failed
|
146
150
|
#
|
147
|
-
#
|
148
|
-
#
|
151
|
+
# @see ConfigurationService::Test::Response::Success#failed?
|
152
|
+
# @see ConfigurationService::Test::Response::Failure#failed?
|
149
153
|
#
|
150
154
|
def request_failed?
|
151
155
|
@response.failed?
|
152
156
|
end
|
153
157
|
|
154
158
|
##
|
155
|
-
# True if the last
|
159
|
+
# True if the last request not return configuration data
|
160
|
+
#
|
161
|
+
# @see ConfigurationService::Test::Response::Success#found?
|
162
|
+
# @see ConfigurationService::Test::Response::Failure#found?
|
156
163
|
#
|
157
164
|
def request_not_found?
|
158
165
|
not @response.found?
|
159
166
|
end
|
160
167
|
|
161
168
|
##
|
162
|
-
# True if the last consuming operation did not return data
|
169
|
+
# True if the last request did consuming operation did not return data
|
163
170
|
#
|
164
|
-
#
|
171
|
+
# @see ConfigurationService::Test::Response::Success#found?
|
172
|
+
# @see ConfigurationService::Test::Response::Failure#found?
|
173
|
+
#
|
174
|
+
# @todo distinguish {#request_not_matched?} to mean "found data, but filtered out by metadata filter"
|
165
175
|
#
|
166
176
|
def request_not_matched?
|
167
177
|
not @response.found?
|
@@ -170,7 +180,9 @@ module ConfigurationService
|
|
170
180
|
##
|
171
181
|
# The last published or consumed configuration data
|
172
182
|
#
|
173
|
-
#
|
183
|
+
# @return [Hash] configuration data (not a {ConfigurationService::Configuration} object)
|
184
|
+
#
|
185
|
+
# @todo replace with predicate: this exposes domain state
|
174
186
|
#
|
175
187
|
def published_configuration
|
176
188
|
@response.data
|
@@ -178,7 +190,11 @@ module ConfigurationService
|
|
178
190
|
alias :requested_configuration :published_configuration
|
179
191
|
|
180
192
|
##
|
181
|
-
# The revision of the last published or consumed configuration
|
193
|
+
# The revision of the last published or consumed configuration metadata
|
194
|
+
#
|
195
|
+
# @return [String] metadata revision
|
196
|
+
#
|
197
|
+
# @todo replace with predicate: this exposes domain state
|
182
198
|
#
|
183
199
|
def published_revision
|
184
200
|
@response.revision
|
@@ -187,6 +203,10 @@ module ConfigurationService
|
|
187
203
|
##
|
188
204
|
# The last published metadata
|
189
205
|
#
|
206
|
+
# @return [Hash] configuration metadata
|
207
|
+
#
|
208
|
+
# @todo replace with predicate: this exposes domain state
|
209
|
+
#
|
190
210
|
def published_metadata
|
191
211
|
@response.metadata
|
192
212
|
end
|
@@ -211,7 +231,7 @@ module ConfigurationService
|
|
211
231
|
# Environmental service configuration is configuration for bootstrapping
|
212
232
|
# a configuration service and provider.
|
213
233
|
#
|
214
|
-
#
|
234
|
+
# @todo replace with declarative test that delegates to orchestration provider
|
215
235
|
#
|
216
236
|
def given_environmental_service_configuration
|
217
237
|
sp_env = @provider.service_provider_configuration.inject({}) do |m, (k, v)|
|
@@ -228,11 +248,10 @@ module ConfigurationService
|
|
228
248
|
##
|
229
249
|
# Bootstrap a configuration service environmentally
|
230
250
|
#
|
231
|
-
# Environmental service configuration (as arranged by
|
232
|
-
#
|
233
|
-
# EnvironmentContext factory to create a service configuration instance.
|
251
|
+
# Environmental service configuration (as arranged by {#given_environmental_service_configuration})
|
252
|
+
# is given to an {ConfigurationService::Factory::EnvironmentContext} factory to create a service configuration instance.
|
234
253
|
#
|
235
|
-
#
|
254
|
+
# @todo replace with declarative test that delegates to orchestration provider
|
236
255
|
#
|
237
256
|
def bootstrap_configuration_service_environmentally
|
238
257
|
factory = ConfigurationService::Factory::EnvironmentContext.new(@env, "CFGSRV")
|
@@ -242,7 +261,7 @@ module ConfigurationService
|
|
242
261
|
##
|
243
262
|
# Tests that a bootstrapped configuration service is functional
|
244
263
|
#
|
245
|
-
#
|
264
|
+
# @todo replace with declarative test that delegates to orchestration provider
|
246
265
|
#
|
247
266
|
def bootstrapped_configuration_service_functional?
|
248
267
|
response = begin
|
@@ -256,7 +275,7 @@ module ConfigurationService
|
|
256
275
|
##
|
257
276
|
# Tests that environmental service configuration is scrubbed
|
258
277
|
#
|
259
|
-
#
|
278
|
+
# @todo replace with declarative test that delegates to orchestration provider
|
260
279
|
#
|
261
280
|
def environmental_service_configuration_scrubbed?
|
262
281
|
!@env.include?("CFGSRV_TOKEN")
|
@@ -3,25 +3,38 @@ module ConfigurationService
|
|
3
3
|
module Test
|
4
4
|
|
5
5
|
##
|
6
|
-
#
|
6
|
+
# A factory for building a test orchestrator using an orchestration provider selected from the environment
|
7
|
+
#
|
8
|
+
# @example cucumber features/support/env.rb
|
9
|
+
# require 'configuration_service/test'
|
10
|
+
#
|
11
|
+
# Before do
|
12
|
+
# begin
|
13
|
+
# @test = ConfigurationService::Test::OrchestratorEnvironmentFactory.build
|
14
|
+
# rescue
|
15
|
+
# Cucumber.wants_to_quit = true
|
16
|
+
# raise
|
17
|
+
# end
|
18
|
+
# end
|
7
19
|
#
|
8
20
|
module OrchestratorEnvironmentFactory
|
9
21
|
|
10
22
|
##
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
23
|
+
# Build a test orchestrator
|
24
|
+
#
|
25
|
+
# Looks up the test orchestration provider class registered to the {ConfigurationService::Test::OrchestrationProviderRegistry}
|
26
|
+
# with the name provided in the +TEST_ORCHESTRATION_PROVIDER+ environment variable,
|
27
|
+
# and returns a new {ConfigurationService::Test::Orchestrator} initialized with an instance of that provider class.
|
15
28
|
#
|
16
|
-
#
|
17
|
-
# +TEST_ORCHESTRATION_PROVIDER+ environment variable
|
18
|
-
# provider known to the OrchestrationProviderRegistry
|
29
|
+
# @return [ConfigurationService::Test::Orchestrator] the test orchestrator
|
30
|
+
# @raise [RuntimeError] if the +TEST_ORCHESTRATION_PROVIDER+ environment variable
|
31
|
+
# does not name a provider known to the {ConfigurationService::Test::OrchestrationProviderRegistry}
|
19
32
|
#
|
20
33
|
def self.build
|
21
34
|
identifier = ENV["TEST_ORCHESTRATION_PROVIDER"] or raise "missing environment variable: TEST_ORCHESTRATION_PROVIDER"
|
22
35
|
registry = ConfigurationService::Test::OrchestrationProviderRegistry.instance
|
23
36
|
provider = registry.lookup(identifier) or raise "unknown test orchestration provider: #{identifier}"
|
24
|
-
|
37
|
+
ConfigurationService::Test::Orchestrator.new(provider)
|
25
38
|
end
|
26
39
|
|
27
40
|
end
|
@@ -5,68 +5,81 @@ module ConfigurationService
|
|
5
5
|
module Test
|
6
6
|
|
7
7
|
##
|
8
|
-
# Encapsulation of
|
8
|
+
# Encapsulation of configuration service responses
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# Used by test orchestration providers to decouple the test orchestrator from the semantics of API responses.
|
11
11
|
#
|
12
12
|
module Response
|
13
13
|
|
14
14
|
##
|
15
|
-
# Encapsulates a non-error
|
15
|
+
# Encapsulates a non-error configuration service response
|
16
16
|
#
|
17
|
-
# This allows an OrchestrationProvider
|
18
|
-
# from the
|
17
|
+
# This allows an {ConfigurationService::Test::OrchestrationProvider}
|
18
|
+
# to decouple the {ConfigurationService::Test::Orchestrator} from the semantics of the configuration service's responses.
|
19
19
|
#
|
20
20
|
class Success
|
21
21
|
|
22
22
|
##
|
23
|
-
#
|
24
|
-
#
|
25
|
-
# The response should be a Configuration object or +nil+ (because
|
26
|
-
# the ConfigurationService::Base API communicates +not found+ as
|
27
|
-
# +nil+).
|
23
|
+
# @param [ConfigurationService::Configuration, nil] response
|
24
|
+
# a configuration service response, or +nil+ if a {ConfigurationService::ConfigurationNotFoundError} was raised
|
28
25
|
#
|
29
26
|
def initialize(response)
|
30
27
|
@response = response
|
31
28
|
end
|
32
29
|
|
33
30
|
##
|
34
|
-
#
|
31
|
+
# Whether the request was allowed
|
32
|
+
#
|
33
|
+
# @return [true] always
|
35
34
|
#
|
36
35
|
def allowed?
|
37
36
|
true
|
38
37
|
end
|
39
38
|
|
40
39
|
##
|
41
|
-
#
|
40
|
+
# Whether the request was authorized but failed
|
41
|
+
#
|
42
|
+
# @return [false] always
|
42
43
|
#
|
43
44
|
def failed?
|
44
45
|
false
|
45
46
|
end
|
46
47
|
|
47
48
|
##
|
48
|
-
#
|
49
|
+
# Whether the identified configuration was found
|
50
|
+
#
|
51
|
+
# @return [true] if the +response+ was not +nil+
|
52
|
+
# @return [false] if the +response+ was +nil+
|
49
53
|
#
|
50
54
|
def found?
|
51
55
|
not @response.nil?
|
52
56
|
end
|
53
57
|
|
54
58
|
##
|
55
|
-
# The configuration data dictionary of the response
|
59
|
+
# The configuration data dictionary of the response
|
60
|
+
#
|
61
|
+
# @return [Hash] if {#found?}
|
62
|
+
# @return [nil] if not {#found?}
|
56
63
|
#
|
57
64
|
def data
|
58
65
|
@response and @response.data
|
59
66
|
end
|
60
67
|
|
61
68
|
##
|
62
|
-
# The
|
69
|
+
# The configuration metadata's revision
|
70
|
+
#
|
71
|
+
# @return [String] if {#found?}
|
72
|
+
# @return [nil] if not {#found?}
|
63
73
|
#
|
64
74
|
def revision
|
65
75
|
@response and @response.metadata["revision"]
|
66
76
|
end
|
67
77
|
|
68
78
|
##
|
69
|
-
# The metadata
|
79
|
+
# The configuration metadata
|
80
|
+
#
|
81
|
+
# @return [Hash] if {#found?}
|
82
|
+
# @return [nil] if not {#found?}
|
70
83
|
#
|
71
84
|
def metadata
|
72
85
|
@response and @response.metadata
|
@@ -75,58 +88,73 @@ module ConfigurationService
|
|
75
88
|
end
|
76
89
|
|
77
90
|
##
|
78
|
-
# Encapsulates
|
91
|
+
# Encapsulates a configuration service error
|
79
92
|
#
|
80
|
-
# This allows
|
81
|
-
#
|
82
|
-
# handling.
|
93
|
+
# This allows a {ConfigurationService::Test::OrchestrationProvider}
|
94
|
+
# to decouple the {ConfigurationService::Test::Orchestrator}
|
95
|
+
# from the semantics of the configuration service's error handling.
|
83
96
|
#
|
84
97
|
class Failure
|
85
98
|
|
86
99
|
##
|
87
|
-
#
|
100
|
+
# @param [ConfigurationService::Error] exception
|
101
|
+
# a configuration service error
|
88
102
|
#
|
89
103
|
def initialize(exception)
|
90
104
|
@exception = exception
|
91
105
|
end
|
92
106
|
|
93
107
|
##
|
94
|
-
#
|
108
|
+
# Whether the request was allowed
|
109
|
+
#
|
110
|
+
# @return [true] if the request was allowed
|
111
|
+
# @return [false] if the request was a not allowed
|
95
112
|
#
|
96
113
|
def allowed?
|
97
114
|
!@exception.is_a?(ConfigurationService::AuthorizationError)
|
98
115
|
end
|
99
116
|
|
100
117
|
##
|
101
|
-
#
|
118
|
+
# Whether the request was authorized but failed
|
119
|
+
#
|
120
|
+
# @return [true] if the request was allowed but raised a {ConfigurationService::Error}
|
121
|
+
# @return [false] if the request was not allowed or raised an unexpected error
|
102
122
|
#
|
103
123
|
def failed?
|
104
124
|
allowed? and @exception.is_a?(ConfigurationService::Error)
|
105
125
|
end
|
106
126
|
|
107
127
|
##
|
108
|
-
#
|
128
|
+
# Whether the identified configuration was found
|
129
|
+
#
|
130
|
+
# @return [false] always
|
109
131
|
#
|
110
132
|
def found?
|
111
133
|
false
|
112
134
|
end
|
113
135
|
|
114
136
|
##
|
115
|
-
#
|
137
|
+
# The configuration data dictionary of the response
|
138
|
+
#
|
139
|
+
# @raise [NotImplementedError] always
|
116
140
|
#
|
117
141
|
def data
|
118
142
|
raise NotImplementedError, "configuration not available after #{@exception.inspect}"
|
119
143
|
end
|
120
144
|
|
121
145
|
##
|
122
|
-
#
|
146
|
+
# The configuration metadata's revision
|
147
|
+
#
|
148
|
+
# @raise [NotImplementedError] always
|
123
149
|
#
|
124
150
|
def revision
|
125
151
|
raise NotImplementedError, "revision not available after #{@exception.inspect}"
|
126
152
|
end
|
127
153
|
|
128
154
|
##
|
129
|
-
#
|
155
|
+
# The configuration metadata's revision
|
156
|
+
#
|
157
|
+
# @raise [NotImplementedError] always
|
130
158
|
#
|
131
159
|
def metadata
|
132
160
|
raise NotImplementedError, "metadata not available after #{@exception.inspect}"
|
@@ -8,59 +8,67 @@ module ConfigurationService
|
|
8
8
|
module Test
|
9
9
|
|
10
10
|
##
|
11
|
-
# Test
|
11
|
+
# Test orchestration provider for testing the {ConfigurationService::Provider::Stub} service provider
|
12
12
|
#
|
13
|
-
# Registered to the OrchestrationProviderRegistry as
|
13
|
+
# Registered to the {ConfigurationService::Test::OrchestrationProviderRegistry} as "stub".
|
14
14
|
#
|
15
15
|
class StubOrchestrationProvider < OrchestrationProvider
|
16
16
|
|
17
|
+
##
|
18
|
+
# The registered identifier of the service provider under test
|
19
|
+
#
|
20
|
+
# @see ConfigurationService::Test::OrchestrationProvider#service_provider_id
|
21
|
+
#
|
17
22
|
def service_provider_id
|
18
23
|
"stub"
|
19
24
|
end
|
20
25
|
|
21
26
|
##
|
22
|
-
#
|
27
|
+
# The configuration for the service provider under test
|
23
28
|
#
|
24
|
-
|
29
|
+
# @see ConfigurationService::Test::OrchestrationProvider#service_provider_configuration
|
30
|
+
#
|
31
|
+
def service_provider_configuration
|
25
32
|
{name: "Stub configuration service provider"}
|
26
33
|
end
|
27
34
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
##
|
36
|
+
# The service provider under test
|
37
|
+
#
|
38
|
+
# @see ConfigurationService::Test::OrchestrationProvider#service_provider
|
39
|
+
#
|
40
|
+
def service_provider
|
41
|
+
ConfigurationService::Provider::Stub.new(service_provider_configuration)
|
42
|
+
end
|
36
43
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
44
|
+
##
|
45
|
+
# A broken service provider
|
46
|
+
#
|
47
|
+
# @see ConfigurationService::Test::OrchestrationProvider#broken_service_provider
|
48
|
+
#
|
49
|
+
def broken_service_provider
|
50
|
+
ConfigurationService::Provider::Broken.new
|
51
|
+
end
|
43
52
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
53
|
+
##
|
54
|
+
# Provide a token that authorizes a role
|
55
|
+
#
|
56
|
+
# The token is taken from {ConfigurationService::Provider::Stub::BUILTIN_TOKENS}
|
57
|
+
#
|
58
|
+
# @see ConfigurationService::Test::OrchestrationProvider#token_for
|
59
|
+
#
|
60
|
+
def token_for(role)
|
61
|
+
ConfigurationService::Provider::Stub::BUILTIN_TOKENS[role]
|
62
|
+
end
|
52
63
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
def delete_configuration # :doc:
|
62
|
-
ConfigurationService::Provider::StubStore.instance.delete(@identifier)
|
63
|
-
end
|
64
|
+
##
|
65
|
+
# Delete configuration data
|
66
|
+
#
|
67
|
+
# @see ConfigurationService::Test::OrchestrationProvider#delete_configuration
|
68
|
+
#
|
69
|
+
def delete_configuration
|
70
|
+
ConfigurationService::Provider::StubStore.instance.delete(@identifier)
|
71
|
+
end
|
64
72
|
|
65
73
|
end
|
66
74
|
|
@@ -8,15 +8,16 @@ module ConfigurationService
|
|
8
8
|
# The following are used directly by the cucumber test suite, and
|
9
9
|
# should not be of immediate interest to implementors:
|
10
10
|
#
|
11
|
-
# * Orchestrator
|
12
|
-
# * OrchestratorEnvironmentFactory
|
13
|
-
# * StubOrchestrationProvider
|
11
|
+
# * {ConfigurationService::Test::Orchestrator} the declarative test orchestration API
|
12
|
+
# * {ConfigurationService::Test::OrchestratorEnvironmentFactory} test orchestrator factory
|
13
|
+
# * {ConfigurationService::Test::StubOrchestrationProvider} imperative test orchestration provider
|
14
|
+
# for the {ConfigurationService::Provider::Stub Stub} configuration service provider
|
14
15
|
#
|
15
16
|
# The following are of interest to implementors:
|
16
17
|
#
|
17
|
-
# * OrchestrationProviderRegistry
|
18
|
-
# * Response
|
19
|
-
# * OrchestrationProvider
|
18
|
+
# * {ConfigurationService::Test::OrchestrationProviderRegistry} registry of imperative test orchestration providers
|
19
|
+
# * {ConfigurationService::Test::Response} configuration service response wrappers
|
20
|
+
# * {ConfigurationService::Test::OrchestrationProvider} abstract imperative test orchestration provider
|
20
21
|
#
|
21
22
|
module Test
|
22
23
|
|
@@ -6,14 +6,14 @@ require "configuration_service/provider_registry"
|
|
6
6
|
require "configuration_service/version"
|
7
7
|
|
8
8
|
##
|
9
|
-
# See ConfigurationService::Base.
|
9
|
+
# See {ConfigurationService::Base}.
|
10
10
|
#
|
11
11
|
module ConfigurationService
|
12
12
|
|
13
13
|
##
|
14
|
-
# Creates a new ConfigurationService::Base
|
14
|
+
# Creates a new {ConfigurationService::Base}
|
15
15
|
#
|
16
|
-
#
|
16
|
+
# @see ConfigurationService::Base#initialize
|
17
17
|
#
|
18
18
|
def self.new(identifier, token, provider)
|
19
19
|
ConfigurationService::Base.new(identifier, token, provider)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configuration_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sheldon Hearn
|
@@ -91,8 +91,8 @@ files:
|
|
91
91
|
- .gitignore
|
92
92
|
- .rspec
|
93
93
|
- .travis.yml
|
94
|
+
- .yardopts
|
94
95
|
- Gemfile
|
95
|
-
- README.md
|
96
96
|
- README.rdoc
|
97
97
|
- Rakefile
|
98
98
|
- features/authorization.feature
|
@@ -148,3 +148,4 @@ signing_key:
|
|
148
148
|
specification_version: 4
|
149
149
|
summary: Configuration service
|
150
150
|
test_files: []
|
151
|
+
has_rdoc:
|