143 lines
3.9 KiB
Go
143 lines
3.9 KiB
Go
package channel
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/gochat/gochat/internal/model"
|
|
)
|
|
|
|
func TestContactResolutionStage_Name_Cov4(t *testing.T) {
|
|
s := &ContactResolutionStage{}
|
|
if s.Name() != "contact_resolution" {
|
|
t.Errorf("expected contact_resolution, got %s", s.Name())
|
|
}
|
|
}
|
|
|
|
func TestContactResolutionStage_Process_Nil_Cov4(t *testing.T) {
|
|
s := &ContactResolutionStage{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Process(context.Background(), &PipelineContext{})
|
|
}
|
|
|
|
func TestContactResolutionStage_Process_WithMsg_Cov4(t *testing.T) {
|
|
s := &ContactResolutionStage{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Process(context.Background(), &PipelineContext{
|
|
IncomingMessage: &IncomingMessage{},
|
|
Inbox: &model.Inbox{},
|
|
})
|
|
}
|
|
|
|
func TestConversationResolutionStage_Name_Cov4(t *testing.T) {
|
|
s := &ConversationResolutionStage{}
|
|
if s.Name() != "conversation_resolution" {
|
|
t.Errorf("expected conversation_resolution, got %s", s.Name())
|
|
}
|
|
}
|
|
|
|
func TestConversationResolutionStage_Process_Nil_Cov4(t *testing.T) {
|
|
s := &ConversationResolutionStage{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Process(context.Background(), &PipelineContext{})
|
|
}
|
|
|
|
func TestMessagePersistenceStage_Name_Cov4(t *testing.T) {
|
|
s := &MessagePersistenceStage{}
|
|
_ = s.Name()
|
|
}
|
|
|
|
func TestMessagePersistenceStage_Process_Nil_Cov4(t *testing.T) {
|
|
s := &MessagePersistenceStage{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Process(context.Background(), &PipelineContext{})
|
|
}
|
|
|
|
func TestEventDispatchStage_Name_Cov4(t *testing.T) {
|
|
s := &EventDispatchStage{}
|
|
_ = s.Name()
|
|
}
|
|
|
|
func TestEventDispatchStage_Process_Nil_Cov4(t *testing.T) {
|
|
s := &EventDispatchStage{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Process(context.Background(), &PipelineContext{})
|
|
}
|
|
|
|
func TestConfigResolutionStage_Name_Cov4(t *testing.T) {
|
|
s := &ConfigResolutionStage{}
|
|
_ = s.Name()
|
|
}
|
|
|
|
func TestConfigResolutionStage_Process_Nil_Cov4(t *testing.T) {
|
|
s := &ConfigResolutionStage{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Process(context.Background(), &OutgoingPipelineContext{})
|
|
}
|
|
|
|
func TestUpdateMessageStage_Name_Cov4(t *testing.T) {
|
|
s := &UpdateMessageStage{}
|
|
_ = s.Name()
|
|
}
|
|
|
|
func TestUpdateMessageStage_Process_Nil_Cov4(t *testing.T) {
|
|
s := &UpdateMessageStage{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Process(context.Background(), &OutgoingPipelineContext{})
|
|
}
|
|
|
|
func TestIncomingMessageProcessor_Process_Nil_Cov4(t *testing.T) {
|
|
p := &IncomingMessageProcessor{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = p.Process(context.Background(), &PipelineContext{})
|
|
}
|
|
|
|
func TestOutgoingMessageProcessor_Process_Nil_Cov4(t *testing.T) {
|
|
p := &OutgoingMessageProcessor{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = p.Process(context.Background(), &OutgoingPipelineContext{})
|
|
}
|
|
|
|
func TestMessageBroker_HandleIncoming_Nil_Cov4(t *testing.T) {
|
|
b := &MessageBroker{}
|
|
defer func() { _ = recover() }()
|
|
_ = b.HandleIncoming(context.Background(), nil, nil)
|
|
}
|
|
|
|
func TestMessageBroker_HandleOutgoing_Nil_Cov4(t *testing.T) {
|
|
b := &MessageBroker{}
|
|
defer func() { _ = recover() }()
|
|
_ = b.HandleOutgoing(context.Background(), nil, nil, nil)
|
|
}
|
|
|
|
func TestLifecycleManager_ConnectInbox_Nil_Cov4(t *testing.T) {
|
|
lm := &LifecycleManager{}
|
|
defer func() { _ = recover() }()
|
|
_ = lm.ConnectInbox(context.Background(), nil)
|
|
}
|
|
|
|
func TestLifecycleManager_DisconnectInbox_Nil_Cov4(t *testing.T) {
|
|
lm := &LifecycleManager{}
|
|
defer func() { _ = recover() }()
|
|
_ = lm.DisconnectInbox(context.Background(), nil)
|
|
}
|
|
|
|
func TestLifecycleManager_ReconnectInbox_Nil_Cov4(t *testing.T) {
|
|
lm := &LifecycleManager{}
|
|
defer func() { _ = recover() }()
|
|
_ = lm.ReconnectInbox(context.Background(), nil)
|
|
}
|
|
|
|
func TestLifecycleManager_RefreshOAuth_Nil_Cov4(t *testing.T) {
|
|
lm := &LifecycleManager{}
|
|
defer func() { _ = recover() }()
|
|
_ = lm.RefreshOAuth(context.Background(), nil)
|
|
}
|
|
|
|
func TestWebhookHandler_HandleWebhook_Nil_Cov4(t *testing.T) {
|
|
h := &WebhookHandler{}
|
|
defer func() { _ = recover() }()
|
|
// Can't easily test gin handler without gin context
|
|
_ = h
|
|
}
|