@@ -148,22 +148,22 @@ public void setUp() {
148148
149149 @ Test
150150 public void shouldCallTheChainIfThereIsNoClient () throws IOException , ServletException {
151- ControlFilter f = new ControlFilter (null , "aProjectId" , testTicker , testClock , null );
151+ ControlFilter f = new ControlFilter (null , "aProjectId" , testTicker , testClock , new MetadataTransport ( false ) );
152152 f .doFilter (request , response , chain );
153153 verify (chain ).doFilter (request , response );
154154 }
155155
156156 @ Test
157157 public void shouldNotUseTheClientWithoutAProjectId () throws IOException , ServletException {
158- ControlFilter f = new ControlFilter (client , null , testTicker , testClock , null );
158+ ControlFilter f = new ControlFilter (client , null , testTicker , testClock , new MetadataTransport ( false ) );
159159 f .doFilter (request , response , chain );
160160 verify (chain ).doFilter (request , response );
161161 verify (client , never ()).check (capturedCheck .capture ());
162162 }
163163
164164 @ Test
165165 public void shouldNotUseTheClientIfThereIsNoMethodInfo () throws IOException , ServletException {
166- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
166+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
167167 when (request .getAttribute (ConfigFilter .METHOD_INFO_ATTRIBUTE )).thenReturn (null );
168168 f .doFilter (request , response , chain );
169169 verify (chain ).doFilter (request , response );
@@ -177,7 +177,7 @@ public void shouldUseTheDefaultLocation() throws IOException, ServletException {
177177 mockRequestAndResponse ();
178178 when (client .check (any (CheckRequest .class ))).thenReturn (checkResponse );
179179
180- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
180+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
181181 f .doFilter (request , response , chain );
182182 verify (client , times (1 )).report (capturedReport .capture ());
183183 ReportRequest aReport = capturedReport .getValue ();
@@ -199,7 +199,7 @@ public void shouldSetBackendLatency() throws IOException, ServletException {
199199 mockRequestAndResponse ();
200200 when (client .check (any (CheckRequest .class ))).thenReturn (checkResponse );
201201
202- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
202+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
203203 f .doFilter (request , response , chain );
204204 verify (client , times (1 )).report (capturedReport .capture ());
205205 ReportRequest aReport = capturedReport .getValue ();
@@ -218,7 +218,7 @@ public void shouldSetBackendLatency() throws IOException, ServletException {
218218
219219 @ Test
220220 public void shouldUseTheClientIfConfiguredOk () throws IOException , ServletException {
221- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
221+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
222222 mockRequestAndResponse ();
223223 when (client .check (any (CheckRequest .class ))).thenReturn (checkResponse );
224224
@@ -250,7 +250,7 @@ public void shouldUseTheClientIfConfiguredOk() throws IOException, ServletExcept
250250 public void shouldSendTheDefaultApiKeyIfPresent () throws IOException , ServletException {
251251 String [] defaultKeyNames = {"key" , "api_key" };
252252 String testApiKey = "defaultApiKey" ;
253- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
253+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
254254 for (String defaultKeyName : defaultKeyNames ) {
255255 mockRequestAndResponse ();
256256 when (request .getParameter (defaultKeyName )).thenReturn (testApiKey );
@@ -292,7 +292,7 @@ public void shouldSendTheDefaultApiKeyIfPresent() throws IOException, ServletExc
292292 @ Test
293293 public void shouldSendAReportButNotInvokeTheChainIfTheCheckFails ()
294294 throws IOException , ServletException {
295- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
295+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
296296
297297 // Fail because the project got deleted
298298 CheckResponse deleted = CheckResponse
@@ -335,7 +335,7 @@ public void shouldSendAReportButNotInvokeTheChainIfTheCheckFails()
335335 public void shouldSendAReportButNotInvokeTheChainIfTheCheckFailsOnBadApiKey ()
336336 throws IOException , ServletException {
337337 String testApiKey = "defaultApiKey" ;
338- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
338+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
339339
340340 // Fail because the project got deleted
341341 CheckResponse deleted = CheckResponse
@@ -386,7 +386,7 @@ public void shouldSendAReportButNotInvokeTheChainIfTheCheckFailsOnBadApiKey()
386386 @ Test
387387 public void shouldSendAReportAndInvokeTheChainIfTheCheckErrors ()
388388 throws IOException , ServletException {
389- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
389+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
390390
391391 // Return null from check to indicate that transport fail occurred
392392 mockRequestAndResponse ();
@@ -419,15 +419,15 @@ public void shouldSendAReportAndInvokeTheChainIfTheCheckErrors()
419419
420420 @ Test
421421 public void shouldStopTheClientWhenDestroyed () throws IOException , ServletException {
422- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
422+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
423423 f .destroy ();
424424 verify (client , times (1 )).stop ();
425425 }
426426
427427 @ Test
428428 public void shouldSendAReportButNotInvokeTheChainWhenNeededApiKeyIsNotProvided ()
429429 throws IOException , ServletException {
430- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
430+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
431431
432432 // Fail because the api key is needed but no provided
433433 mockRequestAndResponse ();
@@ -462,7 +462,7 @@ public void shouldSendAReportButNotInvokeTheChainWhenNeededApiKeyIsNotProvided()
462462 public void shouldSucceedWhenANeededApiKeyIsPresent () throws IOException , ServletException {
463463 String [] defaultKeyNames = {"key" , "api_key" };
464464 String testApiKey = "defaultApiKey" ;
465- ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , null );
465+ ControlFilter f = new ControlFilter (client , TEST_PROJECT_ID , testTicker , testClock , new MetadataTransport ( false ) );
466466 info .setAllowUnregisteredCalls (false ); // the means that the API key is necessary
467467
468468 for (String defaultKeyName : defaultKeyNames ) {
0 commit comments