-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
supporting unit tests in consumer and mock class for IBus
- Loading branch information
Showing
2 changed files
with
54 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package mock | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/thumperq/thumperq/internal/connection" | ||
"github.com/thumperq/thumperq/internal/publishers" | ||
thumperq "github.com/thumperq/thumperq/pkg" | ||
"github.com/thumperq/thumperq/pkg/config" | ||
"github.com/thumperq/thumperq/pkg/handler" | ||
) | ||
|
||
type busMoq struct { | ||
connection connection.IConnection | ||
cfg config.IConfig | ||
publisher publishers.IBusPublisher | ||
} | ||
|
||
func NewBusMoq(cfg config.IConfig) thumperq.IBus { | ||
return &busMoq{ | ||
connection: nil, | ||
cfg: cfg, | ||
publisher: nil, | ||
} | ||
} | ||
|
||
func (b *busMoq) Publish(ctx context.Context, message handler.IMessage) error { | ||
return nil | ||
} | ||
|
||
func (b *busMoq) Connection() connection.IConnection { | ||
return b.connection | ||
} | ||
|
||
func (b *busMoq) Config() config.IConfig { | ||
return b.cfg | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters