(t *testing.T)
| 733 | } |
| 734 | |
| 735 | func TestInstance_checkVersion(t *testing.T) { |
| 736 | tests := []struct { |
| 737 | name string |
| 738 | instance *Instance |
| 739 | stub *Stub |
| 740 | want *Version |
| 741 | }{ |
| 742 | { |
| 743 | name: "empty kind", |
| 744 | instance: &Instance{ |
| 745 | DeprecatedVersions: []Version{ |
| 746 | {Kind: "", Name: "cert-manager.k8s.io", Component: "cert-manager"}, |
| 747 | }, |
| 748 | }, |
| 749 | stub: &Stub{ |
| 750 | Kind: "any", |
| 751 | APIVersion: "cert-manager.k8s.io", |
| 752 | Metadata: StubMeta{ |
| 753 | Name: "foo", |
| 754 | Namespace: "foobar", |
| 755 | }, |
| 756 | }, |
| 757 | want: &Version{ |
| 758 | Name: "cert-manager.k8s.io", |
| 759 | Kind: "any", |
| 760 | Component: "cert-manager", |
| 761 | }, |
| 762 | }, |
| 763 | } |
| 764 | for _, tt := range tests { |
| 765 | t.Run(tt.name, func(t *testing.T) { |
| 766 | got := tt.instance.checkVersion(tt.stub) |
| 767 | assert.EqualValues(t, tt.want, got) |
| 768 | }) |
| 769 | } |
| 770 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…