@@ -188,7 +188,6 @@ public void celEnvironment_timeField_supportedButNull() {
188188 MatchContext context = mock (MatchContext .class );
189189 GrpcCelEnvironment env = new GrpcCelEnvironment (context );
190190
191- // find() returns empty for null values
192191 Optional <Object > result = env .find ("request.time" );
193192 assertThat (result .isPresent ()).isFalse ();
194193
@@ -350,7 +349,6 @@ public void celEnvironment_resolvesRefererAndUserAgent() {
350349 metadata .put (Metadata .Key .of ("referer" , Metadata .ASCII_STRING_MARSHALLER ), "http://example.com" );
351350 metadata .put (Metadata .Key .of ("user-agent" , Metadata .ASCII_STRING_MARSHALLER ), "grpc-test" );
352351 when (context .getMetadata ()).thenReturn (metadata );
353-
354352 GrpcCelEnvironment env = new GrpcCelEnvironment (context );
355353
356354 assertThat (env .find ("request.referer" ).get ()).isEqualTo ("http://example.com" );
@@ -365,7 +363,6 @@ public void celEnvironment_joinsMultipleHeaderValues() {
365363 metadata .put (key , "v1" );
366364 metadata .put (key , "v2" );
367365 when (context .getMetadata ()).thenReturn (metadata );
368-
369366 GrpcCelEnvironment env = new GrpcCelEnvironment (context );
370367
371368 // Tests the String.join logic in getHeader
@@ -377,24 +374,17 @@ public void celEnvironment_find_invalidFormat() {
377374 MatchContext context = mock (MatchContext .class );
378375 GrpcCelEnvironment env = new GrpcCelEnvironment (context );
379376
380- // Name not starting with "request"
381377 assertThat (env .find ("other.path" ).isPresent ()).isFalse ();
382-
383- // Name with too many components (though Splitter limit is 2, the second part will be "a.b")
384- // getRequestField("a.b") will hit the default case and return null.
385378 assertThat (env .find ("request.a.b" ).isPresent ()).isFalse ();
386379 }
387380
388381 @ Test
389382 public void lazyRequestMap_additionalMethods () {
390383 MatchContext context = mock (MatchContext .class );
391384 GrpcCelEnvironment env = new GrpcCelEnvironment (context );
392- Map <String , Object > map = (Map <String , Object >) env .find ("request" ).get ();
385+ Map <?, ? > map = (Map <?, ? >) env .find ("request" ).get ();
393386
394387 assertThat (map .isEmpty ()).isFalse ();
395-
396- // Test getting a known key that returns null (e.g., time)
397- // This covers the 'if (val == null)' branch in LazyRequestMap.get
398388 assertThat (map .get ("time" )).isNull ();
399389 }
400390
0 commit comments