-
Notifications
You must be signed in to change notification settings - Fork 5.1k
CAMEL-21196: modernize exception-based assertions in components #21010
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
CAMEL-21196: modernize exception-based assertions in components #21010
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
0a04939 to
b0bc349
Compare
|
This is way too big. I will break it in smaller pieces. |
97fa7b8 to
313d38a
Compare
Convert try-catch-fail pattern to JUnit 5 assertThrows() in AvroMarshalAndUnmarshalTest.
Replace JUnit 3 style fail() call with modern JUnit 5 assertTrue()
assertion with error message in ExecJava8IssueTest.
Changes:
- Updated import from Assertions.fail to Assertions.assertTrue
- Converted fail("message") to assertTrue(condition, "message")
Convert try-catch-fail patterns to modern JUnit 5 assertThrows() in test files: - GroovyLanguageTest.java - GroovyExpressionTest.java - GroovyLogEipTest.java Updated imports to replace fail with assertThrows for better readability and modern testing patterns.
Replace try-catch-fail pattern with JUnit 5 assertThrows() in GraphqlComponentTest.checkThrowException() test method. Updated imports to use assertThrows instead of fail.
Convert try-catch-fail patterns to JUnit 5 assertThrows in CryptoDataFormatTest. Replaced legacy fail() with assertThrows() for cleaner and more idiomatic exception testing.
Replace all try-catch-fail patterns with modern JUnit 5 assertThrows() patterns in: - OriginalSimpleTest.java (49 fail() calls converted) - OriginalSimpleOperatorTest.java (12 fail() calls converted) Updated imports: removed fail, added assertThrows
…parsers Converted try-catch-fail patterns to JUnit 5 assertThrows in 6 test files: - UniVocityCsvDataFormatUnmarshalTest - UniVocityCsvDataFormatUnmarshalSpringTest - UniVocityFixedDataFormatUnmarshalTest - UniVocityFixedDataFormatUnmarshalSpringTest - UniVocityTsvDataFormatUnmarshalTest - UniVocityTsvDataFormatUnmarshalSpringTest Replaced fail() import with assertThrows and converted all try-catch blocks to lambda-based assertThrows calls.
Replace try-catch-fail pattern with assertDoesNotThrow and assertThrows for more idiomatic JUnit 5 exception testing in KinesisConsumerClosedShardWithFailTest. Also removed unused fail() import.
Replace try-catch-fail pattern with assertThrows in JpaProducerNoBodyTest.
Replace try-catch-fail patterns with assertThrows in: - JaxbDataFormatMustBeJAXBElementTest - CamelJaxbFallbackConverterTest - NonXmlCharFiltererTest
Replace try-catch-fail pattern with assertThrows in JdbcOptionsTest.
Replace try-catch-fail patterns with assertThrows in: - JMXEndpointTest (9 occurrences) - JMXRobustRemoteConnectionTest (1 occurrence) - JMXComponentTest (3 occurrences)
Replace try-catch-fail patterns with assertThrows in: - FhirJsonDataformatErrorHandlerTest - FhirXmlDataformatErrorHandlerTest - FhirJsonDataformatErrorHandlerSpringTest - FhirXmlDataformatErrorHandlerSpringTest
Replace try-catch-fail patterns with assertThrows in: - HttpClientRouteTest.java (2 occurrences) - MultiServletConsumerTest.java (2 occurrences) - ServletChoiceBeanTest.java (1 occurrence)
Replace try-catch-fail patterns with assertThrows in test classes to use modern JUnit 5 exception testing approach, improving code clarity and consistency.
Replace try-catch-fail patterns with assertThrows in: - ProtobufMarshalAndUnmarshalSpringTest.java (1 occurrence) - ProtobufMarshalAndUnmarshalTest.java (1 occurrence)
Replace try-catch-fail patterns with assertThrows in all test files. Modernizes exception handling assertions to use JUnit 5 best practices. Files changed: - SecurityProviderHttpHandlerTest.java - SecurityProviderNoAcceptanceTest.java - SecurityProviderRolesFromComponentTest.java - SecurityProviderTest.java - SecurityProviderWithoutProviderTest.java - RestUndertowMethodNotAllowedTest.java - RestUndertowHttpBindingModeXmlTest.java - UndertowSuspendResumeTest.java - UndertowError500Test.java - UndertowHandlersSpringTest.java - UndertowHttp2Test.java - UndertowPrefixMatchingTest.java - DefaultUndertowHttpBindingTest.java - UndertowConsumerUnregisterTest.java
Replace try-catch-fail patterns with assertThrows in test classes to use modern JUnit 5 exception testing approach, improving code clarity and consistency.
Replace try-catch-fail patterns with simple throws in Sjms2EndpointTest.java: - testDefaultExchangePattern - testInOnlyExchangePattern - testInOutExchangePattern
Replace try-catch-fail patterns with assertThrows in: - WorkdayCommonAPIProducerTest.java (2 occurrences) - WorkdayReportProducerTest.java (1 occurrence)
Replace try-catch-fail patterns with assertThrows where applicable and convert fail() calls to throw new AssertionError() in test classes to use modern JUnit 5 exception testing approach, improving code clarity and consistency.
Replace try-catch-fail patterns with assertThrows in: - SaxonXsltFeatureRouteTest.java (1 occurrence) - SaxonInvalidXsltFileTest.java (1 occurrence)
Replace try-catch-fail patterns with assertThrows in test classes to use modern JUnit 5 exception testing approach, improving code clarity and consistency.
…ttp-vertx Replace try-catch-fail patterns with JUnit 5 assertThrows for modernized exception testing.
Replace fail(e) pattern with throw new AssertionError for modernized exception handling.
313d38a to
0003152
Compare
|
Undertow failures are unrelated to this, so it's OK to merge. |
More assertion modernization in tests