Karm / mandrel-integration-tests

Integration tests for GraalVM and its Mandrel distribution. Runs Quarkus, Helidon and Micronaut applications and small targeted reproducers. The focus is solely on native-image utility and compilation of Java applications into native executables.
Apache License 2.0
5 stars 3 forks source link

Resteasy client not closed, container tests #255

Closed Karm closed 2 months ago

Karm commented 2 months ago
Karm commented 2 months ago

@jerboaa It's green. Not thanks toexit 0; :-D , but due to the fix working.

Old Quarkus needs:

        Client c = null;
        Response r = null;
        try {
            c = ClientBuilder.newClient();
            r = c.target("http://localhost:" + port + "/data/protected")
                    .request().header("authorization", "Bearer " + generateJWT(key))
                    .buildGet().invoke();
            return String.format("Claim value within JWT of 'custom-value' : %s", r.readEntity(String.class));
        } finally {
            if (c != null) {
                c.close();
            }
            if (r != null) {
                r.close();
            }
        }

New Quarkus is fine with:

        try (final Response response = ClientBuilder.newClient()
                .target("http://localhost:" + port + "/protected")
                .request().header("authorization", "Bearer " + generateJWT(key))
                .buildGet().invoke()) {
            return String.format("Claim value within JWT of 'custom-value' : %s", response.readEntity(String.class));
        }