Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some logging to ProviderConfigInjectionWarningsTest #31473

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@
import io.smallrye.config.WithDefault;

public class ProviderConfigInjectionWarningsTest {

@RegisterExtension
static final QuarkusUnitTest TEST = new QuarkusUnitTest()
.setLogRecordPredicate(record -> record.getLevel().intValue() >= Level.WARNING.intValue())
.assertLogRecords(logRecords -> {
assertEquals(4, logRecords.size());
Set<String> messages = logRecords.stream().map(LogRecord::getMessage).collect(Collectors.toSet());

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

assertEquals(4, logRecords.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