From 09f077b3623f927d4bff243c8cd037a443465308 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 1 Mar 2023 09:37:24 +0100 Subject: [PATCH] Filter out RESTEasy related warning in ProviderConfigInjectionWarningsTest We sometimes have RESTEasy complaining about an Apache HTTP Client not being closed. (cherry picked from commit ea361493010b5c9472027399dc0fce0eab1d3ffc) --- .../test/config/ProviderConfigInjectionWarningsTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/config/ProviderConfigInjectionWarningsTest.java b/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/config/ProviderConfigInjectionWarningsTest.java index 0eb3bdd0d6bd0..3a9cc5435455b 100644 --- a/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/config/ProviderConfigInjectionWarningsTest.java +++ b/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/config/ProviderConfigInjectionWarningsTest.java @@ -36,8 +36,13 @@ public class ProviderConfigInjectionWarningsTest { static final QuarkusUnitTest TEST = new QuarkusUnitTest() .setLogRecordPredicate(record -> record.getLevel().intValue() >= Level.WARNING.intValue()) .assertLogRecords(logRecords -> { - assertEquals(4, logRecords.size()); - Set messages = logRecords.stream().map(LogRecord::getMessage).collect(Collectors.toSet()); + Set messages = logRecords.stream() + .map(LogRecord::getMessage) + // filter out noise coming from RESTEasy + .filter(m -> !m.contains("RESTEASY004687")) + .collect(Collectors.toSet()); + + assertEquals(4, messages.size()); assertTrue(messages.contains( "Directly injecting a org.eclipse.microprofile.config.Config into a javax.ws.rs.ext.Provider may lead to unexpected results. To ensure proper results, please change the type of the field to javax.enterprise.inject.Instance. Offending field is 'config' of class 'io.quarkus.resteasy.test.config.ProviderConfigInjectionWarningsTest$FooProvider'")); assertTrue(messages.contains(