MCPcopy
hub / github.com/nats-io/nats.go / TestGroups

Function TestGroups

micro/test/service_test.go:659–762  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

657}
658
659func TestGroups(t *testing.T) {
660 tests := []struct {
661 name string
662 endpointName string
663 groups []string
664 expectedEndpoint micro.EndpointInfo
665 }{
666 {
667 name: "no groups",
668 endpointName: "foo",
669 expectedEndpoint: micro.EndpointInfo{
670 Name: "foo",
671 Subject: "foo",
672 QueueGroup: "q",
673 },
674 },
675 {
676 name: "single group",
677 endpointName: "foo",
678 groups: []string{"g1"},
679 expectedEndpoint: micro.EndpointInfo{
680 Name: "foo",
681 Subject: "g1.foo",
682 QueueGroup: "q",
683 },
684 },
685 {
686 name: "single empty group",
687 endpointName: "foo",
688 groups: []string{""},
689 expectedEndpoint: micro.EndpointInfo{
690 Name: "foo",
691 Subject: "foo",
692 QueueGroup: "q",
693 },
694 },
695 {
696 name: "empty groups",
697 endpointName: "foo",
698 groups: []string{"", "g1", ""},
699 expectedEndpoint: micro.EndpointInfo{
700 Name: "foo",
701 Subject: "g1.foo",
702 QueueGroup: "q",
703 },
704 },
705 {
706 name: "multiple groups",
707 endpointName: "foo",
708 groups: []string{"g1", "g2", "g3"},
709 expectedEndpoint: micro.EndpointInfo{
710 Name: "foo",
711 Subject: "g1.g2.g3.foo",
712 QueueGroup: "q",
713 },
714 },
715 }
716

Callers

nothing calls this directly

Calls 10

AddServiceFunction · 0.92
HandlerFuncFuncType · 0.92
ConnectMethod · 0.80
FatalfMethod · 0.80
RunServerOnPortFunction · 0.70
StopMethod · 0.65
AddGroupMethod · 0.65
AddEndpointMethod · 0.65
InfoMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected