spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Wrote WebClientHttpRoutingFilterTests. Relates to GH-73

Open NadChel opened this issue 10 months ago • 4 comments

I ran a coverage tool and noticed that one of the key GlobalFilers, WebClientHttpRoutingFilter, has a coverage of zero (at least, excluding integration tests). I bumped it up to 100%

Also wrote a missing Javadoc

Important note. I want you to delay the merge until we figure out how to assert on ClientResponse's body. The last test, filter_ifNotRouted_ifSchemeHttps_receivedResponseStoredAsAttribute(), was supposed to have this assertion as well

    StepVerifier.create(storedClientResponse.bodyToMono(String.class))
        .expectNext(responseBody)
        .verifyComplete();

However, the body mono completes immediately so the assertion fails. I tried to pinpoint it on my own for a while, but then remembered that I no longer work on some pet project of mine and can continue solving that puzzle together with the Spring Cloud community. Maybe, it's not a puzzle at all

NadChel avatar Apr 02 '24 20:04 NadChel

Yeah, there's a reason it's not tested. I'm likely going to deprecate it for removal.

spencergibb avatar Apr 10 '24 23:04 spencergibb

Do you mean deprecating WebClientHttpRoutingFilter or ClientResponse?

NadChel avatar Apr 11 '24 02:04 NadChel

WebClientHttpRoutingFilter

spencergibb avatar Apr 11 '24 02:04 spencergibb

Well, but shouldn't it be covered while it's still part of the framework?

NadChel avatar Apr 11 '24 02:04 NadChel