sbmt-kafka_producer 2.2.2 → 2.2.3

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: a5e838e0df302300e7c1b9b226edd81af21f4f836e520d03d0e47a7263732eec
4
- data.tar.gz: 21d9f7f42b5338f79734e43737383d819eb53cb8403c57ca4b002aef0bd53416
3
+ metadata.gz: 1d5ca361cbc4f800037931ef6cc82dcc8d2ffa9bf67d6963d4747a6a140ad273
4
+ data.tar.gz: 6bfdeb2245fe9b02c76f63e684f438afb3842f2ff7e0655301d668af98d0013c
5
5
  SHA512:
6
- metadata.gz: d4be18e16012cbb34b54ab75d577ed5847028757859c4363f0c58806daa9a6be91ee698b11867157481ed4e718d5d389c836d31c02541e77f5cb940bafc7dbb7
7
- data.tar.gz: b7bf961952f18c32b9c51f0bb375ae1c77fffbc5c82b158025e5503997bd99dd05d34dc2b706f2e9740dae59ec4dc7c3370620abdb2c0d9b0bc5df22aedfc828
6
+ metadata.gz: 1366c9c4c2f334a91ec43aaa56027e5bfd6e36d225642d4d51fb5874194baea56c14b259df054fa70a5e7cbc739c3333e49079c09b7249e2498e10fcff74e712
7
+ data.tar.gz: ba5693175d5d7187e32875ab7c08f504a4ebe274c054aee2f152ef6a5fb5086bba47350c1b12f37e520a11f72d93f869851dc704765eac7e3fcb135dcfe6e516
data/CHANGELOG.md CHANGED
@@ -13,6 +13,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
 
14
14
  ### Fixed
15
15
 
16
+ ## [2.2.3] - 2024-06-20
17
+
18
+ ### Fixed
19
+
20
+ - Remove mock for producer client
21
+ - A singleton class of the producer client has been added for testing
22
+
16
23
  ## [2.2.2] - 2024-06-15
17
24
 
18
25
  ### Fixed
data/README.md CHANGED
@@ -157,7 +157,7 @@ The gem collects base producing metrics using [Yabeda](https://github.com/yabeda
157
157
 
158
158
  ## Testing
159
159
 
160
- To stub a producer request to real Kafka broker, you can use a mock. To do this, please add `require "sbmt/kafka_producer/testing"` to the `spec/rails_helper.rb`.
160
+ To stub a producer request to real Kafka broker, you can use a fake class. To do this, please add `require "sbmt/kafka_producer/testing"` to the `spec/rails_helper.rb`.
161
161
 
162
162
  ## Development
163
163
 
@@ -1,13 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- RSpec.configure do |config|
4
- config.before(:each) do
5
- allow(Sbmt::KafkaProducer::KafkaClientFactory)
6
- .to receive(:default_client)
7
- .and_return(instance_double(WaterDrop::Producer, {produce_sync: true, produce_async: true}))
8
-
9
- allow(Sbmt::KafkaProducer::KafkaClientFactory)
10
- .to receive(:build)
11
- .and_return(instance_double(WaterDrop::Producer, {produce_sync: true, produce_async: true}))
3
+ class FakeWaterDropClient
4
+ def produce_sync(*)
5
+ # no op
6
+ end
7
+
8
+ def produce_async(*)
9
+ # no op
12
10
  end
13
11
  end
12
+
13
+ Sbmt::KafkaProducer::KafkaClientFactory.singleton_class.prepend(
14
+ Module.new do
15
+ def default_client
16
+ @default_client ||= FakeWaterDropClient.new
17
+ end
18
+
19
+ def build(*)
20
+ @default_client ||= FakeWaterDropClient.new
21
+ end
22
+ end
23
+ )
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module KafkaProducer
5
- VERSION = "2.2.2"
5
+ VERSION = "2.2.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbmt-kafka_producer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sbermarket Ruby-Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-17 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -426,7 +426,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
426
426
  - !ruby/object:Gem::Version
427
427
  version: '0'
428
428
  requirements: []
429
- rubygems_version: 3.5.11
429
+ rubygems_version: 3.5.3
430
430
  signing_key:
431
431
  specification_version: 4
432
432
  summary: Ruby gem for producing Kafka messages