Skip to content

Commit

Permalink
Filter out RESTEasy related warning in ProviderConfigInjectionWarning…
Browse files Browse the repository at this point in the history
…sTest

We sometimes have RESTEasy complaining about an Apache HTTP Client not
being closed.
  • Loading branch information
gsmet committed Mar 2, 2023
1 parent 0b8cb81 commit ea36149
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class ProviderConfigInjectionWarningsTest {
static final QuarkusUnitTest TEST = new QuarkusUnitTest()
.setLogRecordPredicate(record -> record.getLevel().intValue() >= Level.WARNING.intValue())
.assertLogRecords(logRecords -> {
Set<String> messages = logRecords.stream().map(LogRecord::getMessage).collect(Collectors.toSet());
Set<String> messages = logRecords.stream()
.map(LogRecord::getMessage)
// filter out noise coming from RESTEasy
.filter(m -> !m.contains("RESTEASY004687"))
.collect(Collectors.toSet());

for (String message : messages) {
System.out.println("Message from ProviderConfigInjectionWarningsTest: " + message);
}

assertEquals(4, logRecords.size());
assertEquals(4, messages.size());
assertTrue(messages.contains(
"Directly injecting a org.eclipse.microprofile.config.Config into a jakarta.ws.rs.ext.Provider may lead to unexpected results. To ensure proper results, please change the type of the field to jakarta.enterprise.inject.Instance<org.eclipse.microprofile.config.Config>. Offending field is 'config' of class 'io.quarkus.resteasy.test.config.ProviderConfigInjectionWarningsTest$FooProvider'"));
assertTrue(messages.contains(
Expand Down

0 comments on commit ea36149

Please sign in to comment.