You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, testing exceptions during startup is unsupported.
Exceptions at startup can occur because of a runtime property
that is incompatiable with other runtime properties. For
example, having a password without a username.
If you use QuarkusUnitTest.assertException, you get AssertionFailedError: The build was expected to fail.
If you try to test the failure without QuarkusUnitTest.assertException,
you get TestInstantiationException: Failed to create test instance
with the runtime exception as the root cause.
This makes it impossible to test startup failures due to runtime config
properties, as there is nowhere to hook the exception assertion code.
Description
= Quarkus Extension test failure at startup
Currently Quarkus supports testing exceptions at
However, testing exceptions during startup is unsupported.
Exceptions at startup can occur because of a runtime property
that is incompatiable with other runtime properties. For
example, having a password without a username.
If you use
QuarkusUnitTest.assertException
, you getAssertionFailedError: The build was expected to fail
.If you try to test the failure without
QuarkusUnitTest.assertException
,you get
TestInstantiationException: Failed to create test instance
with the runtime exception as the root cause.
This makes it impossible to test startup failures due to runtime config
properties, as there is nowhere to hook the exception assertion code.
Reproducer: https://github.com/Christopher-Chianelli/issue-reproducer/tree/quarkus-unit-test-startup-exception
Implementation ideas
assertStartupException
to QuarkusUnitTestassertException
in QuarkusUnitTest to also test for startup exceptionsThe text was updated successfully, but these errors were encountered: