MCPcopy Create free account
hub / github.com/goadesign/goa / TestExampleInterceptorsFiles

Function TestExampleInterceptorsFiles

codegen/service/example_interceptors_test.go:17–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func 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 {

Callers

nothing calls this directly

Calls 7

RunDSLFunction · 0.92
ExampleInterceptorsFilesFunction · 0.85
NewServicesDataFunction · 0.70
compareOrUpdateGoldenFunction · 0.70
StringMethod · 0.65
RunMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected