ruby_rabbitmq_janus 1.2.9 → 2.0.0.pre.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +145 -32
- data/config/default.yml +2 -0
- data/config/requests.md +2 -1
- data/config/requests/admin/add_token.json +6 -0
- data/config/requests/admin/allow_token.json +6 -0
- data/config/requests/admin/disallow_token.json +6 -0
- data/config/requests/admin/handle_info.json +1 -1
- data/config/requests/admin/handles.json +1 -1
- data/config/requests/admin/remove_token.json +6 -0
- data/config/requests/admin/sessions.json +1 -1
- data/config/requests/admin/set_locking_debug.json +6 -0
- data/config/requests/admin/{log_level.json → set_log_level.json} +1 -1
- data/config/requests/admin/tokens.json +5 -0
- data/config/requests/base/attach.json +1 -1
- data/config/requests/base/create.json +1 -1
- data/config/requests/base/destroy.json +1 -1
- data/config/requests/base/detach.json +1 -1
- data/config/requests/base/info.json +1 -1
- data/config/requests/base/keepalive.json +1 -1
- data/config/requests/peer/answer.json +1 -1
- data/config/requests/peer/offer.json +1 -1
- data/config/requests/peer/trickle.json +1 -1
- data/lib/generators/ruby_rabbitmq_janus/initializer_generator.rb +3 -0
- data/lib/rrj/admin.rb +34 -0
- data/lib/rrj/errors/error.rb +2 -1
- data/lib/rrj/errors/init.rb +6 -0
- data/lib/rrj/errors/janus/janus.rb +1 -0
- data/lib/rrj/errors/janus/janus_message.rb +8 -4
- data/lib/rrj/errors/janus/janus_processus_keepalive.rb +1 -0
- data/lib/rrj/errors/janus/janus_response.rb +27 -6
- data/lib/rrj/errors/janus/janus_transaction.rb +4 -0
- data/lib/rrj/errors/rabbit/rabbit.rb +3 -1
- data/lib/rrj/errors/tools/config.rb +1 -0
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/init.rb +37 -169
- data/lib/rrj/janus/messages/admin.rb +1 -2
- data/lib/rrj/janus/messages/message.rb +4 -4
- data/lib/rrj/janus/messages/standard.rb +3 -5
- data/lib/rrj/janus/processus/concurrency.rb +1 -1
- data/lib/rrj/janus/processus/keepalive.rb +10 -4
- data/lib/rrj/janus/responses/admin.rb +31 -0
- data/lib/rrj/janus/responses/event.rb +23 -5
- data/lib/rrj/janus/responses/response.rb +2 -0
- data/lib/rrj/janus/responses/standard.rb +26 -5
- data/lib/rrj/janus/transactions/admin.rb +22 -26
- data/lib/rrj/janus/transactions/handle.rb +13 -8
- data/lib/rrj/janus/transactions/session.rb +25 -7
- data/lib/rrj/janus/transactions/transaction.rb +2 -1
- data/lib/rrj/rabbit/connect.rb +2 -3
- data/lib/rrj/rabbit/publish/admin.rb +1 -6
- data/lib/rrj/rabbit/publish/base_publisher.rb +6 -11
- data/lib/rrj/rabbit/publish/exclusive.rb +1 -0
- data/lib/rrj/rabbit/publish/listener.rb +10 -27
- data/lib/rrj/rabbit/publish/non_exclusive.rb +2 -6
- data/lib/rrj/rabbit/publish/publisher.rb +4 -17
- data/lib/rrj/tools/{config.rb → gem/config.rb} +5 -5
- data/lib/rrj/tools/{log.rb → gem/log.rb} +21 -6
- data/lib/rrj/tools/gem/option.rb +57 -0
- data/lib/rrj/tools/{requests.rb → gem/requests.rb} +0 -0
- data/lib/rrj/tools/replaces/admin.rb +7 -13
- data/lib/rrj/tools/replaces/handle.rb +61 -0
- data/lib/rrj/tools/replaces/replace.rb +57 -27
- data/lib/rrj/tools/replaces/session.rb +34 -0
- data/lib/rrj/tools/replaces/type.rb +63 -11
- data/lib/rrj/tools/tools.rb +4 -3
- data/lib/ruby_rabbitmq_janus.rb +1 -0
- data/spec/request/admin/request_handle_info_spec.rb +13 -7
- data/spec/request/admin/request_handles_spec.rb +20 -0
- data/spec/request/admin/request_sessions_spec.rb +5 -4
- data/spec/request/admin/request_set_locking_debug_spec.rb +16 -0
- data/spec/request/admin/request_set_log_level_spec.rb +16 -0
- data/spec/request/admin/request_tokens_spec.rb +13 -0
- data/spec/request/base/request_attach_spec.rb +6 -9
- data/spec/request/base/request_create_spec.rb +5 -3
- data/spec/request/base/request_destroy_spec.rb +5 -3
- data/spec/request/base/request_detach_spec.rb +6 -7
- data/spec/request/base/request_info_spec.rb +5 -3
- data/spec/request/base/request_keepalive_spec.rb +5 -3
- data/spec/request/peer/request_offer_spec.rb +18 -92
- data/spec/request/peer/request_trickle_spec.rb +9 -28
- data/spec/request/peer/request_trickles_spec.rb +23 -0
- data/spec/rrj/responses/responses_admin_spec.rb +39 -0
- data/spec/rrj/responses/responses_event_spec.rb +25 -0
- data/spec/rrj/responses/responses_response_spec.rb +31 -0
- data/spec/rrj/responses/responses_standard_spec.rb +43 -0
- data/spec/rrj/rrj_config_spec.rb +7 -7
- data/spec/rrj/rrj_rabbitmq_spec.rb +1 -1
- data/spec/rrj/tools/replace_admin_spec.rb +86 -0
- data/spec/rrj/tools/replace_handle_spec.rb +78 -0
- data/spec/rrj/tools/replace_session_spec.rb +66 -0
- data/spec/rrj/tools/replace_spec.rb +69 -0
- data/spec/rrj/tools/type_spec.rb +150 -0
- data/spec/spec_helper.rb +46 -7
- data/spec/support/examples_request.rb +33 -61
- data/spec/support/examples_response.rb +30 -0
- data/spec/support/schemas/request/admin/handles.json +15 -0
- data/spec/support/schemas/request/admin/set_locking_debug.json +13 -0
- data/spec/support/schemas/request/admin/set_log_level.json +11 -0
- data/spec/support/schemas/request/admin/tokens.json +13 -0
- data/spec/support/type.rb +66 -0
- metadata +41 -69
- data/config/requests/peer/trickles.json +0 -7
- data/lib/rrj/tools/replaces/standard.rb +0 -101
- data/spec/fixtures/config/requests/admin/handle_info.json +0 -3
- data/spec/fixtures/config/requests/admin/handles.json +0 -3
- data/spec/fixtures/config/requests/admin/log_level.json +0 -3
- data/spec/fixtures/config/requests/admin/sessions.json +0 -3
- data/spec/fixtures/config/requests/base/attach.json +0 -3
- data/spec/fixtures/config/requests/base/create.json +0 -4
- data/spec/fixtures/config/requests/base/destroy.json +0 -3
- data/spec/fixtures/config/requests/base/detach.json +0 -3
- data/spec/fixtures/config/requests/base/info.json +0 -3
- data/spec/fixtures/config/requests/base/keepalive.json +0 -3
- data/spec/fixtures/config/requests/peer/answer.json +0 -3
- data/spec/fixtures/config/requests/peer/offer.json +0 -3
- data/spec/fixtures/config/requests/peer/trickle.json +0 -3
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyRabbitmqJanus
|
4
|
+
module Tools
|
5
|
+
module Replaces
|
6
|
+
# Format message request with good data to HASH format for Handle request.
|
7
|
+
# Manage sdp, handle_id, candidate or candidates.
|
8
|
+
#
|
9
|
+
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
10
|
+
class Handle < Session
|
11
|
+
private
|
12
|
+
|
13
|
+
def replace_element_classic
|
14
|
+
super
|
15
|
+
replace_sdp if request.key?('jsep')
|
16
|
+
replace_handle if request.key?('handle_id')
|
17
|
+
replace_candidate \
|
18
|
+
if request.key?('candidate') || request.key?('candidates')
|
19
|
+
end
|
20
|
+
|
21
|
+
def replace_handle
|
22
|
+
request['handle_id'] = type.convert('handle_id', opts)
|
23
|
+
rescue => message
|
24
|
+
Tools::Log.instance.warn "Error handle replace : #{message}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def replace_candidate
|
28
|
+
cdn = type.convert(determine_key_candidate, opts)
|
29
|
+
request[cdn[0]] = cdn[1]
|
30
|
+
delete_key_unless
|
31
|
+
rescue => message
|
32
|
+
Tools::Log.instance.warn "Error candidate replace : #{message}"
|
33
|
+
end
|
34
|
+
|
35
|
+
def replace_sdp
|
36
|
+
request['jsep']['sdp'] = type.convert('sdp', opts)
|
37
|
+
rescue => message
|
38
|
+
Tools::Log.instance.warn "Error sdp replace : #{message}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def determine_key_candidate
|
42
|
+
if request.key?('candidate')
|
43
|
+
'candidate'
|
44
|
+
else
|
45
|
+
'candidates'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def delete_key_unless
|
50
|
+
singular = request['candidate']
|
51
|
+
plural = request['candidates']
|
52
|
+
if singular.eql?('<array>')
|
53
|
+
request.delete('candidate')
|
54
|
+
elsif plural.eql?('candidates')
|
55
|
+
request.delete['candidates']
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -4,25 +4,29 @@ module RubyRabbitmqJanus
|
|
4
4
|
module Tools
|
5
5
|
# Tools for replace elements in request
|
6
6
|
module Replaces
|
7
|
-
#
|
7
|
+
# # Prepare request
|
8
|
+
#
|
9
|
+
# Tools for replace elements in request sending to Rabbitmq. It's a basic
|
10
|
+
# class. Manage just transaction element.
|
11
|
+
#
|
8
12
|
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
9
13
|
class Replace
|
10
|
-
# Initialize tool replace
|
14
|
+
# Initialize tool replace.
|
11
15
|
#
|
12
16
|
# @param [Hash] request Request parsing before sending to RabbitMQ/Janus
|
13
|
-
# @param [Hash] options
|
17
|
+
# @param [Hash] options Elements to be replaced in request
|
14
18
|
def initialize(request, options = {})
|
15
19
|
@request = request
|
16
20
|
@opts = options
|
17
21
|
@type = Tools::Type.new(@request)
|
18
|
-
Tools::Log.instance.debug "Element to replace : #{@opts}"
|
19
22
|
end
|
20
23
|
|
21
24
|
# Replace element in hash request with information used for this
|
22
|
-
# transaction
|
23
|
-
#
|
25
|
+
# transaction.
|
26
|
+
#
|
27
|
+
# @return [Hash] request with element replace
|
24
28
|
def transform_request
|
25
|
-
|
29
|
+
replace_element_classic
|
26
30
|
unless @opts.empty?
|
27
31
|
replace_other if test_presence?('replace')
|
28
32
|
add_other if test_presence?('add')
|
@@ -34,39 +38,65 @@ module RubyRabbitmqJanus
|
|
34
38
|
|
35
39
|
attr_reader :request, :opts, :type
|
36
40
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
replace_session if @request.key?('session_id')
|
41
|
-
replace_plugin if @request.key?('plugin')
|
41
|
+
def test_presence?(presence_of_key)
|
42
|
+
@opts.key?(presence_of_key) && @request.key?('body') &&
|
43
|
+
!@opts[presence_of_key].blank?
|
42
44
|
end
|
43
45
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
@request['transaction'].replace \
|
48
|
-
[*('A'..'Z'), *('0'..'9')].sample(10).join
|
46
|
+
def replace_other
|
47
|
+
values = @opts['replace']
|
48
|
+
running_hash(rewrite_key_to_string(values))
|
49
49
|
rescue => message
|
50
|
-
Tools::Log.instance.warn "Error
|
50
|
+
Tools::Log.instance.warn "Error REPLACE other field : #{message}"
|
51
51
|
end
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
@request['
|
53
|
+
def add_other
|
54
|
+
values = @opts['add']
|
55
|
+
@request['body'].merge!(values)
|
56
56
|
rescue => message
|
57
|
-
Tools::Log.instance.warn "Error
|
57
|
+
Tools::Log.instance.warn "Error ADD other field : #{message}"
|
58
|
+
end
|
59
|
+
|
60
|
+
def rewrite_key_to_string(node)
|
61
|
+
Hash[
|
62
|
+
node.map do |key, value|
|
63
|
+
[key.to_s, value?(value)]
|
64
|
+
end
|
65
|
+
]
|
66
|
+
end
|
67
|
+
|
68
|
+
def value?(value)
|
69
|
+
value.is_a?(Hash) ? rewrite_key_to_string(value) : value
|
70
|
+
end
|
71
|
+
|
72
|
+
def running_hash(hash, parent = 'body')
|
73
|
+
hash.each do |key, value|
|
74
|
+
if value.is_a?(Hash)
|
75
|
+
running_hash(value, new_parent(key, parent))
|
76
|
+
else
|
77
|
+
@request[parent][key] = value unless key.eql? 'sdp'
|
78
|
+
end
|
79
|
+
end
|
58
80
|
end
|
59
81
|
|
60
|
-
|
61
|
-
|
62
|
-
|
82
|
+
def new_parent(key, parent)
|
83
|
+
"#{parent}#{'.' unless parent.empty?}#{key}"
|
84
|
+
end
|
85
|
+
|
86
|
+
def replace_element_classic
|
87
|
+
replace_transaction if @request.key?('transaction')
|
88
|
+
end
|
89
|
+
|
90
|
+
def replace_transaction
|
91
|
+
@request['transaction'] = @type.convert('transaction')
|
63
92
|
rescue => message
|
64
|
-
Tools::Log.instance.warn "Error
|
93
|
+
Tools::Log.instance.warn "Error transaction replace : #{message}"
|
65
94
|
end
|
66
95
|
end
|
67
96
|
end
|
68
97
|
end
|
69
98
|
end
|
70
99
|
|
71
|
-
require 'rrj/tools/replaces/
|
100
|
+
require 'rrj/tools/replaces/session'
|
101
|
+
require 'rrj/tools/replaces/handle'
|
72
102
|
require 'rrj/tools/replaces/admin'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyRabbitmqJanus
|
4
|
+
module Tools
|
5
|
+
module Replaces
|
6
|
+
# Format message request with good data to HASH format for Session
|
7
|
+
# request.
|
8
|
+
# Manage session and plugin.
|
9
|
+
#
|
10
|
+
# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
|
11
|
+
class Session < Replace
|
12
|
+
private
|
13
|
+
|
14
|
+
def replace_element_classic
|
15
|
+
super
|
16
|
+
replace_session if request.key?('session_id')
|
17
|
+
replace_plugin if request.key?('plugin')
|
18
|
+
end
|
19
|
+
|
20
|
+
def replace_session
|
21
|
+
request['session_id'] = type.convert('session_id', opts)
|
22
|
+
rescue => message
|
23
|
+
Tools::Log.instance.warn "Error session replace : #{message}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def replace_plugin
|
27
|
+
request['plugin'] = type.convert('plugin')
|
28
|
+
rescue => message
|
29
|
+
Tools::Log.instance.warn "Error plugin replace : #{message}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support/core_ext/string'
|
4
|
+
|
5
|
+
# :reek:UtilityFunction
|
6
|
+
# :reek:TooManyStatements
|
7
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
8
|
+
|
3
9
|
module RubyRabbitmqJanus
|
4
10
|
module Tools
|
5
11
|
# Class for converting elemnts given by apps to this gem an type conform
|
@@ -10,7 +16,7 @@ module RubyRabbitmqJanus
|
|
10
16
|
# @param [Hash] request Request parsing before sending to RabbitMQ/Janus
|
11
17
|
def initialize(request)
|
12
18
|
@request = request
|
13
|
-
@data = nil
|
19
|
+
@key = @data = nil
|
14
20
|
end
|
15
21
|
|
16
22
|
# Return an data with a type corresponding to string in request
|
@@ -19,35 +25,81 @@ module RubyRabbitmqJanus
|
|
19
25
|
# @param [Hash] option Datas sending by user and adding/replace in request
|
20
26
|
#
|
21
27
|
# @return data with good type for JSON format
|
22
|
-
def convert(key, option)
|
23
|
-
@
|
24
|
-
|
28
|
+
def convert(key, option = {})
|
29
|
+
@key = key
|
30
|
+
@data = option[@key] if option.key?(@key)
|
31
|
+
convert_data
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def convert_data
|
37
|
+
case search_key
|
25
38
|
when '<string>' then convert_to_type_string
|
26
|
-
when '<number>' then convert_to_type_number
|
39
|
+
when '<number>', '<integer>' then convert_to_type_number
|
27
40
|
when '<boolean>' then convert_to_type_boolean
|
41
|
+
when '<array>' then convert_to_type_array
|
42
|
+
when '<transaction>' then convert_to_type_transaction
|
43
|
+
when /<plugin\[[0-9]\]>/ then convert_to_type_plugin
|
28
44
|
end
|
29
45
|
end
|
30
46
|
|
31
|
-
|
47
|
+
def search_key
|
48
|
+
field = @request[@key]
|
49
|
+
if field.blank?
|
50
|
+
@request.each do |key, value|
|
51
|
+
test = @request[key]
|
52
|
+
field = test[@key] \
|
53
|
+
if value.is_a?(Hash) && test.key?(@key)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
field
|
57
|
+
end
|
58
|
+
|
59
|
+
def convert_to_type_transaction
|
60
|
+
[*('A'..'Z'), *('0'..'9')].sample(10).join
|
61
|
+
end
|
32
62
|
|
33
|
-
# Convert a data to String type
|
34
63
|
def convert_to_type_string
|
35
64
|
@data.to_s
|
36
65
|
end
|
37
66
|
|
38
|
-
# Convert a data to Integer type
|
39
67
|
def convert_to_type_number
|
40
68
|
@data.to_i
|
41
69
|
end
|
42
70
|
|
43
|
-
# Convert a data to Boolean type
|
44
71
|
def convert_to_type_boolean
|
45
|
-
if
|
72
|
+
if test_boolean('TRUE', TrueClass)
|
46
73
|
true
|
47
|
-
elsif
|
74
|
+
elsif test_boolean('FALSE', FalseClass)
|
48
75
|
false
|
49
76
|
end
|
50
77
|
end
|
78
|
+
|
79
|
+
def convert_to_type_plugin
|
80
|
+
index = @request[@key].gsub('<plugin[', '').gsub(']>', ']').to_i
|
81
|
+
Config.instance.plugin_at(index)
|
82
|
+
end
|
83
|
+
|
84
|
+
def convert_to_type_array
|
85
|
+
data = array_alone
|
86
|
+
key = data.is_a?(Hash) ? @key : @key.pluralize
|
87
|
+
[key, data]
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_boolean(boolean_string, boolean_class)
|
91
|
+
@data.is_a?(boolean_class) ||
|
92
|
+
(@data.is_a?(String) && @data.casecmp(boolean_string).eql?(0))
|
93
|
+
end
|
94
|
+
|
95
|
+
def array_alone
|
96
|
+
if @data.is_a?(Array)
|
97
|
+
@data.count.eql?(1) ? @data[0] : @data
|
98
|
+
else
|
99
|
+
@data
|
100
|
+
end
|
101
|
+
end
|
51
102
|
end
|
52
103
|
end
|
53
104
|
end
|
105
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
data/lib/rrj/tools/tools.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rrj/tools/log'
|
4
|
-
require 'rrj/tools/config'
|
5
|
-
require 'rrj/tools/requests'
|
3
|
+
require 'rrj/tools/gem/log'
|
4
|
+
require 'rrj/tools/gem/config'
|
5
|
+
require 'rrj/tools/gem/requests'
|
6
|
+
require 'rrj/tools/gem/option'
|
6
7
|
require 'rrj/tools/replaces/type'
|
7
8
|
require 'rrj/tools/replaces/replace'
|
8
9
|
|
data/lib/ruby_rabbitmq_janus.rb
CHANGED
@@ -2,13 +2,19 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe 'RubyRabbitmqJanus::RRJ -- message type
|
6
|
-
before(:example)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
describe 'RubyRabbitmqJanus::RRJ -- message type handle info' do
|
6
|
+
before(:example) do
|
7
|
+
@type = 'admin::handle_info'
|
8
|
+
sender = nil
|
9
|
+
@gateway.start_transaction do |transaction|
|
10
|
+
sender = transaction.publish_message('base::attach').sender
|
11
|
+
end
|
12
|
+
@options = { 'handle_id' => sender }
|
11
13
|
end
|
12
14
|
|
13
|
-
#
|
15
|
+
describe '#start_transaction_admin', type: :request,
|
16
|
+
level: :admin,
|
17
|
+
name: :handle_info do
|
18
|
+
include_examples 'transaction admin should match json schema'
|
19
|
+
end
|
14
20
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'RubyRabbitmqJanus::RRJ -- message type handles list' do
|
6
|
+
before(:example) do
|
7
|
+
@type = 'admin::handles'
|
8
|
+
sender = nil
|
9
|
+
@gateway.start_transaction do |transaction|
|
10
|
+
sender = transaction.publish_message('base::attach').sender
|
11
|
+
end
|
12
|
+
@options = { 'handle_id' => sender }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#start_transaction_admin', type: :request,
|
16
|
+
level: :admin,
|
17
|
+
name: :handles do
|
18
|
+
include_examples 'transaction admin should match json schema'
|
19
|
+
end
|
20
|
+
end
|
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe 'RubyRabbitmqJanus::RRJ -- message type sessions' do
|
5
|
+
describe 'RubyRabbitmqJanus::RRJ -- message type sessions list' do
|
6
6
|
before(:example) { @type = 'admin::sessions' }
|
7
7
|
|
8
|
-
describe '#
|
9
|
-
|
10
|
-
|
8
|
+
describe '#start_transaction_admin', type: :request,
|
9
|
+
level: :admin,
|
10
|
+
name: :sessions do
|
11
|
+
include_examples 'transaction admin should match json schema'
|
11
12
|
end
|
12
13
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'RubyRabbitmqJanus::RRJ -- message type set locking debug' do
|
6
|
+
before(:example) do
|
7
|
+
@type = 'admin::set_locking_debug'
|
8
|
+
@options = { 'debug' => [true, false].sample }
|
9
|
+
end
|
10
|
+
|
11
|
+
describe '#start_transaction_admin', type: :request,
|
12
|
+
level: :admin,
|
13
|
+
name: :set_locking_debug do
|
14
|
+
include_examples 'transaction admin should match json schema'
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe 'RubyRabbitmqJanus::RRJ -- message type set log level' do
|
6
|
+
before(:example) do
|
7
|
+
@type = 'admin::set_log_level'
|
8
|
+
@options = { 'level' => Random.rand(7) }
|
9
|
+
end
|
10
|
+
|
11
|
+
describe '#start_transaction_admin', type: :request,
|
12
|
+
level: :admin,
|
13
|
+
name: :set_log_level do
|
14
|
+
include_examples 'transaction admin should match json schema'
|
15
|
+
end
|
16
|
+
end
|