(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func cacheControlHeader(t *testing.T) { |
| 97 | query := &GraphQLParams{ |
| 98 | Query: `query @cacheControl(maxAge: 5) { |
| 99 | queryCountry { |
| 100 | name |
| 101 | } |
| 102 | }`, |
| 103 | } |
| 104 | req, err := query.CreateGQLPost(GraphqlURL) |
| 105 | require.NoError(t, err) |
| 106 | |
| 107 | client := http.Client{Timeout: 10 * time.Second} |
| 108 | resp, err := client.Do(req) |
| 109 | require.NoError(t, err) |
| 110 | defer func() { require.NoError(t, resp.Body.Close()) }() |
| 111 | |
| 112 | // confirm that the header value is a non-negative integer |
| 113 | require.Equal(t, "public,max-age=5", resp.Header.Get("Cache-Control")) |
| 114 | require.Equal(t, "Accept-Encoding", resp.Header.Get("Vary")) |
| 115 | } |
| 116 | |
| 117 | // This test checks that all the different combinations of |
| 118 | // request sending compressed / uncompressed query and receiving |
nothing calls this directly
no test coverage detected