(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestExampleInterceptorsFiles(t *testing.T) { |
| 18 | cases := []struct { |
| 19 | Name string |
| 20 | DSL func() |
| 21 | ExpectedFiles []string |
| 22 | }{ |
| 23 | { |
| 24 | Name: "no-interceptors", |
| 25 | DSL: testdata.NoInterceptorExampleDSL, |
| 26 | }, |
| 27 | { |
| 28 | Name: "server-interceptor", |
| 29 | DSL: testdata.ServerInterceptorExampleDSL, |
| 30 | ExpectedFiles: []string{ |
| 31 | filepath.Join("interceptors", "server_interceptor_service_server.go"), |
| 32 | }, |
| 33 | }, |
| 34 | { |
| 35 | Name: "client-interceptor", |
| 36 | DSL: testdata.ClientInterceptorExampleDSL, |
| 37 | ExpectedFiles: []string{ |
| 38 | filepath.Join("interceptors", "client_interceptor_service_client.go"), |
| 39 | }, |
| 40 | }, |
| 41 | { |
| 42 | Name: "server-interceptor-by-name", |
| 43 | DSL: testdata.ServerInterceptorByNameExampleDSL, |
| 44 | ExpectedFiles: []string{ |
| 45 | filepath.Join("interceptors", "server_interceptor_by_name_service_server.go"), |
| 46 | }, |
| 47 | }, |
| 48 | { |
| 49 | Name: "multiple-interceptors", |
| 50 | DSL: testdata.MultipleInterceptorsExampleDSL, |
| 51 | ExpectedFiles: []string{ |
| 52 | filepath.Join("interceptors", "multiple_interceptors_service_server.go"), |
| 53 | filepath.Join("interceptors", "multiple_interceptors_service_client.go"), |
| 54 | }, |
| 55 | }, |
| 56 | { |
| 57 | Name: "multiple-services", |
| 58 | DSL: testdata.MultipleServicesInterceptorsExampleDSL, |
| 59 | ExpectedFiles: []string{ |
| 60 | filepath.Join("interceptors", "multiple_services_interceptors_service_server.go"), |
| 61 | filepath.Join("interceptors", "multiple_services_interceptors_service_client.go"), |
| 62 | filepath.Join("interceptors", "multiple_services_interceptors_service2_server.go"), |
| 63 | filepath.Join("interceptors", "multiple_services_interceptors_service2_client.go"), |
| 64 | }, |
| 65 | }, |
| 66 | { |
| 67 | Name: "api-interceptors", |
| 68 | DSL: testdata.APIInterceptorExampleDSL, |
| 69 | ExpectedFiles: []string{ |
| 70 | filepath.Join("interceptors", "api_interceptor_service_server.go"), |
| 71 | filepath.Join("interceptors", "api_interceptor_service_client.go"), |
| 72 | }, |
| 73 | }, |
| 74 | { |
nothing calls this directly
no test coverage detected