(t *testing.T)
| 657 | } |
| 658 | |
| 659 | func 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 |
nothing calls this directly
no test coverage detected