evt-messaging-fixtures 1.1.4.0 → 1.1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc5e3091ad4d8be8bde9f80803d3869e18b4e4c109462f971ec659a191ef4a6a
4
- data.tar.gz: 93f87536e10acb084b6ad3aa8ba16f6f3df25ec85911a8cfd9000dce34cb686a
3
+ metadata.gz: 1cd7fa01e2214f53778177239b1159f5891f92a2d4e2a56ffea549437e8b2c3c
4
+ data.tar.gz: 1883676af9f1f736fd57722e024f1f571b59dc279fe8f2d5befe455882011a52
5
5
  SHA512:
6
- metadata.gz: b380ec23b9c0a066bcac638c39fa17dc1e6f87dfacfb992e5bc5054ae1c09b9dc2e04d2eb7b8d36b3b531acad7cbaebad62fda69703884ab728d6358dd1c0222
7
- data.tar.gz: 4b87775c9aaaa334fa061b8803b18503987fe5c24a3e3dcaceebb5c9f669abce4b26ac66499e049d1f2d68ab527b21b5b8b19d13cc05322520e9307999762f1a
6
+ metadata.gz: aa83d40346d3c415017ac2b43621b57ec851b60fe70963a62c50840da53f2412264194a2733e638bd2d19d3bbd89e0e242f84476123dc2f49c086a2acf5c0402
7
+ data.tar.gz: 8cf47f033dcecd118484932e28a783a397c6751ab0ba905cb8c3b127a8ff7636733c83cc7fb9100d6a2f0384807114806879d014c74cef2effbe16e96f2722ce
@@ -17,6 +17,9 @@ module Messaging
17
17
 
18
18
  metadata.reply_stream_name = reply_stream_name
19
19
 
20
+ metadata.properties = properties
21
+ metadata.local_properties = local_properties
22
+
20
23
  metadata.time = time
21
24
 
22
25
  metadata.schema_version = schema_version
@@ -56,6 +59,18 @@ module Messaging
56
59
  'someReplyStream'
57
60
  end
58
61
 
62
+ def self.properties
63
+ {
64
+ some_property: 'some property value'
65
+ }
66
+ end
67
+
68
+ def self.local_properties
69
+ {
70
+ some_local_property: 'some local property value'
71
+ }
72
+ end
73
+
59
74
  def self.time
60
75
  ::Time.utc(2000, 1, 1, 0, 0, 0, 11)
61
76
  end
@@ -11,22 +11,24 @@ module Messaging
11
11
  entity.sequence
12
12
  end
13
13
 
14
- initializer :handler, :input_message, :entity, :entity_version, :clock_time, :identifier_uuid, :test_block
14
+ initializer :handler, :input_message, :entity, :entity_version, :entity_id, :clock_time, :identifier_uuid, :test_block
15
15
 
16
- def self.build(handler, input_message, entity=nil, entity_version=nil, clock_time: nil, identifier_uuid: nil, &test_block)
17
- instance = new(handler, input_message, entity, entity_version, clock_time, identifier_uuid, test_block)
16
+ def self.build(handler, input_message, entity=nil, entity_version=nil, entity_id: nil, clock_time: nil, identifier_uuid: nil, &test_block)
17
+ instance = new(handler, input_message, entity, entity_version, entity_id, clock_time, identifier_uuid, test_block)
18
18
 
19
- set_store_entity(handler, entity, entity_version)
19
+ set_store_entity(handler, entity, entity_version, entity_id)
20
20
  set_clock_time(handler, clock_time)
21
21
  set_identifier_uuid(handler, identifier_uuid)
22
22
 
23
23
  instance
24
24
  end
25
25
 
26
- def self.set_store_entity(handler, entity, entity_version)
26
+ def self.set_store_entity(handler, entity, entity_version, entity_id)
27
27
  return if entity.nil?
28
28
 
29
- handler.store.add(entity.id, entity, entity_version)
29
+ entity_id ||= entity.id
30
+
31
+ handler.store.add(entity_id, entity, entity_version)
30
32
  end
31
33
 
32
34
  def self.set_clock_time(handler, clock_time)
@@ -38,7 +38,10 @@ module Messaging
38
38
  def assert_attributes_assigned(attribute_names=nil, context_title_qualifier: nil)
39
39
  attribute_names ||= Messaging::Message::Metadata.all_attribute_names
40
40
 
41
- attributes_context_title = "#{context_title_qualifier} Attributes Assigned".lstrip
41
+ attributes_text = "Attribute"
42
+ attributes_text = attribute_names.length == 1 ? attributes_text : "#{attributes_text}s"
43
+
44
+ attributes_context_title = "#{context_title_qualifier} #{attributes_text} Assigned".lstrip
42
45
 
43
46
  fixture(
44
47
  Schema::Fixtures::Assignment,
@@ -74,6 +77,20 @@ module Messaging
74
77
  end
75
78
  end
76
79
 
80
+ def assert_correlation_stream_name_assigned
81
+ control_metadata = Messaging::Message::Metadata.new
82
+ default_correlation_stream_name = control_metadata.correlation_stream_name
83
+
84
+ correlation_stream_name = metadata.correlation_stream_name
85
+
86
+ test "Correlation stream name assigned" do
87
+ detail "Default Value: #{default_correlation_stream_name.inspect}"
88
+ detail "Assigned Value: #{correlation_stream_name.inspect}"
89
+
90
+ refute(correlation_stream_name == default_correlation_stream_name)
91
+ end
92
+ end
93
+
77
94
  def assert_reply_stream_name(reply_stream_name)
78
95
  metadata_value = metadata.reply_stream_name
79
96
 
@@ -84,6 +101,20 @@ module Messaging
84
101
  end
85
102
  end
86
103
 
104
+ def assert_reply_stream_name_assigned
105
+ control_metadata = Messaging::Message::Metadata.new
106
+ default_reply_stream_name = control_metadata.reply_stream_name
107
+
108
+ reply_stream_name = metadata.reply_stream_name
109
+
110
+ test "Reply stream name assigned" do
111
+ detail "Default Value: #{default_reply_stream_name.inspect}"
112
+ detail "Assigned Value: #{reply_stream_name.inspect}"
113
+
114
+ refute(reply_stream_name == default_reply_stream_name)
115
+ end
116
+ end
117
+
87
118
  def assert_follows
88
119
  fixture(Follows, metadata, source_metadata)
89
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-messaging-fixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4.0
4
+ version: 1.1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-05 00:00:00.000000000 Z
11
+ date: 2021-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-entity_store
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.1.2
97
+ rubygems_version: 3.2.15
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: TestBench fixtures for the Messaging library