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

Introduce the ability to mock @Singleton beans #16574

Merged
merged 1 commit into from Apr 20, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Apr 16, 2021

This is done by giving users the ability to configure
whether or not Quarkus can change the scope of the bean,
so Quarkus can then change the scope from @Singleton to
@ApplicationScoped

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 16, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building e46b0b7

Status Name Step Test failures Logs Raw logs
Devtools Tests - JDK 11 Windows Extract Maven Repo ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Windows Extract Maven Repo ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Reclaim Disk Space ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Windows Extract Maven Repo ⚠️ Check → Logs Raw logs
JVM Tests - JDK 15 Build ⚠️ Check → Logs Raw logs
Maven Tests - JDK 11 Windows Extract Maven Repo ⚠️ Check → Logs Raw logs
MicroProfile TCKs Tests Run RESTEasy Reactive TCK ⚠️ Check → Logs Raw logs
Native Tests - Amazon ⚠️ Check → Logs Raw logs
Native Tests - Cache ⚠️ Check → Logs Raw logs
Native Tests - Data2 Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - Data3 Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - Data4 Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - Data5 Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - Data6 Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - HTTP ⚠️ Check → Logs Raw logs
Native Tests - Main Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - Messaging1 ⚠️ Check → Logs Raw logs
Native Tests - Messaging2 ⚠️ Check → Logs Raw logs
Native Tests - Misc1 ⚠️ Check → Logs Raw logs
Native Tests - Misc2 ⚠️ Check → Logs Raw logs
Native Tests - Misc3 ⚠️ Check → Logs Raw logs
Native Tests - Misc4 ⚠️ Check → Logs Raw logs
Native Tests - Security1 Reclaim Disk Space ⚠️ Check → Logs Raw logs
Native Tests - Security2 ⚠️ Check → Logs Raw logs
Native Tests - Security3 ⚠️ Check → Logs Raw logs
Native Tests - Spring ⚠️ Check → Logs Raw logs
Native Tests - Windows - hibernate-validator Setup GraalVM ⚠️ Check → Logs Raw logs
Native Tests - gRPC ⚠️ Check → Logs Raw logs

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 16, 2021

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building b12adf3

Status Name Step Test failures Logs Raw logs
Initial JDK 11 Build Build ⚠️ Check → Logs Raw logs
🚫 Devtools Tests - JDK ${{ matrix.java.name }}
🚫 Devtools Tests - JDK 11 Windows
🚫 Gradle Tests - JDK 11 ${{ matrix.os.family }}
🚫 JVM Tests - JDK ${{ matrix.java.name }}
🚫 JVM Tests - JDK 11 Windows
🚫 Maven Tests - JDK ${{ matrix.java.name }}
🚫 Maven Tests - JDK 11 Windows
🚫 MicroProfile TCKs Tests
🚫 Native Tests - ${{ matrix.category }}
🚫 Native Tests - Windows - ${{ matrix.category }}

@geoand geoand requested a review from mkouba April 16, 2021 10:25
@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

@mkouba WDYT about this?

Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's an opt-in feature I think it's OK, if we document it well...

This is done by giving users the ability to configure
whether or not Quarkus can change the scope of the bean,
so Quarkus can then change the scope from @singleton to
@ApplicationScoped
@geoand
Copy link
Contributor Author

geoand commented Apr 19, 2021

@mkouba I applied your suggestions

Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@geoand geoand merged commit 4856fc1 into quarkusio:main Apr 20, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 20, 2021
@geoand geoand deleted the allow-mocking-singletons branch April 20, 2021 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants