Class: Messaging::Fixtures::Follows

Inherits:
Object
  • Object
show all
Includes:
Initializer, TestBench::Fixture
Defined in:
lib/messaging/fixtures/follows.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(metadata, source_metadata = nil) ⇒ Object



9
10
11
# File 'lib/messaging/fixtures/follows.rb', line 9

def self.build(, =nil)
  new(, )
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/messaging/fixtures/follows.rb', line 13

def call
  context do
    if .nil?
      test "Metadata not nil" do
        detail "Metadata: nil"
        refute(.nil?)
      end
      return
    end

    if .nil?
      test "Source metadata not nil" do
        detail "Source Metadata: nil"
        refute(.nil?)
      end
      return
    end

    call!
  end
end

#call!Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/messaging/fixtures/follows.rb', line 35

def call!
  test "Follows" do
    detail "Source Message Stream Name: #{.stream_name.inspect}"
    detail "Causation Stream Name: #{.causation_message_stream_name.inspect}"

    detail "Source Message Position: #{.position.inspect}"
    detail "Causation Position: #{.causation_message_position.inspect}"

    detail "Source Message Global Position: #{.global_position.inspect}"
    detail "Causation Global Position: #{.causation_message_global_position.inspect}"

    detail "Source Message Correlation Stream Name: #{.correlation_stream_name.inspect}"
    detail "Correlation Stream Name: #{.correlation_stream_name.inspect}"

    detail "Source Message Reply Stream Name: #{.reply_stream_name.inspect}"
    detail "Reply Stream Name: #{.reply_stream_name.inspect}"

    assert(.follows?())
  end
end