mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
add test for loading from registry for rest of processors
This commit is contained in:
27
internal/processor/test/nats-message-encode_test.go
Normal file
27
internal/processor/test/nats-message-encode_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package processor_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/jwetzell/showbridge-go/internal/config"
|
||||
"github.com/jwetzell/showbridge-go/internal/processor"
|
||||
)
|
||||
|
||||
func TestNATSMessageEncodeFromRegistry(t *testing.T) {
|
||||
registration, ok := processor.ProcessorRegistry["nats.message.encode"]
|
||||
if !ok {
|
||||
t.Fatalf("nats.message.encode processor not registered")
|
||||
}
|
||||
|
||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||
Type: "nats.message.encode",
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create nats.message.encode processor: %s", err)
|
||||
}
|
||||
|
||||
if processorInstance.Type() != "nats.message.encode" {
|
||||
t.Fatalf("nats.message.encode processor has wrong type: %s", processorInstance.Type())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user