(t *testing.T)
| 183 | } |
| 184 | |
| 185 | func TestHasAllowMissingEnabled(t *testing.T) { |
| 186 | tests := []struct { |
| 187 | name string |
| 188 | request any |
| 189 | want bool |
| 190 | }{ |
| 191 | { |
| 192 | name: "AllowMissing true", |
| 193 | request: &v1pb.UpdateRoleRequest{ |
| 194 | AllowMissing: true, |
| 195 | }, |
| 196 | want: true, |
| 197 | }, |
| 198 | { |
| 199 | name: "AllowMissing false", |
| 200 | request: &v1pb.UpdateRoleRequest{ |
| 201 | AllowMissing: false, |
| 202 | }, |
| 203 | want: false, |
| 204 | }, |
| 205 | { |
| 206 | name: "No AllowMissing field", |
| 207 | request: &v1pb.GetRoleRequest{ |
| 208 | Name: "roles/test", |
| 209 | }, |
| 210 | want: false, |
| 211 | }, |
| 212 | { |
| 213 | name: "Nil request", |
| 214 | request: nil, |
| 215 | want: false, |
| 216 | }, |
| 217 | { |
| 218 | name: "UpdateGroupRequest with AllowMissing true", |
| 219 | request: &v1pb.UpdateGroupRequest{ |
| 220 | AllowMissing: true, |
| 221 | }, |
| 222 | want: true, |
| 223 | }, |
| 224 | { |
| 225 | name: "UpdateReviewConfigRequest with AllowMissing true", |
| 226 | request: &v1pb.UpdateReviewConfigRequest{ |
| 227 | AllowMissing: true, |
| 228 | }, |
| 229 | want: true, |
| 230 | }, |
| 231 | { |
| 232 | name: "UpdateIdentityProviderRequest with AllowMissing false", |
| 233 | request: &v1pb.UpdateIdentityProviderRequest{ |
| 234 | AllowMissing: false, |
| 235 | }, |
| 236 | want: false, |
| 237 | }, |
| 238 | } |
| 239 | |
| 240 | for _, tt := range tests { |
| 241 | t.Run(tt.name, func(t *testing.T) { |
| 242 | got := hasAllowMissingEnabled(tt.request) |
nothing calls this directly
no test coverage detected