You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/06/17 17:26:49 UTC
(camel) branch main updated (e685d9a8e12 -> 30bcf8b8455)
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
from e685d9a8e12 chore(deps): Bump curator-version from 5.6.0 to 5.7.0
new 8e44be33858 CAMEL-20838: avoid unnecessarily overriding the restricted methods
new 4fd8467b1e3 CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jpa)
new 2d41a8727b6 CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-jdbc)
new 086e4dea2aa CAMEL-20838: avoid usages of restricted methods (camel-http)
new 4ab3a53534e CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-ftp)
new 00751d016fe CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-mongodb)
new 7cd4d78ff4e CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-spring-ws)
new f55b836cd17 CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-aws-xray)
new f2431e1adc3 CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jcr)
new ddc3990c5cb CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-servlet)
new 4d116a10ff1 CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-itest)
new d220d8ed589 CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jms)
new 30bcf8b8455 CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-spring-jdbc)
The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../component/avro/AvroConsumerTestSupport.java | 6 +-
.../component/avro/AvroHttpSpringProducerTest.java | 5 +-
.../avro/AvroNettySpringConsumerTest.java | 11 +-
.../avro/AvroNettySpringProducerTest.java | 5 +-
.../component/avro/AvroProducerTestSupport.java | 6 +-
.../avro/AvroGenericMarshalAndUnmarshalTest.java | 5 +-
.../aws/xray/SpringAwsXRaySimpleRouteTest.java | 12 +-
.../component/aws2/ses/SesComponentSpringTest.java | 6 +-
.../operations/CosmosDbClientOperationsIT.java | 2 +-
.../operations/CosmosDbContainerOperationsIT.java | 2 +-
.../operations/CosmosDbDatabaseOperationsIT.java | 2 +-
.../eventhubs/integration/EventHubsConsumerIT.java | 2 +-
.../EventHubsProducerCustomClientIT.java | 2 +-
.../eventhubs/integration/EventHubsProducerIT.java | 2 +-
.../eventhubs/integration/EventProcessorIT.java | 2 +-
.../operations/EventHubsProducerOperationsIT.java | 2 +-
.../operations/integration/QueueOperationsIT.java | 2 +-
.../integration/QueueServiceOperationsIT.java | 2 +-
.../validator/BeanValidatorConfigurationTest.java | 6 +-
.../validator/ValidatorFactoryAutowireTest.java | 6 +-
.../validator/ValidatorFactoryRegistryTest.java | 6 +-
.../component/braintree/AddressGatewayIT.java | 4 +-
.../braintree/PaymentMethodGatewayIT.java | 4 +-
.../component/braintree/TransactionGatewayIT.java | 4 +-
...CaffeineAggregationRepositoryOperationTest.java | 5 +-
.../org/apache/camel/coap/CoAPTestSupport.java | 5 +-
.../cometd/CometdProducerConsumerTest.java | 6 +-
.../cometd/MultipCometdProducerConsumerTest.java | 5 +-
.../cometd/SslCometdProducerConsumerTest.java | 6 +-
...ontextParametersCometdProducerConsumerTest.java | 6 +-
...tParametersInUriCometdProducerConsumerTest.java | 5 +-
...ontextParametersCometdProducerConsumerTest.java | 6 +-
.../couchbase/CouchbaseComponentTest.java | 5 +-
.../camel/component/crypto/ECDSASignatureTest.java | 5 +-
.../camel/component/crypto/SignatureTest.java | 5 +-
.../CxfRsConsumerSimpleBindingImplTest.java | 10 +-
.../CxfRsConsumerSimpleBindingTest.java | 10 +-
.../cxf/converter/CxfPayloadConverterTest.java | 5 +-
.../cxf/jaxws/CxfCustomizedExceptionTest.java | 11 +-
.../jaxws/CxfMessageCustomizedExceptionTest.java | 6 +-
.../jaxws/CxfPayLoadCustomizedExceptionTest.java | 7 +-
.../CxfRsConsumerSimpleBindingImplTest.java | 10 +-
.../CxfRsConsumerSimpleBindingTest.java | 10 +-
.../cxf/AbstractCXFGreeterRouterTest.java | 6 +-
.../CxfConsumerPayloadFaultCauseEnabledTest.java | 5 +-
.../CxfGreeterPayLoadWithFeatureRouterTest.java | 10 +-
.../CxfPayloadConsumerNamespaceOnEnvelopeTest.java | 5 +-
.../CxfPayloadProducerNamespaceOnEnvelopeTest.java | 5 +-
.../cxf/CxfPayloadRouterContentLengthTest.java | 10 +-
.../cxf/CxfSpringCustomizedExceptionTest.java | 10 +-
.../camel/component/cxf/CxfSpringRouterTest.java | 10 +-
.../cxf/converter/PayLoadConvertToPOJOTest.java | 5 +-
.../cxf/spring/FileToCxfMessageDataFormatTest.java | 11 +-
.../cxf/transport/CamelTransportTestSupport.java | 10 +-
.../cxf/transport/CamelTransportTestSupport.java | 10 +-
.../FileDisruptorShutdownCompleteAllTasksTest.java | 5 +-
.../disruptor/vm/AbstractVmTestSupport.java | 10 +-
.../component/ehcache/EhcacheTestSupport.java | 4 +-
.../EhcacheAggregationRepositoryOperationTest.java | 5 +-
.../fhir/dataformat/FhirJsonDataFormatTest.java | 5 +-
.../FhirJsonDataformatErrorHandlerTest.java | 5 +-
.../fhir/dataformat/FhirXmlDataFormatTest.java | 5 +-
.../FhirXmlDataformatErrorHandlerTest.java | 5 +-
.../spring/FhirDataformatConfigSpringTest.java | 7 -
.../FhirDataformatDefaultConfigSpringTest.java | 7 -
.../spring/FhirJsonDataFormatSpringTest.java | 5 +-
.../FhirJsonDataformatErrorHandlerSpringTest.java | 5 +-
.../spring/FhirXmlDataFormatSpringTest.java | 5 +-
.../FhirXmlDataformatErrorHandlerSpringTest.java | 5 +-
.../file/watch/FileWatchComponentTestBase.java | 3 +-
.../camel/component/fop/FopComponentTest.java | 17 +-
.../freemarker/FreemarkerContentCacheTest.java | 6 +-
.../component/file/remote/FtpSoTimeoutTest.java | 10 +-
.../FromFileToFtpDefaultRootRenameStrategyIT.java | 3 +-
.../integration/FromFtpActivePortRangeIT.java | 3 +-
.../integration/FromFtpClientConfigRefIT.java | 3 +-
.../integration/FromFtpClientDataTimeoutIT.java | 3 +-
.../integration/FromFtpClientSoTimeout2IT.java | 3 +-
.../integration/FromFtpClientSoTimeoutIT.java | 3 +-
.../integration/FromFtpConsumerTemplateIT.java | 3 +-
.../FromFtpConsumerTemplateRollbackIT.java | 3 +-
.../remote/integration/FromFtpDeleteFileIT.java | 3 +-
.../FromFtpDoNotDeleteFileIfProcessFailsIT.java | 3 +-
.../integration/FromFtpKeepLastModifiedIT.java | 3 +-
.../FromFtpMoveFileAbsoluteFolderRecursiveIT.java | 3 +-
.../file/remote/integration/FromFtpMoveFileIT.java | 3 +-
.../integration/FromFtpMoveFilePostfixIT.java | 3 +-
.../integration/FromFtpMoveFilePrefixIT.java | 3 +-
.../integration/FromFtpMoveFileRecursiveIT.java | 3 +-
.../FromFtpMoveFileToHiddenFolderRecursiveIT.java | 3 +-
...mFtpNoEndpointPathRelativeMoveToAbsoluteIT.java | 3 +-
.../file/remote/integration/FromFtpNoopIT.java | 3 +-
.../integration/FromFtpNoopIdempotentFalseIT.java | 3 +-
.../remote/integration/FromFtpNotDownloadIT.java | 3 +-
.../remote/integration/FromFtpPassiveModeIT.java | 3 +-
.../remote/integration/FromFtpPollFileOnlyIT.java | 3 +-
.../remote/integration/FromFtpPreMoveDeleteIT.java | 3 +-
.../FromFtpPreMoveFileExpressionIT.java | 3 +-
.../integration/FromFtpPreMoveFilePostfixIT.java | 3 +-
.../integration/FromFtpPreMoveFilePrefixIT.java | 3 +-
.../remote/integration/FromFtpPreMoveNoopIT.java | 3 +-
.../remote/integration/FromFtpRecursiveNoopIT.java | 4 +-
.../FromFtpRecursiveNotStepwiseNoBasePathIT.java | 3 +-
.../remote/integration/FromFtpRegexPatternIT.java | 3 +-
.../FromFtpRemoteFileFilterDirectoryIT.java | 3 +-
.../integration/FromFtpRemoteFileFilterIT.java | 3 +-
.../FromFtpRemoteFileSortByExpressionIT.java | 3 +-
...mFtpRemoteFileSortByIgnoreCaseExpressionIT.java | 3 +-
.../FromFtpRemoteFileSortByNestedExpressionIT.java | 3 +-
.../integration/FromFtpRemoteFileSorterIT.java | 3 +-
.../FromFtpServerLanguageCodeAndTimeoutIT.java | 3 +-
.../integration/FromFtpServerLanguageCodeIT.java | 3 +-
...mpleNoEndpointPathRelativeMoveToAbsoluteIT.java | 3 +-
...mpleNoEndpointPathRelativeMoveToRelativeIT.java | 3 +-
.../FromFtpSimpleRelativeMoveToAbsoluteIT.java | 3 +-
.../FromFtpSimpleRelativeMoveToRelativeIT.java | 3 +-
.../FromFtpStartingDirAndFileNameClashIT.java | 3 +-
.../remote/integration/FromFtpToAsciiFileIT.java | 3 +-
.../FromFtpToAsciiFileNoBodyConversionIT.java | 3 +-
.../remote/integration/FromFtpToBinaryFileIT.java | 3 +-
.../remote/integration/FromFtpToBinaryFilesIT.java | 3 +-
.../FromFtpToFileNoFileNameHeaderIT.java | 3 +-
.../integration/FromFtpTwoSlashesIssueIT.java | 3 +-
.../FromQueueThenConsumeFtpToMockIT.java | 3 +-
.../file/remote/integration/FtpAnonymousIT.java | 3 +-
.../FtpBadLoginMockNoopConnectionLeakIT.java | 4 +-
.../integration/FtpConsumerAbsolutePathIT.java | 3 +-
.../integration/FtpConsumerAsyncStressIT.java | 3 +-
.../integration/FtpConsumerBodyAsStringIT.java | 3 +-
.../FtpConsumerDeleteNoWritePermissionIT.java | 3 +-
.../FtpConsumerDirectoriesNotMatchedIT.java | 3 +-
.../integration/FtpConsumerDisconnectIT.java | 4 +-
.../integration/FtpConsumerExcludeExtIT.java | 3 +-
.../integration/FtpConsumerExcludeNameIT.java | 3 +-
.../integration/FtpConsumerIPV6BodyAsStringIT.java | 3 +-
.../integration/FtpConsumerIncludeExtIT.java | 3 +-
.../integration/FtpConsumerIncludeNameIT.java | 3 +-
...ConsumerLocalWorkDirectoryAsAbsolutePathIT.java | 3 +-
.../FtpConsumerLocalWorkDirectoryDirectIT.java | 3 +-
.../FtpConsumerLocalWorkDirectoryIT.java | 3 +-
.../FtpConsumerMultipleDirectoriesIT.java | 3 +-
.../FtpConsumerNotEagerMaxMessagesPerPollIT.java | 3 +-
.../integration/FtpConsumerRelativeFileNameIT.java | 3 +-
.../integration/FtpConsumerResumeDownloadIT.java | 4 +-
.../integration/FtpConsumerSkipDotFilesIT.java | 3 +-
.../remote/integration/FtpConsumerTemplateIT.java | 3 +-
.../FtpConsumerTemplateUseListFalseIT.java | 3 +-
.../FtpConsumerUsingFTPClientConfigIT.java | 3 +-
.../integration/FtpConsumerWithCharsetIT.java | 3 +-
.../integration/FtpConsumerWithNoFileOptionIT.java | 3 +-
...FtpProducerAllowNullBodyFileAlreadyExistIT.java | 3 +-
.../integration/FtpProducerDisconnectIT.java | 4 +-
.../FtpProducerDisconnectOnBatchCompleteIT.java | 4 +-
.../integration/FtpProducerFileExistAppendIT.java | 5 +-
.../integration/FtpProducerFileExistFailIT.java | 5 +-
.../integration/FtpProducerFileExistIgnoreIT.java | 4 +-
.../FtpProducerFileExistOverrideIT.java | 3 +-
.../integration/FtpProducerFileWithCharsetIT.java | 3 +-
.../FtpProducerRootFileExistFailIT.java | 4 +-
.../integration/FtpShutdownCompleteAllTasksIT.java | 3 +-
.../FtpShutdownCompleteCurrentTaskOnlyIT.java | 3 +-
.../FtpSimpleConsumeStreamingStepwiseIT.java | 3 +-
.../SftpConsumerLocalWorkDirectoryIT.java | 3 +-
.../ToFtpTempFileTargetFileExistIT.java | 3 +-
.../sftp/integration/SftpFromSedaDeleteFileIT.java | 3 +-
.../apache/camel/component/git/GitTestSupport.java | 8 +-
.../component/google/drive/FileConverterIT.java | 3 +-
.../pubsublite/GooglePubsubLiteComponentTest.java | 9 +-
.../pubsublite/GooglePubsubLiteProducerTest.java | 5 +-
.../http/common/HttpHeaderFilterStrategyTest.java | 7 +-
.../http/common/cookie/CookieHandlerTest.java | 5 +-
.../http/CamelComponentVerifierExtensionTest.java | 20 +-
.../component/http/CamelComponentVerifierTest.java | 13 +-
.../camel/component/http/FollowRedirectTest.java | 6 +-
.../component/http/HttpAuthenticationTest.java | 11 +-
.../apache/camel/component/http/HttpBodyTest.java | 11 +-
.../http/HttpBodyWithOtherProtocolNameTest.java | 4 +-
.../component/http/HttpBridgeEndpointTest.java | 11 +-
.../camel/component/http/HttpCamelHeadersTest.java | 11 +-
.../camel/component/http/HttpCharsetTest.java | 11 +-
.../camel/component/http/HttpCompressionTest.java | 11 +-
.../camel/component/http/HttpConcurrentTest.java | 11 +-
.../component/http/HttpDefaultPortNumberTest.java | 11 +-
.../component/http/HttpDisableStreamCacheTest.java | 11 +-
.../HttpInvalidHttpClientConfigurationTest.java | 64 -----
.../camel/component/http/HttpMethodsTest.java | 11 +-
.../component/http/HttpNoCamelHeaderTest.java | 11 +-
.../http/HttpNoConnectionRedeliveryTest.java | 11 +-
.../camel/component/http/HttpNoConnectionTest.java | 11 +-
.../http/HttpOAuth2AuthenticationTest.java | 5 +-
.../apache/camel/component/http/HttpPathTest.java | 11 +-
.../component/http/HttpPollingConsumerTest.java | 11 +-
.../http/HttpProducerBridgeEndpointTest.java | 275 ++++++++++-----------
.../http/HttpProducerConnectionCloseTest.java | 11 +-
.../http/HttpProducerContentLengthTest.java | 11 +-
.../http/HttpProducerContentTypeTest.java | 11 +-
.../HttpProducerContentTypeWithCharsetTest.java | 15 +-
.../HttpProducerContentTypeWithSemiColonTest.java | 11 +-
.../http/HttpProducerCustomHeaderTest.java | 11 +-
.../HttpProducerExplicitConnectionCloseTest.java | 11 +-
.../component/http/HttpProducerLoadManualIT.java | 12 +-
.../component/http/HttpProducerNullBodyTest.java | 15 +-
.../component/http/HttpProducerRestartTest.java | 11 +-
.../http/HttpProducerSelectMethodTest.java | 11 +-
.../HttpProducerTwoHeadersWithSameKeyTest.java | 11 +-
.../HttpProducerTwoParametersWithSameKeyTest.java | 11 +-
.../component/http/HttpProducerUserAgentTest.java | 14 +-
.../component/http/HttpProxyAndBasicAuthTest.java | 11 +-
.../camel/component/http/HttpProxyServerTest.java | 11 +-
.../component/http/HttpQueryParameterTest.java | 11 +-
.../apache/camel/component/http/HttpQueryTest.java | 11 +-
.../camel/component/http/HttpRedirectTest.java | 11 +-
.../component/http/HttpReferenceParameterTest.java | 13 +-
.../camel/component/http/HttpSOTimeoutTest.java | 12 +-
.../http/HttpSendDynamicAwareBasicAuthTest.java | 11 +-
.../http/HttpSendDynamicAwareEmptyPathTest.java | 11 +-
.../http/HttpSendDynamicAwareHeadersTest.java | 11 +-
.../http/HttpSendDynamicAwareMultiValueTest.java | 12 +-
.../http/HttpSendDynamicAwarePathHeaderTest.java | 11 +-
.../http/HttpSendDynamicAwareRawParameterTest.java | 11 +-
.../http/HttpSendDynamicAwareRawTest.java | 11 +-
.../component/http/HttpSendDynamicAwareTest.java | 11 +-
.../HttpSendDynamicAwareUriWithSpacesTest.java | 11 +-
.../HttpSendDynamicAwareUriWithoutSlashTest.java | 11 +-
.../camel/component/http/HttpSetHeaderIdsTest.java | 12 +-
.../component/http/HttpSquareBracketTest.java | 11 +-
.../http/HttpThrowExceptionOnFailureTest.java | 12 +-
.../camel/component/http/HttpToDSOTimeoutTest.java | 11 +-
.../component/http/HttpWithHttpUriHeaderTest.java | 12 +-
.../component/http/HttpsAuthenticationTest.java | 11 +-
.../apache/camel/component/http/HttpsGetTest.java | 11 +-
.../HttpsProducerWithSystemPropertiesTest.java | 11 +-
.../component/http/HttpsServerTestSupport.java | 13 +-
.../http/HttpsSslContextParametersGetTest.java | 12 +-
...psTwoComponentsSslContextParametersGetTest.java | 12 +-
...tpsTwoDifferentSslContextParametersGetTest.java | 12 +-
.../http/ManagedHttpProducerPoolStatsTest.java | 12 +-
.../http/rest/RestCamelComponentVerifierTest.java | 19 +-
.../camel/component/ical/ICalDataFormatTest.java | 12 +-
.../JacksonNotUseDefaultObjectMapperTest.java | 5 +-
.../JaxbDataFormatSchemaValidationSpringTest.java | 5 +-
...ormatSchemaValidationWithObjectFactoryTest.java | 7 +-
.../org/apache/camel/example/DataFormatTest.java | 5 +-
.../idempotent/JCacheIdempotentRepositoryTest.java | 10 +-
.../camel/component/jcr/JcrAuthTestBase.java | 8 +-
.../camel/component/jcr/JcrGetNodeByIdTest.java | 7 +-
.../component/jcr/JcrNodePathCreationTest.java | 5 +-
.../jcr/JcrRouteDifferentWorkspaceTestSupport.java | 8 +-
.../camel/component/jcr/JcrRouteTestSupport.java | 5 +-
.../component/jdbc/AbstractJdbcTestSupport.java | 12 +-
.../jetty/HttpProducerJMXBeansIssueManualIT.java | 3 +-
.../jetty/HttpStreamCacheFileStopIssueTest.java | 5 +-
.../camel/component/jetty/HttpsAsyncRouteTest.java | 10 +-
.../jetty/HttpsRouteSetupWithSystemPropsTest.java | 6 +-
.../camel/component/jetty/HttpsRouteTest.java | 10 +-
.../camel/component/jetty/JettyEnableJmxTest.java | 15 +-
.../component/jetty/JettyWithXPathChoiceTest.java | 6 +-
.../camel/component/jetty/MainHttpsRouteTest.java | 10 +-
.../jetty/file/JettyHttpFileCacheTest.java | 6 +-
.../component/jgroups/JGroupsComponentTest.java | 5 +-
.../JGroupsComponentWithChannelPropertiesTest.java | 5 +-
.../component/jgroups/JGroupsConsumerTest.java | 5 +-
.../component/jgroups/JGroupsProducerTest.java | 5 +-
.../spring/tx/AbstractTransactionIT.java | 5 +-
.../tx/JMSTransactionThrottlingRoutePolicyIT.java | 4 +-
.../component/jpa/AbstractJpaMethodSupport.java | 3 +-
.../camel/processor/jpa/AbstractJpaTest.java | 8 +-
.../jpa/FileConsumerJpaIdempotentTest.java | 8 +-
.../processor/jpa/JpaIdempotentConsumerTest.java | 4 +-
.../jpa/JpaPollingConsumerLockEntityTest.java | 5 +-
.../jpa/JpaRouteSharedEntityManagerTest.java | 8 +-
.../jpa/JpaRouteSkipLockedEntityTest.java | 4 +-
.../camel/component/scp/ScpAlgorithmsTest.java | 8 -
.../camel/component/scp/ScpServerTestSupport.java | 9 +-
.../jsonvalidator/FileValidatorRouteTest.java | 9 +-
.../Jt400ComponentDefaultConnectionPoolTest.java | 9 +-
...00ComponentDefaultSecureConnectionPoolTest.java | 9 +-
.../camel/component/jt400/Jt400ComponentTest.java | 8 +-
.../jt400/Jt400ConfigurationConnectionTest.java | 11 +-
.../Jt400ConfigurationSecureConnectionTest.java | 11 +-
.../component/jt400/Jt400ConfigurationTest.java | 5 +-
.../jt400/Jt400DataQueueProducerTest.java | 5 +-
.../camel/component/jt400/Jt400EndpointTest.java | 5 +-
.../component/jt400/Jt400PgmEndpointTest.java | 5 +-
.../component/jt400/Jt400SecureTestSupport.java | 8 +-
.../component/jt400/Jt400SrvPgmEndpointTest.java | 5 +-
.../camel/component/jt400/Jt400TestSupport.java | 8 +-
.../kubernetes/KubernetesTestSupport.java | 3 +-
.../ConfigMapPropertiesFunctionRouteTest.java | 4 +-
.../SecretPropertiesFunctionRouteTest.java | 4 +-
.../camel/component/kudu/AbstractKuduTest.java | 15 +-
.../apache/camel/component/ldif/LdifRouteIT.java | 5 +-
...elDBAggregateConcurrentDifferentGroupsTest.java | 5 +-
.../LevelDBAggregateConcurrentSameGroupTest.java | 5 +-
.../LevelDBAggregateDiscardOnTimeoutTest.java | 5 +-
.../LevelDBAggregateForceCompletionHeaderTest.java | 5 +-
.../LevelDBAggregateLoadAndRecoverTest.java | 3 +-
.../LevelDBAggregateLoadConcurrentTest.java | 3 +-
.../leveldb/LevelDBAggregateLoadTest.java | 3 +-
...DBAggregateNotLostRemovedWhenConfirmedTest.java | 5 +-
.../leveldb/LevelDBAggregateNotLostTest.java | 5 +-
...ggregateRecoverDeadLetterChannelFailedTest.java | 6 +-
...velDBAggregateRecoverDeadLetterChannelTest.java | 6 +-
.../leveldb/LevelDBAggregateRecoverTest.java | 5 +-
...DBAggregateRecoverWithRedeliveryPolicyTest.java | 5 +-
.../LevelDBAggregateRecoverWithSedaTest.java | 6 +-
.../LevelDBAggregateSerializedHeadersTest.java | 3 +-
.../component/leveldb/LevelDBAggregateTest.java | 5 +-
...velDBAggregateTimeoutCompletionRestartTest.java | 5 +-
.../LevelDBAggregationRepositoryAlotDataTest.java | 10 +-
...velDBAggregationRepositoryLoadExistingTest.java | 10 +-
...velDBAggregationRepositoryMultipleRepoTest.java | 10 +-
...DBAggregationRepositoryRecoverExistingTest.java | 5 +-
.../leveldb/LevelDBAggregationRepositoryTest.java | 10 +-
.../leveldb/LevelDBBigPayloadManualTest.java | 3 +-
.../camel/component/leveldb/LevelDBBinaryTest.java | 5 +-
.../leveldb/LevelDBCustomSerializationTest.java | 5 +-
.../leveldb/LevelDBExchangeSerializationTest.java | 10 +-
.../component/leveldb/LevelDBGetNotFoundTest.java | 10 +-
.../camel/component/leveldb/LevelDBSetupTest.java | 8 +-
...ngAggregateRecoverWithRedeliveryPolicyTest.java | 6 +-
.../leveldb/LevelDBSpringAggregateTest.java | 6 +-
.../component/mail/MailAttachmentNamesTest.java | 14 +-
.../component/mail/MailBatchConsumerTest.java | 5 +-
.../component/mail/MailCommitOnCompletionTest.java | 5 +-
.../camel/component/mail/MailConvertersTest.java | 5 +-
.../camel/component/mail/MailCopyToTest.java | 5 +-
.../mail/MailDoNotDeleteIfProcessFailsTest.java | 5 +-
.../camel/component/mail/MailFetchSizeTest.java | 5 +-
.../component/mail/MailFetchSizeZeroTest.java | 5 +-
.../MailIdempotentRepositoryDuplicateTest.java | 5 +-
.../mail/MailIdempotentRepositoryTest.java | 5 +-
.../component/mail/MailMaxMessagesPerPollTest.java | 5 +-
.../camel/component/mail/MailMessageTest.java | 5 +-
.../camel/component/mail/MailMoveToTest.java | 5 +-
.../component/mail/MailPollEnrichNoMailTest.java | 5 +-
.../camel/component/mail/MailPollEnrichTest.java | 5 +-
.../component/mail/MailPostProcessActionTest.java | 5 +-
.../mail/MailProcessOnlyUnseenMessagesTest.java | 5 +-
.../camel/component/mail/MailSearchTermTest.java | 5 +-
.../MailSearchTermUriConfigLast24HoursTest.java | 5 +-
.../mail/MailSearchTermUriConfigTest.java | 5 +-
.../mail/MailShutdownCompleteAllTasksTest.java | 5 +-
.../MailShutdownCompleteCurrentTaskOnlyTest.java | 5 +-
.../camel/component/mail/MailSortTermTest.java | 5 +-
.../component/mail/MailSortTermThreeTest.java | 5 +-
.../camel/component/mail/MailSortTermTwoTest.java | 5 +-
.../component/mail/MailUsingCustomSessionTest.java | 5 +-
.../mail/MultipleDestinationConsumeTest.java | 6 +-
.../camel/component/mail/RawMailMessageTest.java | 5 +-
.../multipart/MimeMultipartDataFormatTest.java | 5 +-
.../camel/component/metrics/CounterRouteTest.java | 5 +-
.../component/metrics/HistogramRouteTest.java | 5 +-
.../camel/component/metrics/MeterRouteTest.java | 5 +-
.../camel/component/metrics/TimerRouteTest.java | 5 +-
.../component/micrometer/CounterRouteTest.java | 5 +-
.../camel/component/micrometer/TimerRouteTest.java | 5 +-
.../CamelMicroProfilePropertiesSourceTest.java | 5 +-
.../health/CamelMicroProfileHealthTestSupport.java | 5 +-
.../camel/component/mina/MinaFiltersTest.java | 5 +-
...tProducerEndOfDataAndValidationTestSupport.java | 4 +-
...rConsumerEndOfDataAndValidationTestSupport.java | 6 +-
.../integration/AbstractMongoDbITSupport.java | 4 +-
.../mybatis/MyBatisShutdownAllTasksTest.java | 6 +-
.../MyBatisShutdownCurrentTaskOnlyTest.java | 6 +-
.../component/mybatis/MyBatisTestSupport.java | 4 +-
.../NettyHttpBasicAuthConstraintMapperTest.java | 10 +-
.../netty/http/NettyHttpBasicAuthTest.java | 10 +-
.../component/netty/http/NettyHttpSSLTest.java | 11 +-
...ttyHttpSimpleBasicAuthConstraintMapperTest.java | 10 +-
.../netty/http/NettyHttpSimpleBasicAuthTest.java | 10 +-
.../http/NettyHttpStreamCacheFileResponseTest.java | 5 +-
.../netty/http/NettySharedHttpServerTest.java | 5 +-
.../camel/component/netty/NettyConverterTest.java | 4 +-
.../camel/component/netty/NettyRedeliveryTest.java | 5 +-
...ttyUseSharedWorkerThreadPoolManyRoutesTest.java | 10 +-
.../mqtt5/PahoMqtt5ReconnectAfterFailureIT.java | 5 +-
.../paho/mqtt5/PahoMqtt5SendDynamicAwareTest.java | 5 +-
.../apache/camel/component/pdf/PdfAppendTest.java | 7 -
.../camel/component/pdf/PdfCreationTest.java | 7 -
.../slot/integration/PgReplicationSlotCamelIT.java | 9 +-
.../camel/component/printer/PrinterPrintTest.java | 5 +-
.../component/pulsar/PulsarComponentTest.java | 5 +-
.../quartz/FromFileQuartzSchedulerTest.java | 5 +-
.../component/quartz/QuartzPropertiesTest.java | 5 +-
.../quickfixj/QuickfixjConvertersTest.java | 12 +-
.../rocketmq/RocketMQRequestReplyRouteIT.java | 8 +-
.../camel/component/rocketmq/RocketMQRouteIT.java | 8 -
.../camel/dataformat/rss/RssDataFormatTest.java | 5 +-
.../saxon/XPathSplitChoicePerformanceTest.java | 5 +-
.../camel/builder/saxon/XQueryFilterTest.java | 6 +-
.../builder/saxon/XQueryRecipientListTest.java | 6 +-
.../camel/builder/saxon/XQueryTransformTest.java | 6 +-
.../builder/saxon/XQueryTransformTextTest.java | 6 +-
.../saxon/XQueryWithNamespacesFilterTest.java | 6 +-
.../xquery/XQueryWithExplicitTypeTest.java | 6 +-
.../camel/converter/saxon/SaxonConverterTest.java | 5 +-
.../xpath/XPathLanguageDefaultSettingsTest.java | 5 +-
.../camel/language/xpath/XPathLanguageTest.java | 5 +-
.../servlet/HttpClientRouteExampleSpringTest.java | 9 +-
.../servlet/HttpClientRouteSpringTest.java | 8 +-
.../component/servlet/HttpClientRouteTest.java | 2 +-
.../servlet/ServletCamelRouterTestSupport.java | 19 +-
.../component/sjms/SjmsSendDynamicAwareTest.java | 6 +-
.../producer/InOutQueueProducerAsyncLoadTest.java | 10 +-
.../producer/InOutQueueProducerSyncLoadTest.java | 10 +-
.../sjms/support/JmsCommonTestSupport.java | 5 +-
.../component/sjms2/support/Jms2TestSupport.java | 4 +-
.../camel/component/slack/SlackConsumerTest.java | 5 +-
.../component/spring/batch/SpringBatchIT.java | 6 +-
.../spring/batch/SpringBatchJobLauncherIT.java | 4 +-
.../spring/jdbc/AbstractJdbcTestSupport.java | 12 +-
.../springldap/SpringLdapProducerTest.java | 5 +-
.../SpringRabbitMQSendDynamicAwareTest.java | 6 +-
.../spring/ws/ConsumerBreadcrumbIdTest.java | 5 +-
...ConsumerEndpointMappingByBeanNameRouteTest.java | 5 +-
...erEndpointMappingResponseHandlingRouteTest.java | 5 +-
.../ws/ConsumerEndpointMappingRouteTest.java | 5 +-
.../ws/ConsumerExceptionPropagationRouteTest.java | 4 +-
.../spring/ws/ConsumerMarshallingRouteTest.java | 5 +-
.../spring/ws/addressing/AbstractWSATests.java | 4 +-
.../ws/addressing/CamelDirectSenderTest.java | 4 +-
.../ConsumerWSAEndpointMappingRouteTest.java | 5 +-
.../ws/addressing/ProducerParamsBasicTest.java | 5 +-
.../addressing/ProducerParamsPrecedenceTest.java | 5 +-
.../ProducerWss4JSecurityHeaderManualTest.java | 4 +-
.../component/sql/CamelSqlEmptyResultTest.java | 11 +-
.../camel/component/sql/SqlAggregateBatchTest.java | 11 +-
.../sql/SqlConsumerDeleteBatchCompleteTest.java | 11 +-
.../component/sql/SqlConsumerDeleteFailedTest.java | 11 +-
.../camel/component/sql/SqlConsumerDeleteTest.java | 11 +-
.../sql/SqlConsumerDeleteTransformTest.java | 11 +-
.../sql/SqlConsumerDynamicParameterTest.java | 11 +-
.../sql/SqlConsumerMaxMessagesPerPollTest.java | 11 +-
.../sql/SqlConsumerOutputTypeSelectListTest.java | 11 +-
...lConsumerOutputTypeSelectListWithClassTest.java | 11 +-
.../sql/SqlConsumerOutputTypeStreamListTest.java | 11 +-
.../camel/component/sql/SqlConsumerTest.java | 11 +-
.../camel/component/sql/SqlDataSourceRefTest.java | 5 +-
.../camel/component/sql/SqlDataSourceTest.java | 5 +-
.../camel/component/sql/SqlEndpointLikeTest.java | 5 +-
.../sql/SqlEndpointMisconfigureDataSourceTest.java | 11 +-
.../camel/component/sql/SqlEndpointTest.java | 11 +-
.../component/sql/SqlGeneratedKeysInLoopTest.java | 10 +-
.../camel/component/sql/SqlGeneratedKeysTest.java | 10 +-
.../camel/component/sql/SqlPreserveHeaderTest.java | 11 +-
...qlProducerAlwaysPopulateStatementFalseTest.java | 11 +-
.../SqlProducerAlwaysPopulateStatementTest.java | 11 +-
.../camel/component/sql/SqlProducerAndInTest.java | 11 +-
.../component/sql/SqlProducerConcurrentTest.java | 11 +-
.../sql/SqlProducerExpressionParameterTest.java | 11 +-
.../component/sql/SqlProducerInMultiTest.java | 11 +-
.../camel/component/sql/SqlProducerInTest.java | 11 +-
.../component/sql/SqlProducerInVariablesTest.java | 11 +-
.../component/sql/SqlProducerInsertNullTest.java | 11 +-
.../camel/component/sql/SqlProducerJSONTest.java | 11 +-
.../sql/SqlProducerNamedParameterNotExistTest.java | 11 +-
.../sql/SqlProducerNamedParameterTest.java | 11 +-
.../sql/SqlProducerNamedParametersTest.java | 11 +-
.../camel/component/sql/SqlProducerNoopTest.java | 11 +-
.../sql/SqlProducerNullBodyHeaderTest.java | 11 +-
.../component/sql/SqlProducerNullBodyTest.java | 11 +-
.../component/sql/SqlProducerOutputHeaderTest.java | 11 +-
.../sql/SqlProducerOutputHeaderWithQueryTest.java | 11 +-
.../sql/SqlProducerOutputTypeSelectListTest.java | 11 +-
...lProducerOutputTypeSelectListWithClassTest.java | 11 +-
...SqlProducerOutputTypeSelectOneNoResultTest.java | 11 +-
.../sql/SqlProducerOutputTypeStreamListTest.java | 11 +-
.../sql/SqlProducerParametersCountTest.java | 11 +-
.../sql/SqlProducerReuseParameterTest.java | 11 +-
.../component/sql/SqlProducerSeparatorTest.java | 11 +-
.../camel/component/sql/SqlProducerToDTest.java | 11 +-
.../sql/SqlProducerUseMessageBodyForSqlTest.java | 11 +-
.../component/sql/SqlProducerWhereIssueTest.java | 11 +-
.../apache/camel/component/sql/SqlRouteTest.java | 11 +-
.../component/sql/SqlTransactedRouteTest.java | 11 +-
.../sql/stored/CallableStatementWrapperTest.java | 11 +-
.../sql/stored/ProducerBatchInvalidTest.java | 12 +-
.../component/sql/stored/ProducerBatchTest.java | 12 +-
.../sql/stored/ProducerBodyArrayTest.java | 12 +-
.../component/sql/stored/ProducerInOutTest.java | 12 +-
.../camel/component/sql/stored/ProducerTest.java | 12 +-
.../ProducerUseMessageBodyForTemplateTest.java | 12 +-
.../sql/stored/SqlFunctionDataSourceTest.java | 12 +-
.../sql/stored/SqlStoredDataSourceTest.java | 5 +-
.../component/sql/stored/TemplateCacheTest.java | 12 +-
.../CustomizedJdbcMessageIdRepositoryTest.java | 6 +-
.../jdbc/JdbcCachedMessageIdRepositoryTest.java | 6 +-
...JdbcMessageIdRepositoryCustomTableNameTest.java | 6 +-
.../jdbc/JdbcMessageIdRepositoryTest.java | 6 +-
.../component/ssh/SshComponentTestSupport.java | 13 +-
.../StAXXPathSplitChoicePerformanceManualTest.java | 5 +-
.../component/stream/ScanStreamDelayTest.java | 6 +-
.../component/stream/ScanStreamFileManualTest.java | 6 +-
.../camel/component/stream/ScanStreamFileTest.java | 6 +-
.../stream/ScanStreamFileWithFilterTest.java | 6 +-
.../component/stream/SplitStreamFileTest.java | 6 +-
.../camel/component/stream/StreamFileTest.java | 6 +-
.../component/stream/StreamGroupLinesTest.java | 6 +-
.../StringTemplateContentCacheTest.java | 6 +-
.../tarfile/SpringTarFileDataFormatTest.java | 5 +-
.../dataformat/tarfile/TarFileDataFormatTest.java | 5 +-
.../tarfile/TarFileSplitAndDeleteTest.java | 5 +-
.../tarfile/TarSplitterRouteIssueTest.java | 5 +-
.../AggregationStrategyWithFilenameHeaderTest.java | 5 +-
.../AggregationStrategyWithPreservationTest.java | 5 +-
.../TarAggregationStrategyEmptyFirstFileTest.java | 5 +-
.../tarfile/TarAggregationStrategyTest.java | 5 +-
.../thymeleaf/ThymeleafContentCacheTest.java | 7 +-
...ymeleafWebApplicationResolverAllParamsTest.java | 8 +-
.../ThymeleafWebApplicationResolverTest.java | 8 +-
.../component/twitter/DirectMessageDirectIT.java | 5 +-
.../component/twitter/DirectMessagePollingIT.java | 6 +-
.../velocity/VelocityContentCacheTest.java | 6 +-
.../component/web3j/Web3jMockTestSupport.java | 5 +-
.../component/xmlsecurity/ECDSASignatureTest.java | 11 +-
.../xmlsecurity/SignatureAlgorithmTest.java | 5 +-
.../xmlsecurity/SignatureDigestMethodTest.java | 5 +-
.../xmlsecurity/XAdESSignaturePropertiesTest.java | 5 +-
.../component/xmlsecurity/XmlSignatureTest.java | 5 +-
.../xmlsecurity/EncryptionAlgorithmTest.java | 5 +-
.../xmlsecurity/XMLEncryption11Test.java | 5 +-
.../xmlsecurity/XMLSecurityDataFormatTest.java | 5 +-
.../deflater/GzipDataFormatFileDeleteTest.java | 5 +-
.../GzipDataFormatFileUnmarshalDeleteTest.java | 5 +-
.../ZipDeflaterDataFormatFileDeleteTest.java | 5 +-
...pDeflaterDataFormatFileUnmarshalDeleteTest.java | 5 +-
.../dataformat/zipfile/ZipFileDataFormatTest.java | 5 +-
.../zipfile/ZipFileSplitAndDeleteTest.java | 5 +-
.../zipfile/ZipFileSplitOneFileTest.java | 5 +-
.../zipfile/ZipSplitterRouteIssueTest.java | 5 +-
.../AggregationStrategyWithFilenameHeaderTest.java | 5 +-
.../AggregationStrategyWithPreservationTest.java | 5 +-
.../ZipAggregationStrategyEmptyFileTest.java | 5 +-
.../zipfile/ZipAggregationStrategySplitTest.java | 5 +-
.../zipfile/ZipAggregationStrategyTest.java | 5 +-
.../integration/ZooKeeperServiceCallRouteIT.java | 4 +-
.../ZooKeeperServiceRegistrationITBase.java | 6 +-
.../FileBatchConsumerMemoryLeakManualTest.java | 5 +-
.../builder/endpoint/FileConsumeCharsetTest.java | 9 +-
.../camel/builder/endpoint/FileDelayTest.java | 9 +-
.../FtpCronScheduledRoutePolicyManualTest.java | 8 +-
.../FromJmsToJdbcIdempotentConsumerToJmsTest.java | 5 +-
...FromJmsToJdbcIdempotentConsumerToJmsXaTest.java | 10 +-
.../itest/validator/ValidatorSchemaImportTest.java | 3 +-
545 files changed, 1010 insertions(+), 2999 deletions(-)
delete mode 100644 components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java
(camel) 12/13: CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jms)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d220d8ed589514db67ffbb4c0dbdb9750f51ed78
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Jun 17 10:31:35 2024 +0200
CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jms)
---
.../integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java
index 51fde838f8f..5ed67c101a0 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java
@@ -35,9 +35,8 @@ public class JMSTransactionThrottlingRoutePolicyIT extends AbstractSpringJMSITSu
"/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.xml");
}
- @Override
@BeforeEach
- public void doPreSetup() {
+ public void cleanupDataDirectory() {
deleteDirectory("activemq-data");
}
(camel) 08/13: CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-aws-xray)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f55b836cd17bf562c80a8443b04a3a59d6b5b2b6
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Sat Jun 15 07:47:14 2024 +0200
CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-aws-xray)
---
.../apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java b/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
index 2dbd7855cfa..e1be764de75 100644
--- a/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
+++ b/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
@@ -43,12 +43,12 @@ public class SpringAwsXRaySimpleRouteTest extends CamelSpringTestSupport {
}
@Override
- public void doPreSetup() {
+ public void setupResources() {
socketListener.before();
}
@Override
- public void doPostTearDown() {
+ public void cleanupResources() {
socketListener.after();
}
(camel) 11/13: CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-itest)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4d116a10ff10e5f82979174e83d7f90e19c8b04b
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Jun 17 10:30:26 2024 +0200
CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-itest)
---
.../itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java | 3 +--
.../itest/sql/FromJmsToJdbcIdempotentConsumerToJmsXaTest.java | 10 ++++++----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
index 0c28a7ed3c9..3dc42e8cf36 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
@@ -64,9 +64,8 @@ public class FromJmsToJdbcIdempotentConsumerToJmsTest extends CamelSpringTestSup
return new ClassPathXmlApplicationContext("org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.xml");
}
- @Override
@BeforeEach
- public void doPostSetup() {
+ public void setupDataSources() {
DataSource dataSource = context.getRegistry().lookupByNameAndType(getDatasourceName(), DataSource.class);
jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.afterPropertiesSet();
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsXaTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsXaTest.java
index 937ef7c8785..ae093d09f1e 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsXaTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsXaTest.java
@@ -20,6 +20,8 @@ import java.sql.DriverManager;
import java.sql.SQLException;
import org.apache.camel.itest.utils.extensions.JmsServiceExtension;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -36,13 +38,13 @@ public class FromJmsToJdbcIdempotentConsumerToJmsXaTest extends FromJmsToJdbcIde
@RegisterExtension
public static JmsServiceExtension jmsServiceExtension = JmsServiceExtension.createExtension();
- @Override
- public void doPreSetup() {
+ @BeforeEach
+ public void cleanupDirectories() {
deleteDirectory("target/testdb");
}
- @Override
- public void doPostTearDown() {
+ @AfterEach
+ public void shutdownDatabase() {
// shutdown the embedded Derby database so that the next test becomes a clean initial state
try {
DriverManager.getConnection("jdbc:derby:target/testdb;shutdown=true");
(camel) 05/13: CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-ftp)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4ab3a53534ef8e89d7ae68c94c374b2a4d9858f9
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Jun 12 08:49:26 2024 +0200
CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-ftp)
---
.../file/remote/integration/FtpProducerFileExistAppendIT.java | 3 +--
.../component/file/remote/integration/FtpProducerFileExistFailIT.java | 3 +--
.../file/remote/integration/FtpProducerRootFileExistFailIT.java | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java
index c44a78435b6..e3a4c64b5ae 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java
@@ -29,9 +29,8 @@ public class FtpProducerFileExistAppendIT extends FtpServerTestSupport {
return "ftp://admin@localhost:{{ftp.server.port}}/exist?password=admin&delay=2000&noop=true&fileExist=Append";
}
- @Override
@BeforeEach
- public void doPostSetup() throws Exception {
+ public void sendMessages() {
template.sendBodyAndHeader(getFtpUrl(), "Hello World\n", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java
index bc65dfdd1cb..fd4a8364b37 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java
@@ -34,9 +34,8 @@ public class FtpProducerFileExistFailIT extends FtpServerTestSupport {
return "ftp://admin@localhost:{{ftp.server.port}}/exist?password=admin&delay=2000&noop=true&fileExist=Fail";
}
- @Override
@BeforeEach
- public void doPostSetup() throws Exception {
+ public void sendMessages() {
template.sendBodyAndHeader(getFtpUrl(), "Hello World", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java
index 78513deb8c0..8f3ec530472 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java
@@ -33,9 +33,8 @@ public class FtpProducerRootFileExistFailIT extends FtpServerTestSupport {
return "ftp://admin@localhost:{{ftp.server.port}}?password=admin&fileExist=Fail";
}
- @Override
@BeforeEach
- public void doPostSetup() throws Exception {
+ public void sendMessages() {
// create existing file on ftp server
template.sendBodyAndHeader(getFtpUrl(), "Hello World", Exchange.FILE_NAME, "hello.txt");
}
(camel) 13/13: CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-spring-jdbc)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 30bcf8b84555a952d5122db74f1aff57762946cc
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Jun 17 13:54:17 2024 +0200
CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-spring-jdbc)
---
.../camel/component/spring/jdbc/AbstractJdbcTestSupport.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/components/camel-spring-jdbc/src/test/java/org/apache/camel/component/spring/jdbc/AbstractJdbcTestSupport.java b/components/camel-spring-jdbc/src/test/java/org/apache/camel/component/spring/jdbc/AbstractJdbcTestSupport.java
index 69a73971d85..2c05c2ed1ea 100644
--- a/components/camel-spring-jdbc/src/test/java/org/apache/camel/component/spring/jdbc/AbstractJdbcTestSupport.java
+++ b/components/camel-spring-jdbc/src/test/java/org/apache/camel/component/spring/jdbc/AbstractJdbcTestSupport.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.spring.jdbc;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
@@ -31,8 +30,8 @@ public abstract class AbstractJdbcTestSupport extends CamelTestSupport {
@BindToRegistry("testdb")
protected EmbeddedDatabase db;
- @BeforeEach
- public void doPreSetup() {
+ @Override
+ public void setupResources() {
db = new EmbeddedDatabaseBuilder()
.setName(getClass().getSimpleName())
.setType(EmbeddedDatabaseType.DERBY)
@@ -40,7 +39,7 @@ public abstract class AbstractJdbcTestSupport extends CamelTestSupport {
}
@Override
- public void doPostTearDown() {
+ public void cleanupResources() {
db.shutdown();
}
}
(camel) 10/13: CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-servlet)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit ddc3990c5cbb9379ea406f0bc4ff98650ef7c505
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 7 11:03:42 2024 +0200
CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-servlet)
---
.../camel/component/servlet/HttpClientRouteExampleSpringTest.java | 7 ++++---
.../apache/camel/component/servlet/HttpClientRouteSpringTest.java | 5 +++--
.../org/apache/camel/component/servlet/HttpClientRouteTest.java | 2 +-
.../camel/component/servlet/ServletCamelRouterTestSupport.java | 7 +++----
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteExampleSpringTest.java b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteExampleSpringTest.java
index 39f68dab879..712bdf9eeaa 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteExampleSpringTest.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteExampleSpringTest.java
@@ -40,9 +40,10 @@ public class HttpClientRouteExampleSpringTest extends ServletCamelRouterTestSupp
}
@Override
- public void doPreSetup() {
- startCamelContext = false;
- testConfiguration().withAutoStartContext(startCamelContext);
+ public void setupResources() throws Exception {
+ super.setupResources();
+
+ testConfiguration().withAutoStartContext(false);
}
@Override
diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteSpringTest.java b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteSpringTest.java
index 9b3f6476bad..20375d120fb 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteSpringTest.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteSpringTest.java
@@ -23,8 +23,9 @@ import org.springframework.web.context.ContextLoaderListener;
public class HttpClientRouteSpringTest extends HttpClientRouteTest {
@Override
- public void doPreSetup() {
- startCamelContext = false;
+ public void setupResources() throws Exception {
+ super.setupResources();
+ testConfiguration().withAutoStartContext(false);
}
@Override
diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteTest.java b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteTest.java
index bdfc5ab2608..4b4fa7cdb0d 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteTest.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/HttpClientRouteTest.java
@@ -115,7 +115,7 @@ public class HttpClientRouteTest extends ServletCamelRouterTestSupport {
@Test
public void testCreateSerlvetEndpointProducer() throws Exception {
- assumeTrue(startCamelContext, "don't test it with web.xml configure");
+ assumeTrue(testConfiguration().autoStartContext(), "don't test it with web.xml configure");
try {
context.addRoutes(new RouteBuilder() {
@Override
diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletCamelRouterTestSupport.java b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletCamelRouterTestSupport.java
index 38810272d92..7096b81bb7c 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletCamelRouterTestSupport.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletCamelRouterTestSupport.java
@@ -45,13 +45,12 @@ public class ServletCamelRouterTestSupport extends CamelTestSupport {
public static final String CONTEXT = "/mycontext";
protected String contextUrl;
- protected boolean startCamelContext = true;
protected int port;
protected DeploymentManager manager;
protected Undertow server;
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
port = AvailablePortFinder.getNextAvailable();
DeploymentInfo servletBuilder = getDeploymentInfo();
manager = Servlets.newContainer().addDeployment(servletBuilder);
@@ -63,11 +62,11 @@ public class ServletCamelRouterTestSupport extends CamelTestSupport {
server.start();
contextUrl = "http://localhost:" + port + CONTEXT;
- testConfiguration().withAutoStartContext(startCamelContext);
+ testConfiguration().withAutoStartContext(true);
}
@Override
- public void doPostTearDown() throws ServletException {
+ public void cleanupResources() throws ServletException {
server.stop();
manager.stop();
manager.undeploy();
(camel) 09/13: CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jcr)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f2431e1adc392d7fa6d62f63456e94d72a04461f
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Jun 12 08:51:08 2024 +0200
CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jcr)
---
.../test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java | 7 +++----
.../org/apache/camel/component/jcr/JcrNodePathCreationTest.java | 5 +++--
.../component/jcr/JcrRouteDifferentWorkspaceTestSupport.java | 8 +++-----
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
index 3179abebf94..58a28619b2a 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
@@ -30,7 +30,7 @@ import org.apache.jackrabbit.api.security.user.User;
import org.apache.jackrabbit.api.security.user.UserManager;
import org.apache.jackrabbit.core.SessionImpl;
import org.apache.jackrabbit.core.TransientRepository;
-import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.BeforeAll;
import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
@@ -46,9 +46,8 @@ public abstract class JcrAuthTestBase extends CamelTestSupport {
private static Repository repository = new TransientRepository(new File(REPO_PATH));
- @Override
- @BeforeEach
- public void doPostSetup() {
+ @BeforeAll
+ public static void cleanupDirectory() {
deleteDirectory(REPO_PATH);
}
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
index b44b536e01e..8cda5256f97 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
@@ -23,6 +23,7 @@ import javax.jcr.ValueFactory;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@@ -34,8 +35,8 @@ public class JcrNodePathCreationTest extends JcrRouteTestSupport {
private Value[] multiValued;
- @Override
- public void doPreSetup() throws Exception {
+ @BeforeEach
+ public void setupCredentials() throws Exception {
Session session = openSession();
ValueFactory valFact = session.getValueFactory();
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java
index 6f20346aceb..7e7ea2ebaa0 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java
@@ -45,15 +45,13 @@ public abstract class JcrRouteDifferentWorkspaceTestSupport extends CamelTestSup
private Repository repository;
- @Override
@BeforeEach
- public void doPreSetup() {
+ public void cleanupDirectory() {
deleteDirectory(REPO_PATH);
-
}
- @Override
- protected void doPostSetup() throws Exception {
+ @BeforeEach
+ protected void setupBeans() throws Exception {
Session session = getRepository().login(new SimpleCredentials("user", "pass".toCharArray()));
Workspace workspace = session.getWorkspace();
workspace.createWorkspace(CUSTOM_WORKSPACE_NAME);
(camel) 07/13: CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-spring-ws)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 7cd4d78ff4ebf86b8c1fad9e87248ddba356bc41
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 7 11:08:58 2024 +0200
CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-spring-ws)
---
.../camel/component/spring/ws/addressing/AbstractWSATests.java | 5 +++--
.../camel/component/spring/ws/addressing/CamelDirectSenderTest.java | 5 +++--
.../spring/ws/security/ProducerWss4JSecurityHeaderManualTest.java | 5 +++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/AbstractWSATests.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/AbstractWSATests.java
index 6342fbba6dc..68abb1a8883 100644
--- a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/AbstractWSATests.java
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/AbstractWSATests.java
@@ -28,6 +28,7 @@ import org.apache.camel.component.spring.ws.utils.OutputChannelReceiver;
import org.apache.camel.component.spring.ws.utils.TestUtil;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.addressing.client.ActionCallback;
@@ -52,8 +53,8 @@ public abstract class AbstractWSATests extends CamelSpringTestSupport {
private final String xmlBody = "<GetQuote xmlns=\"http://www.webserviceX.NET/\"><symbol>GOOG</symbol></GetQuote>";
private String requestInputAction;
- @Override
- public void doPostSetup() throws Exception {
+ @BeforeEach
+ public void setupCommonBeans() {
// initialize beans for catching results
webServiceTemplate = applicationContext.getBean("webServiceTemplate", WebServiceTemplate.class);
newReply = getMandatoryBean(OutputChannelReceiver.class, "replyReceiver");
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/CamelDirectSenderTest.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/CamelDirectSenderTest.java
index 7d2c2b55b16..d8a96d9cb6b 100644
--- a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/CamelDirectSenderTest.java
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/CamelDirectSenderTest.java
@@ -25,6 +25,7 @@ import org.apache.camel.component.spring.ws.utils.OutputChannelReceiver;
import org.apache.camel.component.spring.ws.utils.TestUtil;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
import org.fest.assertions.Assertions;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -45,8 +46,8 @@ public class CamelDirectSenderTest extends AbstractWSATests {
@EndpointInject("mock:camelDirect")
private MockEndpoint endpointCamelDirect;
- @Override
- public void doPostSetup() throws Exception {
+ @BeforeEach
+ public void setupBeans() {
// initialize beans for catching results
customChannel = getMandatoryBean(OutputChannelReceiver.class, "customReceiver");
customChannel.clear();
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderManualTest.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderManualTest.java
index 7b73d4ceade..58bdd546cb5 100644
--- a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderManualTest.java
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/security/ProducerWss4JSecurityHeaderManualTest.java
@@ -21,6 +21,7 @@ import net.javacrumbs.calc.model.PlusResponse;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractXmlApplicationContext;
@@ -42,8 +43,8 @@ public class ProducerWss4JSecurityHeaderManualTest extends CamelSpringTestSuppor
private WebServiceTemplate webServiceTemplate;
- @Override
- public void doPostSetup() throws Exception {
+ @BeforeEach
+ public void setupBeans() {
webServiceTemplate = applicationContext.getBean("webServiceTemplate", WebServiceTemplate.class);
}
(camel) 03/13: CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-jdbc)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2d41a8727b648e0659942d90e7c7f999bf09112f
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Jun 12 09:03:10 2024 +0200
CAMEL-20838: use appropriate methods for setting up/cleaning up resources (camel-jdbc)
---
.../org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java
index 7a09d5f1c2c..4d801bb9078 100644
--- a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java
+++ b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.jdbc;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
@@ -31,9 +30,8 @@ public abstract class AbstractJdbcTestSupport extends CamelTestSupport {
@BindToRegistry("testdb")
protected EmbeddedDatabase db;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() {
db = new EmbeddedDatabaseBuilder()
.setName(getClass().getSimpleName())
.setType(EmbeddedDatabaseType.DERBY)
@@ -41,7 +39,7 @@ public abstract class AbstractJdbcTestSupport extends CamelTestSupport {
}
@Override
- public void doPostTearDown() {
+ public void cleanupResources() {
db.shutdown();
}
}
(camel) 04/13: CAMEL-20838: avoid usages of restricted methods (camel-http)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 086e4dea2aa6f506118b8fa82eb5ace313660328
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jun 7 11:52:39 2024 +0200
CAMEL-20838: avoid usages of restricted methods (camel-http)
- do not use overrides when JUnit's annotations suffice
- use appropriate methods for setting up/cleaning up resources
---
.../http/CamelComponentVerifierExtensionTest.java | 15 +-
.../component/http/CamelComponentVerifierTest.java | 8 +-
.../camel/component/http/FollowRedirectTest.java | 4 +-
.../component/http/HttpAuthenticationTest.java | 6 +-
.../apache/camel/component/http/HttpBodyTest.java | 6 +-
.../http/HttpBodyWithOtherProtocolNameTest.java | 5 +-
.../component/http/HttpBridgeEndpointTest.java | 6 +-
.../camel/component/http/HttpCamelHeadersTest.java | 6 +-
.../camel/component/http/HttpCharsetTest.java | 6 +-
.../camel/component/http/HttpCompressionTest.java | 6 +-
.../camel/component/http/HttpConcurrentTest.java | 6 +-
.../component/http/HttpDefaultPortNumberTest.java | 6 +-
.../component/http/HttpDisableStreamCacheTest.java | 6 +-
.../camel/component/http/HttpMethodsTest.java | 6 +-
.../component/http/HttpNoCamelHeaderTest.java | 6 +-
.../http/HttpNoConnectionRedeliveryTest.java | 6 +-
.../camel/component/http/HttpNoConnectionTest.java | 6 +-
.../http/HttpOAuth2AuthenticationTest.java | 4 +-
.../apache/camel/component/http/HttpPathTest.java | 6 +-
.../component/http/HttpPollingConsumerTest.java | 6 +-
.../http/HttpProducerBridgeEndpointTest.java | 270 ++++++++++-----------
.../http/HttpProducerConnectionCloseTest.java | 6 +-
.../http/HttpProducerContentLengthTest.java | 6 +-
.../http/HttpProducerContentTypeTest.java | 6 +-
.../HttpProducerContentTypeWithCharsetTest.java | 6 +-
.../HttpProducerContentTypeWithSemiColonTest.java | 6 +-
.../http/HttpProducerCustomHeaderTest.java | 6 +-
.../HttpProducerExplicitConnectionCloseTest.java | 6 +-
.../component/http/HttpProducerLoadManualIT.java | 6 +-
.../component/http/HttpProducerNullBodyTest.java | 6 +-
.../component/http/HttpProducerRestartTest.java | 6 +-
.../http/HttpProducerSelectMethodTest.java | 6 +-
.../HttpProducerTwoHeadersWithSameKeyTest.java | 6 +-
.../HttpProducerTwoParametersWithSameKeyTest.java | 6 +-
.../component/http/HttpProducerUserAgentTest.java | 9 +-
.../component/http/HttpProxyAndBasicAuthTest.java | 6 +-
.../camel/component/http/HttpProxyServerTest.java | 6 +-
.../component/http/HttpQueryParameterTest.java | 6 +-
.../apache/camel/component/http/HttpQueryTest.java | 6 +-
.../camel/component/http/HttpRedirectTest.java | 6 +-
.../component/http/HttpReferenceParameterTest.java | 8 +-
.../camel/component/http/HttpSOTimeoutTest.java | 7 +-
.../http/HttpSendDynamicAwareBasicAuthTest.java | 6 +-
.../http/HttpSendDynamicAwareEmptyPathTest.java | 6 +-
.../http/HttpSendDynamicAwareHeadersTest.java | 6 +-
.../http/HttpSendDynamicAwareMultiValueTest.java | 7 +-
.../http/HttpSendDynamicAwarePathHeaderTest.java | 6 +-
.../http/HttpSendDynamicAwareRawParameterTest.java | 6 +-
.../http/HttpSendDynamicAwareRawTest.java | 6 +-
.../component/http/HttpSendDynamicAwareTest.java | 6 +-
.../HttpSendDynamicAwareUriWithSpacesTest.java | 6 +-
.../HttpSendDynamicAwareUriWithoutSlashTest.java | 6 +-
.../camel/component/http/HttpSetHeaderIdsTest.java | 7 +-
.../component/http/HttpSquareBracketTest.java | 6 +-
.../http/HttpThrowExceptionOnFailureTest.java | 7 +-
.../camel/component/http/HttpToDSOTimeoutTest.java | 6 +-
.../component/http/HttpWithHttpUriHeaderTest.java | 7 +-
.../component/http/HttpsAuthenticationTest.java | 4 +-
.../apache/camel/component/http/HttpsGetTest.java | 2 +-
.../HttpsProducerWithSystemPropertiesTest.java | 6 +-
.../component/http/HttpsServerTestSupport.java | 7 +-
.../http/HttpsSslContextParametersGetTest.java | 5 +-
...psTwoComponentsSslContextParametersGetTest.java | 5 +-
...tpsTwoDifferentSslContextParametersGetTest.java | 5 +-
.../http/ManagedHttpProducerPoolStatsTest.java | 7 +-
.../http/rest/RestCamelComponentVerifierTest.java | 14 +-
66 files changed, 284 insertions(+), 393 deletions(-)
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java
index 618f0356bdf..10c7ce113a6 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java
@@ -48,9 +48,8 @@ public class CamelComponentVerifierExtensionTest extends BaseHttpTest {
private HttpServer localServer;
private ComponentVerifierExtension verifier;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getHttpProcessor())
.register("/basic", new BasicValidationHandler(GET.name(), null, null, getExpectedContent()))
@@ -62,19 +61,21 @@ public class CamelComponentVerifierExtensionTest extends BaseHttpTest {
.create();
localServer.start();
-
- Component component = context().getComponent("http");
- verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
}
}
+ @BeforeEach
+ void setupVerifier() {
+ Component component = context().getComponent("http");
+ verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
+ }
+
@Override
public boolean isUseRouteBuilder() {
return false;
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java
index 38903ec120d..7c241e5df1e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java
@@ -47,9 +47,8 @@ public class CamelComponentVerifierTest extends BaseHttpTest {
private HttpServer localServer;
private ComponentVerifierExtension verifier;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getHttpProcessor())
.register("/basic", new BasicValidationHandler(GET.name(), null, null, getExpectedContent()))
@@ -61,13 +60,16 @@ public class CamelComponentVerifierTest extends BaseHttpTest {
.create();
localServer.start();
+ }
+ @BeforeEach
+ void setupVerifier() {
HttpComponent component = context().getComponent("http", HttpComponent.class);
verifier = component.getVerifier();
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java
index d214940bc04..46ddc878cfc 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -30,9 +29,8 @@ public class FollowRedirectTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java
index fd0171a195b..ebd5c46e7aa 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java
@@ -33,7 +33,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -49,9 +48,8 @@ public class HttpAuthenticationTest extends BaseHttpTest {
private final String user = "camel";
private final String password = "password";
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -62,7 +60,7 @@ public class HttpAuthenticationTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java
index a3c0447508e..e274d5fe14c 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.camel.component.http.handler.HeaderValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.ContentType.IMAGE_JPEG;
@@ -40,9 +39,8 @@ public class HttpBodyTest extends BaseHttpTest {
private HttpServer localServer;
private String endpointUrl;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put(CONTENT_TYPE, IMAGE_JPEG.getMimeType());
@@ -59,7 +57,7 @@ public class HttpBodyTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java
index 9ed7145826e..5b1eba7b15a 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java
@@ -17,11 +17,12 @@
package org.apache.camel.component.http;
import org.apache.camel.CamelContext;
+import org.junit.jupiter.api.BeforeEach;
public class HttpBodyWithOtherProtocolNameTest extends HttpBodyTest {
- @Override
- public void doPreSetup() throws Exception {
+ @BeforeEach
+ public void setupProtocol() {
setProtocolString("newHttp://");
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java
index 890ddb19008..78bde17193b 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.component.http.handler.BasicRawQueryValidationHandler;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.Exchange.HTTP_QUERY;
@@ -35,9 +34,8 @@ public class HttpBridgeEndpointTest extends BaseHttpTest {
private HttpServer localServer;
private String url;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -50,7 +48,7 @@ public class HttpBridgeEndpointTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java
index 550424973e2..ab87a4662fc 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java
@@ -29,7 +29,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.HttpContext;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -40,9 +39,8 @@ public class HttpCamelHeadersTest extends BaseHttpTest {
protected HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put("TestHeader", "test");
expectedHeaders.put(ACCEPT_LANGUAGE, "pl");
@@ -58,7 +56,7 @@ public class HttpCamelHeadersTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java
index 353d4c17ce9..85304f14a62 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.POST;
@@ -34,9 +33,8 @@ public class HttpCharsetTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -45,7 +43,7 @@ public class HttpCharsetTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java
index f3c785d597b..e6c37a196d5 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java
@@ -47,7 +47,6 @@ import org.apache.hc.core5.http.io.entity.HttpEntityWrapper;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.http.protocol.HttpProcessor;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.http.common.HttpMethods.POST;
@@ -61,9 +60,8 @@ public class HttpCompressionTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put(CONTENT_TYPE, TEXT_PLAIN.getMimeType());
expectedHeaders.put(CONTENT_ENCODING, "gzip");
@@ -78,7 +76,7 @@ public class HttpCompressionTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java
index 6b18e23b25d..a2411aced71 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java
@@ -29,7 +29,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -40,9 +39,8 @@ public class HttpConcurrentTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -59,7 +57,7 @@ public class HttpConcurrentTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java
index 446f0e8a2c2..9021e173f70 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.client5.http.HttpHostConnectException;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -38,9 +37,8 @@ public class HttpDefaultPortNumberTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -49,7 +47,7 @@ public class HttpDefaultPortNumberTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java
index 1fa9f91bd8e..f0722c0bb9b 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.TypeConverter;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.http.common.HttpMethods.GET;
@@ -37,9 +36,8 @@ public class HttpDisableStreamCacheTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -48,7 +46,7 @@ public class HttpDisableStreamCacheTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java
index 4515f8922f5..ff2fa18fb23 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.DELETE;
@@ -46,9 +45,8 @@ public class HttpMethodsTest extends BaseHttpTest {
private String baseUrl;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -70,7 +68,7 @@ public class HttpMethodsTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java
index 0380cdf5cb5..3bebe5fecd6 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java
@@ -21,7 +21,6 @@ import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -34,9 +33,8 @@ public class HttpNoCamelHeaderTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -59,7 +57,7 @@ public class HttpNoCamelHeaderTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java
index ffa76dbfcf4..c0ffffc3219 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.util.TimeValue;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -37,9 +36,8 @@ public class HttpNoConnectionRedeliveryTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -48,7 +46,7 @@ public class HttpNoConnectionRedeliveryTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java
index 0150b260efd..2712f5a81bd 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.util.TimeValue;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
@@ -39,9 +38,8 @@ public class HttpNoConnectionTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -52,7 +50,7 @@ public class HttpNoConnectionTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java
index f926fd734ed..06e4c33d439 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.component.http.handler.OAuth2TokenRequestHandler;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,9 +37,8 @@ public class HttpOAuth2AuthenticationTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put("Authorization", "Bearer " + FAKE_TOKEN);
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java
index 84e0f93e4a1..2ffc8ee25e4 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -31,9 +30,8 @@ public class HttpPathTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -48,7 +46,7 @@ public class HttpPathTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java
index 1a12ec9f295..a697576838e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.RuntimeCamelException;
import org.apache.camel.component.http.handler.DelayValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -37,9 +36,8 @@ public class HttpPollingConsumerTest extends BaseHttpTest {
private final String password = "password";
private String endpointUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -50,7 +48,7 @@ public class HttpPollingConsumerTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java
index b1b2b635671..6f013de6e41 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java
@@ -1,136 +1,134 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.http;
-
-import java.time.Instant;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.component.http.handler.HeaderValidationHandler;
-import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
-import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-public class HttpProducerBridgeEndpointTest extends BaseHttpTest {
-
- private static final Instant INSTANT = Instant.parse("2021-06-10T14:42:00Z");
- private static final String STRING = "text";
- private static final Integer INTEGER = 1;
- private static final Long LONG = 999999999999999L;
- private static final Boolean BOOLEAN = true;
- private static final String QUERY
- = "qp1=" + INSTANT + "&qp2=" + STRING + "&qp3=" + INTEGER + "&qp4=" + LONG + "&qp5=" + BOOLEAN;
-
- private HttpServer localServer;
-
- @BeforeEach
- @Override
- public void doPreSetup() throws Exception {
- String[] absentHeaders = new String[] { "qp1", "qp2", "qp3", "qp4", "qp5" };
- Map<String, String> noBridgeExpectedHeaders = new HashMap<>();
- noBridgeExpectedHeaders.put("qp1", INSTANT.toString());
- noBridgeExpectedHeaders.put("qp2", STRING);
- noBridgeExpectedHeaders.put("qp3", INTEGER.toString());
- noBridgeExpectedHeaders.put("qp4", LONG.toString());
- noBridgeExpectedHeaders.put("qp5", BOOLEAN.toString());
-
- localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
- .setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
- .setSslContext(getSSLContext())
- .register("/bridged",
- new HeaderValidationHandler(
- "GET",
- QUERY,
- null,
- getExpectedContent(),
- null,
- Arrays.asList(absentHeaders)))
- .register("/notbridged",
- new HeaderValidationHandler(
- "GET",
- QUERY,
- null,
- getExpectedContent(),
- noBridgeExpectedHeaders))
- .create();
-
- localServer.start();
- }
-
- @Override
- public void doPostTearDown() throws Exception {
-
- if (localServer != null) {
- localServer.stop();
- }
- }
-
- @Test
- public void testHttpProducerBridgeEndpointSkipRequestHeaders() throws Exception {
-
- HttpComponent component = context.getComponent("http", HttpComponent.class);
- component.setConnectionTimeToLive(1000L);
-
- HttpEndpoint endpoint = (HttpEndpoint) component
- .createEndpoint("http://localhost:" + localServer.getLocalPort() + "/bridged?bridgeEndpoint=true");
- HttpProducer producer = new HttpProducer(endpoint);
-
- Exchange exchange = producer.createExchange();
- exchange.getIn().setBody(null);
- exchange.getIn().setHeader(Exchange.HTTP_QUERY, QUERY);
- exchange.getIn().setHeader("qp1", INSTANT);
- exchange.getIn().setHeader("qp2", STRING);
- exchange.getIn().setHeader("qp3", INTEGER);
- exchange.getIn().setHeader("qp4", LONG);
- exchange.getIn().setHeader("qp5", BOOLEAN);
-
- producer.start();
- producer.process(exchange);
- producer.stop();
-
- assertExchange(exchange);
- }
-
- @Test
- public void testHttpProducerNoBridgeEndpointRequestHeaders() throws Exception {
-
- HttpComponent component = context.getComponent("http", HttpComponent.class);
- component.setConnectionTimeToLive(1000L);
-
- HttpEndpoint endpoint = (HttpEndpoint) component
- .createEndpoint("http://localhost:" + localServer.getLocalPort() + "/notbridged");
- HttpProducer producer = new HttpProducer(endpoint);
-
- Exchange exchange = producer.createExchange();
- exchange.getIn().setBody(null);
- exchange.getIn().setHeader(Exchange.HTTP_QUERY, QUERY);
- exchange.getIn().setHeader("qp1", INSTANT);
- exchange.getIn().setHeader("qp2", STRING);
- exchange.getIn().setHeader("qp3", INTEGER);
- exchange.getIn().setHeader("qp4", LONG);
- exchange.getIn().setHeader("qp5", BOOLEAN);
-
- producer.start();
- producer.process(exchange);
- producer.stop();
-
- assertExchange(exchange);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.http;
+
+import java.time.Instant;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.component.http.handler.HeaderValidationHandler;
+import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
+import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
+import org.junit.jupiter.api.Test;
+
+public class HttpProducerBridgeEndpointTest extends BaseHttpTest {
+
+ private static final Instant INSTANT = Instant.parse("2021-06-10T14:42:00Z");
+ private static final String STRING = "text";
+ private static final Integer INTEGER = 1;
+ private static final Long LONG = 999999999999999L;
+ private static final Boolean BOOLEAN = true;
+ private static final String QUERY
+ = "qp1=" + INSTANT + "&qp2=" + STRING + "&qp3=" + INTEGER + "&qp4=" + LONG + "&qp5=" + BOOLEAN;
+
+ private HttpServer localServer;
+
+ @Override
+ public void setupResources() throws Exception {
+ String[] absentHeaders = new String[] { "qp1", "qp2", "qp3", "qp4", "qp5" };
+ Map<String, String> noBridgeExpectedHeaders = new HashMap<>();
+ noBridgeExpectedHeaders.put("qp1", INSTANT.toString());
+ noBridgeExpectedHeaders.put("qp2", STRING);
+ noBridgeExpectedHeaders.put("qp3", INTEGER.toString());
+ noBridgeExpectedHeaders.put("qp4", LONG.toString());
+ noBridgeExpectedHeaders.put("qp5", BOOLEAN.toString());
+
+ localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
+ .setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
+ .setSslContext(getSSLContext())
+ .register("/bridged",
+ new HeaderValidationHandler(
+ "GET",
+ QUERY,
+ null,
+ getExpectedContent(),
+ null,
+ Arrays.asList(absentHeaders)))
+ .register("/notbridged",
+ new HeaderValidationHandler(
+ "GET",
+ QUERY,
+ null,
+ getExpectedContent(),
+ noBridgeExpectedHeaders))
+ .create();
+
+ localServer.start();
+ }
+
+ @Override
+ public void cleanupResources() throws Exception {
+
+ if (localServer != null) {
+ localServer.stop();
+ }
+ }
+
+ @Test
+ public void testHttpProducerBridgeEndpointSkipRequestHeaders() throws Exception {
+
+ HttpComponent component = context.getComponent("http", HttpComponent.class);
+ component.setConnectionTimeToLive(1000L);
+
+ HttpEndpoint endpoint = (HttpEndpoint) component
+ .createEndpoint("http://localhost:" + localServer.getLocalPort() + "/bridged?bridgeEndpoint=true");
+ HttpProducer producer = new HttpProducer(endpoint);
+
+ Exchange exchange = producer.createExchange();
+ exchange.getIn().setBody(null);
+ exchange.getIn().setHeader(Exchange.HTTP_QUERY, QUERY);
+ exchange.getIn().setHeader("qp1", INSTANT);
+ exchange.getIn().setHeader("qp2", STRING);
+ exchange.getIn().setHeader("qp3", INTEGER);
+ exchange.getIn().setHeader("qp4", LONG);
+ exchange.getIn().setHeader("qp5", BOOLEAN);
+
+ producer.start();
+ producer.process(exchange);
+ producer.stop();
+
+ assertExchange(exchange);
+ }
+
+ @Test
+ public void testHttpProducerNoBridgeEndpointRequestHeaders() throws Exception {
+
+ HttpComponent component = context.getComponent("http", HttpComponent.class);
+ component.setConnectionTimeToLive(1000L);
+
+ HttpEndpoint endpoint = (HttpEndpoint) component
+ .createEndpoint("http://localhost:" + localServer.getLocalPort() + "/notbridged");
+ HttpProducer producer = new HttpProducer(endpoint);
+
+ Exchange exchange = producer.createExchange();
+ exchange.getIn().setBody(null);
+ exchange.getIn().setHeader(Exchange.HTTP_QUERY, QUERY);
+ exchange.getIn().setHeader("qp1", INSTANT);
+ exchange.getIn().setHeader("qp2", STRING);
+ exchange.getIn().setHeader("qp3", INTEGER);
+ exchange.getIn().setHeader("qp4", LONG);
+ exchange.getIn().setHeader("qp5", BOOLEAN);
+
+ producer.start();
+ producer.process(exchange);
+ producer.stop();
+
+ assertExchange(exchange);
+ }
+}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java
index d820235b09c..22722dc1eb9 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.spi.Registry;
import org.apache.hc.core5.http.HeaderElements;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -41,9 +40,8 @@ public class HttpProducerConnectionCloseTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -52,7 +50,7 @@ public class HttpProducerConnectionCloseTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java
index 26eed0e2a1e..3380420aa3c 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java
@@ -24,7 +24,6 @@ import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -39,9 +38,8 @@ public class HttpProducerContentLengthTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -76,7 +74,7 @@ public class HttpProducerContentLengthTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java
index 99f2fa571ad..0597ddbe555 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java
@@ -23,7 +23,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -39,9 +38,8 @@ public class HttpProducerContentTypeTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -59,7 +57,7 @@ public class HttpProducerContentTypeTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java
index 72630ab5950..62e12eb05ce 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java
@@ -23,7 +23,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -40,9 +39,8 @@ public class HttpProducerContentTypeWithCharsetTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -61,7 +59,7 @@ public class HttpProducerContentTypeWithCharsetTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java
index 9999882520e..d9aa91e84b7 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java
@@ -23,7 +23,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -39,9 +38,8 @@ public class HttpProducerContentTypeWithSemiColonTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -59,7 +57,7 @@ public class HttpProducerContentTypeWithSemiColonTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java
index 2fcfbfedd9e..3844c63a1c3 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.HeaderValidationHandler;
import org.apache.hc.core5.http.HttpHeaders;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class HttpProducerCustomHeaderTest extends BaseHttpTest {
@@ -33,9 +32,8 @@ public class HttpProducerCustomHeaderTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put(HttpHeaders.HOST, CUSTOM_HOST);
@@ -62,7 +60,7 @@ public class HttpProducerCustomHeaderTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java
index c4c59b246b7..7298c42a2a0 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.HeaderElements;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -34,9 +33,8 @@ public class HttpProducerExplicitConnectionCloseTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -45,7 +43,7 @@ public class HttpProducerExplicitConnectionCloseTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java
index 66d4cd1df7e..7d058e42b90 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.camel.util.StopWatch;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
@@ -43,9 +42,8 @@ public class HttpProducerLoadManualIT extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -54,7 +52,7 @@ public class HttpProducerLoadManualIT extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java
index 01704a80cdd..c7545f8ae16 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -33,9 +32,8 @@ public class HttpProducerNullBodyTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -52,7 +50,7 @@ public class HttpProducerNullBodyTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java
index c32c75f30ed..142e8316b84 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java
@@ -24,7 +24,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -35,9 +34,8 @@ public class HttpProducerRestartTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -54,7 +52,7 @@ public class HttpProducerRestartTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java
index 2bdebb4555e..fa17e2a6a0f 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -38,9 +37,8 @@ public class HttpProducerSelectMethodTest extends BaseHttpTest {
private Exchange exchange;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -55,7 +53,7 @@ public class HttpProducerSelectMethodTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java
index 78302769ed9..b8a80dff886 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java
@@ -26,7 +26,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -40,9 +39,8 @@ public class HttpProducerTwoHeadersWithSameKeyTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -74,7 +72,7 @@ public class HttpProducerTwoHeadersWithSameKeyTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java
index bdbd75e1dec..5ea4d94c44b 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java
@@ -24,7 +24,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,9 +37,8 @@ public class HttpProducerTwoParametersWithSameKeyTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -58,7 +56,7 @@ public class HttpProducerTwoParametersWithSameKeyTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java
index c0bac218b81..e665f50043d 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java
@@ -36,9 +36,8 @@ public class HttpProducerUserAgentTest extends BaseHttpTest {
private String endpointUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -51,14 +50,16 @@ public class HttpProducerUserAgentTest extends BaseHttpTest {
localServer.start();
endpointUrl = "http://localhost:" + localServer.getLocalPort();
+ }
+ @BeforeEach
+ void setupUserAgent() {
HttpComponent http = context.getComponent("http", HttpComponent.class);
http.setUserAgent("MyAgent");
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java
index 18a9c775760..7289443d6de 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java
@@ -32,7 +32,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -46,9 +45,8 @@ public class HttpProxyAndBasicAuthTest extends BaseHttpTest {
private final String proxyUser = "proxyuser";
private final String proxyPassword = "proxypassword";
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
proxy = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -61,7 +59,7 @@ public class HttpProxyAndBasicAuthTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (proxy != null) {
proxy.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java
index 83510cd2adf..baa2ce1f523 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java
@@ -33,7 +33,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -43,9 +42,8 @@ public class HttpProxyServerTest extends BaseHttpTest {
private HttpServer proxy;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
// Don't test anymore the Proxy-Connection header as it is highly discouraged, so its support has been removed
// https://issues.apache.org/jira/browse/HTTPCLIENT-1957
@@ -60,7 +58,7 @@ public class HttpProxyServerTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (proxy != null) {
proxy.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java
index a7c62e4aab4..fa204b1c50e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkQueryValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -31,9 +30,8 @@ public class HttpQueryParameterTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -43,7 +41,7 @@ public class HttpQueryParameterTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java
index f3cd6d24f20..502238dce17 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -31,9 +30,8 @@ public class HttpQueryTest extends BaseHttpTest {
private String baseUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -48,7 +46,7 @@ public class HttpQueryTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java
index d88893309b6..0a44c1afe71 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java
@@ -27,7 +27,6 @@ import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.HttpRequestHandler;
import org.apache.hc.core5.http.protocol.HttpContext;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -42,9 +41,8 @@ public class HttpRedirectTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -56,7 +54,7 @@ public class HttpRedirectTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
index 0988c20c230..486ff8e0535 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
@@ -50,14 +50,18 @@ public class HttpReferenceParameterTest extends CamelTestSupport {
private HttpContext testHttpContext;
@Override
- public void doPreSetup() throws Exception {
+ public final void doPreSetup() throws Exception {
+ super.doPreSetup();
+
this.testBinding = new TestHttpBinding();
this.testConfigurer = new TestClientConfigurer();
this.testHttpContext = new BasicHttpContext();
}
@Override
- protected void doPostSetup() throws Exception {
+ protected final void doPostSetup() throws Exception {
+ super.doPostSetup();
+
this.endpoint1 = context.getEndpoint(TEST_URI_1, HttpEndpoint.class);
this.endpoint2 = context.getEndpoint(TEST_URI_2, HttpEndpoint.class);
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java
index 1f8991e6874..ece20feccae 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java
@@ -22,7 +22,6 @@ import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.util.Timeout;
import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -32,9 +31,8 @@ public class HttpSOTimeoutTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -43,8 +41,7 @@ public class HttpSOTimeoutTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java
index 1af4509e10e..f47222cbc82 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkAuthValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -34,9 +33,8 @@ public class HttpSendDynamicAwareBasicAuthTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -58,7 +56,7 @@ public class HttpSendDynamicAwareBasicAuthTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java
index 60cc3304a42..1fb51b5cf60 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -31,9 +30,8 @@ public class HttpSendDynamicAwareEmptyPathTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -42,7 +40,7 @@ public class HttpSendDynamicAwareEmptyPathTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java
index 714ed8ed9c8..c7a66302bcc 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -32,9 +31,8 @@ public class HttpSendDynamicAwareHeadersTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -44,7 +42,7 @@ public class HttpSendDynamicAwareHeadersTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java
index 88bdd91b3da..d9373911a08 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java
@@ -26,7 +26,6 @@ import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -36,9 +35,8 @@ public class HttpSendDynamicAwareMultiValueTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy())
@@ -50,8 +48,7 @@ public class HttpSendDynamicAwareMultiValueTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java
index 93eea4fc661..72662acec02 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -32,9 +31,8 @@ public class HttpSendDynamicAwarePathHeaderTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -43,7 +41,7 @@ public class HttpSendDynamicAwarePathHeaderTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java
index bb0c030049d..00ba621261e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -31,9 +30,8 @@ public class HttpSendDynamicAwareRawParameterTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy())
@@ -45,7 +43,7 @@ public class HttpSendDynamicAwareRawParameterTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java
index dec1dcbf766..52ba635aa27 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -36,9 +35,8 @@ public class HttpSendDynamicAwareRawTest extends BaseHttpTest {
@BindToRegistry("pw")
private String pw = "se+%ret.$";
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -50,7 +48,7 @@ public class HttpSendDynamicAwareRawTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java
index f81463907a8..583304b3322 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -32,9 +31,8 @@ public class HttpSendDynamicAwareTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -44,7 +42,7 @@ public class HttpSendDynamicAwareTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java
index 18fc9a20ecd..430e644429c 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -35,9 +34,8 @@ public class HttpSendDynamicAwareUriWithSpacesTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -46,7 +44,7 @@ public class HttpSendDynamicAwareUriWithSpacesTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java
index fe6ba374f81..b2224bf8139 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -35,9 +34,8 @@ public class HttpSendDynamicAwareUriWithoutSlashTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -46,7 +44,7 @@ public class HttpSendDynamicAwareUriWithoutSlashTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java
index 2ba2c212731..88e8e286cce 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java
@@ -25,16 +25,14 @@ import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class HttpSetHeaderIdsTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -47,8 +45,7 @@ public class HttpSetHeaderIdsTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java
index 8b9eb124440..9e07374a885 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -31,9 +30,8 @@ public class HttpSquareBracketTest extends BaseHttpTest {
private String baseUrl;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -48,7 +46,7 @@ public class HttpSquareBracketTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java
index 5af8d72ac42..aeef23ec389 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.http.base.HttpOperationFailedException;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -40,9 +39,8 @@ public class HttpThrowExceptionOnFailureTest extends BaseHttpTest {
private String baseUrl;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -53,8 +51,7 @@ public class HttpThrowExceptionOnFailureTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java
index c86d014dbe2..664009e02f2 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -33,9 +32,8 @@ public class HttpToDSOTimeoutTest extends BaseHttpTest {
private String baseUrl;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -58,7 +56,7 @@ public class HttpToDSOTimeoutTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java
index 37e4117ceef..55b65d755b4 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -29,9 +28,8 @@ public class HttpWithHttpUriHeaderTest extends BaseHttpTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -40,8 +38,7 @@ public class HttpWithHttpUriHeaderTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java
index be43b4d2166..49a8f3d1d13 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java
@@ -60,7 +60,7 @@ public class HttpsAuthenticationTest extends BaseHttpsTest {
private HttpContext basicAuthContexts = basicAuthContext();
@Override
- public void doPreSetup() throws Exception {
+ public final void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -71,7 +71,7 @@ public class HttpsAuthenticationTest extends BaseHttpsTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java
index 561cf247252..11f0885816a 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java
@@ -47,7 +47,7 @@ public class HttpsGetTest extends BaseHttpsTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java
index 3abb0b056c5..dea1a121ac9 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java
@@ -33,7 +33,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.ssl.SSLContexts;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -79,9 +78,8 @@ public class HttpsProducerWithSystemPropertiesTest extends BaseHttpTest {
System.clearProperty("javax.net.ssl.keyStore");
}
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
URL serverKeystoreUurl = HttpsServerTestSupport.class.getResource("/localhost.p12");
URL serverTrustStoreUrl = HttpsServerTestSupport.class.getResource("/localhost.p12");
SSLContext sslcontext = SSLContexts.custom()
@@ -105,7 +103,7 @@ public class HttpsProducerWithSystemPropertiesTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java
index 43cf1e25e3a..a286f2f31e9 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java
@@ -25,23 +25,20 @@ import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;
-import org.junit.jupiter.api.BeforeEach;
-
public abstract class HttpsServerTestSupport extends HttpServerTestSupport {
private static final String KEYSTORE = "/localhost.p12";
private static final String PASSWORD = "changeit";
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
System.setProperty("javax.net.ssl.trustStorePassword", PASSWORD);
final URL keystoreResourceUrl = HttpsServerTestSupport.class.getResource(KEYSTORE);
System.setProperty("javax.net.ssl.trustStore", new File(keystoreResourceUrl.toURI()).getAbsolutePath());
}
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
System.clearProperty("javax.net.ssl.trustStorePassword");
System.clearProperty("javax.net.ssl.trustStore");
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java
index 807dee4cf38..e0e9db96147 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java
@@ -29,7 +29,7 @@ public class HttpsSslContextParametersGetTest extends HttpsGetTest {
private HttpServer localServer;
@Override
- public void doPreSetup() throws Exception {
+ public final void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -38,8 +38,7 @@ public class HttpsSslContextParametersGetTest extends HttpsGetTest {
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java
index db3789c7e04..897906ceec9 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java
@@ -48,7 +48,7 @@ public class HttpsTwoComponentsSslContextParametersGetTest extends BaseHttpsTest
private HttpComponent httpComponent1 = new HttpComponent();
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext()).create();
@@ -56,8 +56,7 @@ public class HttpsTwoComponentsSslContextParametersGetTest extends BaseHttpsTest
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java
index d8061ed2f75..98f81daa408 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java
@@ -44,7 +44,7 @@ public class HttpsTwoDifferentSslContextParametersGetTest extends BaseHttpsTest
private SSLContextParameters sslContextParameters2 = new SSLContextParameters();
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext()).create();
@@ -52,8 +52,7 @@ public class HttpsTwoDifferentSslContextParametersGetTest extends BaseHttpsTest
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java
index 71803226393..b92faf71b66 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java
@@ -26,7 +26,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -42,9 +41,8 @@ public class ManagedHttpProducerPoolStatsTest extends BaseHttpTest {
return true;
}
- @BeforeEach
@Override
- public void doPreSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -56,8 +54,7 @@ public class ManagedHttpProducerPoolStatsTest extends BaseHttpTest {
}
@Override
- public void doPostTearDown() throws Exception {
-
+ public void cleanupResources() {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java
index 3d729a66f51..9cbe3e7589e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java
@@ -45,9 +45,8 @@ public class RestCamelComponentVerifierTest extends BaseHttpTest {
private Map<String, Object> parameters;
private ComponentVerifierExtension verifier;
- @BeforeEach
@Override
- public void doPostSetup() throws Exception {
+ public void setupResources() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getHttpProcessor())
.register("/verify", new BasicValidationHandler(GET.name(), null, null, getExpectedContent()))
@@ -55,17 +54,20 @@ public class RestCamelComponentVerifierTest extends BaseHttpTest {
localServer.start();
- RestComponent component = context().getComponent("rest", RestComponent.class);
- verifier = component.getVerifier();
-
parameters = new HashMap<>();
parameters.put("producerComponentName", "http");
parameters.put("host", "http://localhost:" + localServer.getLocalPort());
parameters.put("path", "verify");
}
+ @BeforeEach
+ public void setupVerifier() {
+ RestComponent component = context().getComponent("rest", RestComponent.class);
+ verifier = component.getVerifier();
+ }
+
@Override
- public void doPostTearDown() throws Exception {
+ public void cleanupResources() throws Exception {
if (localServer != null) {
localServer.stop();
(camel) 02/13: CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jpa)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4fd8467b1e34e8ea5bf638ac2d5f825a218e9b2e
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Sat Jun 15 08:19:09 2024 +0200
CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-jpa)
---
.../org/apache/camel/component/jpa/AbstractJpaMethodSupport.java | 3 +--
.../test/java/org/apache/camel/processor/jpa/AbstractJpaTest.java | 8 ++------
.../apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java | 8 +++++---
.../org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java | 4 +---
.../camel/processor/jpa/JpaPollingConsumerLockEntityTest.java | 5 +----
.../camel/processor/jpa/JpaRouteSharedEntityManagerTest.java | 8 +++-----
.../apache/camel/processor/jpa/JpaRouteSkipLockedEntityTest.java | 4 +---
7 files changed, 14 insertions(+), 26 deletions(-)
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodSupport.java b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodSupport.java
index 0eaa0bd79be..12283da28ff 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodSupport.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/component/jpa/AbstractJpaMethodSupport.java
@@ -38,9 +38,8 @@ public class AbstractJpaMethodSupport extends CamelTestSupport {
protected TransactionTemplate transactionTemplate;
protected Consumer consumer;
- @Override
@AfterEach
- public void tearDown() {
+ public void closeEntityManager() {
if (entityManager != null) {
entityManager.close();
}
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/AbstractJpaTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/AbstractJpaTest.java
index e7f53160a77..46b9a02c09e 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/AbstractJpaTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/AbstractJpaTest.java
@@ -41,10 +41,8 @@ public abstract class AbstractJpaTest extends CamelTestSupport {
protected TransactionTemplate transactionTemplate;
protected EntityManager entityManager;
- @Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void setupEntityManager() {
EntityManagerFactory entityManagerFactory = applicationContext.getBean("entityManagerFactory",
EntityManagerFactory.class);
transactionTemplate = applicationContext.getBean("transactionTemplate", TransactionTemplate.class);
@@ -52,10 +50,8 @@ public abstract class AbstractJpaTest extends CamelTestSupport {
cleanupRepository();
}
- @Override
@AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void cleanupEntityManager() {
if (entityManager != null) {
entityManager.close();
}
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java
index 17ed6e0d9d9..5668c5f6053 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/FileConsumerJpaIdempotentTest.java
@@ -41,11 +41,13 @@ public class FileConsumerJpaIdempotentTest extends AbstractJpaTest {
= "select x from " + MessageProcessed.class.getName() + " x where x.processorName = ?1";
protected static final String PROCESSOR_NAME = "FileConsumer";
- @Override
@BeforeEach
- public void setUp() throws Exception {
+ public void cleanupDir() {
deleteDirectory("target/idempotent");
- super.setUp();
+ }
+
+ @BeforeEach
+ public void setMessages() {
template.sendBodyAndHeader("file://target/idempotent/", "Hello World", Exchange.FILE_NAME, "report.txt");
}
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
index ff4ca6526fb..7edc71ca099 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
@@ -69,10 +69,8 @@ public class JpaIdempotentConsumerTest extends AbstractJpaTest {
});
}
- @Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void setEndpoints() {
startEndpoint = resolveMandatoryEndpoint("direct:start");
resultEndpoint = getMockEndpoint("mock:result");
}
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaPollingConsumerLockEntityTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaPollingConsumerLockEntityTest.java
index f67f1f343a5..3cc1bff20db 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaPollingConsumerLockEntityTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaPollingConsumerLockEntityTest.java
@@ -34,10 +34,7 @@ public class JpaPollingConsumerLockEntityTest extends AbstractJpaTest {
protected static final String SELECT_ALL_STRING = "select x from " + Customer.class.getName() + " x";
@BeforeEach
- @Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void setupBeans() {
Customer customer = new Customer();
customer.setName("Donald Duck");
saveEntityInDB(customer);
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java
index 2937ceda539..37011c56344 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSharedEntityManagerTest.java
@@ -26,7 +26,7 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.examples.SendEmail;
import org.apache.camel.util.ObjectHelper;
-import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.context.expression.BeanFactoryResolver;
import org.springframework.expression.Expression;
@@ -42,12 +42,10 @@ public class JpaRouteSharedEntityManagerTest extends AbstractJpaTest {
protected static final String SELECT_ALL_STRING = "select x from " + SendEmail.class.getName() + " x";
private CountDownLatch latch = new CountDownLatch(1);
- @Override
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeAll
+ public static void hibernateCheck() {
// Don't run on Hibernate
assumeTrue(ObjectHelper.loadClass("org.hibernate.Hibernate") == null);
- super.setUp();
}
@Test
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSkipLockedEntityTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSkipLockedEntityTest.java
index a8b26953e14..d077f8d464c 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSkipLockedEntityTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaRouteSkipLockedEntityTest.java
@@ -109,10 +109,8 @@ public class JpaRouteSkipLockedEntityTest extends AbstractJpaTest {
}
}
- @Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void setupTimeout() throws SQLException {
setLockTimeout(0);
}
(camel) 01/13: CAMEL-20838: avoid unnecessarily overriding the restricted methods
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 8e44be3385855f1b3d6e0b2e2f406d64decee13b
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Sat Jun 15 08:13:49 2024 +0200
CAMEL-20838: avoid unnecessarily overriding the restricted methods
- avoid unnecessarily overriding the setUp method
- avoid unnecessarily overriding the tearDown method
---
.../component/avro/AvroConsumerTestSupport.java | 6 +-
.../component/avro/AvroHttpSpringProducerTest.java | 5 +-
.../avro/AvroNettySpringConsumerTest.java | 11 +---
.../avro/AvroNettySpringProducerTest.java | 5 +-
.../component/avro/AvroProducerTestSupport.java | 6 +-
.../avro/AvroGenericMarshalAndUnmarshalTest.java | 5 +-
.../aws/xray/SpringAwsXRaySimpleRouteTest.java | 12 ++--
.../component/aws2/ses/SesComponentSpringTest.java | 6 +-
.../operations/CosmosDbClientOperationsIT.java | 2 +-
.../operations/CosmosDbContainerOperationsIT.java | 2 +-
.../operations/CosmosDbDatabaseOperationsIT.java | 2 +-
.../eventhubs/integration/EventHubsConsumerIT.java | 2 +-
.../EventHubsProducerCustomClientIT.java | 2 +-
.../eventhubs/integration/EventHubsProducerIT.java | 2 +-
.../eventhubs/integration/EventProcessorIT.java | 2 +-
.../operations/EventHubsProducerOperationsIT.java | 2 +-
.../operations/integration/QueueOperationsIT.java | 2 +-
.../integration/QueueServiceOperationsIT.java | 2 +-
.../validator/BeanValidatorConfigurationTest.java | 6 +-
.../validator/ValidatorFactoryAutowireTest.java | 6 +-
.../validator/ValidatorFactoryRegistryTest.java | 6 +-
.../component/braintree/AddressGatewayIT.java | 4 +-
.../braintree/PaymentMethodGatewayIT.java | 4 +-
.../component/braintree/TransactionGatewayIT.java | 4 +-
...CaffeineAggregationRepositoryOperationTest.java | 5 +-
.../org/apache/camel/coap/CoAPTestSupport.java | 5 +-
.../cometd/CometdProducerConsumerTest.java | 6 +-
.../cometd/MultipCometdProducerConsumerTest.java | 5 +-
.../cometd/SslCometdProducerConsumerTest.java | 6 +-
...ontextParametersCometdProducerConsumerTest.java | 6 +-
...tParametersInUriCometdProducerConsumerTest.java | 5 +-
...ontextParametersCometdProducerConsumerTest.java | 6 +-
.../couchbase/CouchbaseComponentTest.java | 5 +-
.../camel/component/crypto/ECDSASignatureTest.java | 5 +-
.../camel/component/crypto/SignatureTest.java | 5 +-
.../CxfRsConsumerSimpleBindingImplTest.java | 10 +---
.../CxfRsConsumerSimpleBindingTest.java | 10 +---
.../cxf/converter/CxfPayloadConverterTest.java | 5 +-
.../cxf/jaxws/CxfCustomizedExceptionTest.java | 11 +---
.../jaxws/CxfMessageCustomizedExceptionTest.java | 6 +-
.../jaxws/CxfPayLoadCustomizedExceptionTest.java | 7 +--
.../CxfRsConsumerSimpleBindingImplTest.java | 10 +---
.../CxfRsConsumerSimpleBindingTest.java | 10 +---
.../cxf/AbstractCXFGreeterRouterTest.java | 6 +-
.../CxfConsumerPayloadFaultCauseEnabledTest.java | 5 +-
.../CxfGreeterPayLoadWithFeatureRouterTest.java | 10 +---
.../CxfPayloadConsumerNamespaceOnEnvelopeTest.java | 5 +-
.../CxfPayloadProducerNamespaceOnEnvelopeTest.java | 5 +-
.../cxf/CxfPayloadRouterContentLengthTest.java | 10 +---
.../cxf/CxfSpringCustomizedExceptionTest.java | 10 +---
.../camel/component/cxf/CxfSpringRouterTest.java | 10 +---
.../cxf/converter/PayLoadConvertToPOJOTest.java | 5 +-
.../cxf/spring/FileToCxfMessageDataFormatTest.java | 11 +---
.../cxf/transport/CamelTransportTestSupport.java | 10 +---
.../cxf/transport/CamelTransportTestSupport.java | 10 +---
.../FileDisruptorShutdownCompleteAllTasksTest.java | 5 +-
.../disruptor/vm/AbstractVmTestSupport.java | 10 +---
.../component/ehcache/EhcacheTestSupport.java | 4 +-
.../EhcacheAggregationRepositoryOperationTest.java | 5 +-
.../fhir/dataformat/FhirJsonDataFormatTest.java | 5 +-
.../FhirJsonDataformatErrorHandlerTest.java | 5 +-
.../fhir/dataformat/FhirXmlDataFormatTest.java | 5 +-
.../FhirXmlDataformatErrorHandlerTest.java | 5 +-
.../spring/FhirDataformatConfigSpringTest.java | 7 ---
.../FhirDataformatDefaultConfigSpringTest.java | 7 ---
.../spring/FhirJsonDataFormatSpringTest.java | 5 +-
.../FhirJsonDataformatErrorHandlerSpringTest.java | 5 +-
.../spring/FhirXmlDataFormatSpringTest.java | 5 +-
.../FhirXmlDataformatErrorHandlerSpringTest.java | 5 +-
.../file/watch/FileWatchComponentTestBase.java | 3 +-
.../camel/component/fop/FopComponentTest.java | 17 +-----
.../freemarker/FreemarkerContentCacheTest.java | 6 +-
.../component/file/remote/FtpSoTimeoutTest.java | 10 +---
.../FromFileToFtpDefaultRootRenameStrategyIT.java | 3 +-
.../integration/FromFtpActivePortRangeIT.java | 3 +-
.../integration/FromFtpClientConfigRefIT.java | 3 +-
.../integration/FromFtpClientDataTimeoutIT.java | 3 +-
.../integration/FromFtpClientSoTimeout2IT.java | 3 +-
.../integration/FromFtpClientSoTimeoutIT.java | 3 +-
.../integration/FromFtpConsumerTemplateIT.java | 3 +-
.../FromFtpConsumerTemplateRollbackIT.java | 3 +-
.../remote/integration/FromFtpDeleteFileIT.java | 3 +-
.../FromFtpDoNotDeleteFileIfProcessFailsIT.java | 3 +-
.../integration/FromFtpKeepLastModifiedIT.java | 3 +-
.../FromFtpMoveFileAbsoluteFolderRecursiveIT.java | 3 +-
.../file/remote/integration/FromFtpMoveFileIT.java | 3 +-
.../integration/FromFtpMoveFilePostfixIT.java | 3 +-
.../integration/FromFtpMoveFilePrefixIT.java | 3 +-
.../integration/FromFtpMoveFileRecursiveIT.java | 3 +-
.../FromFtpMoveFileToHiddenFolderRecursiveIT.java | 3 +-
...mFtpNoEndpointPathRelativeMoveToAbsoluteIT.java | 3 +-
.../file/remote/integration/FromFtpNoopIT.java | 3 +-
.../integration/FromFtpNoopIdempotentFalseIT.java | 3 +-
.../remote/integration/FromFtpNotDownloadIT.java | 3 +-
.../remote/integration/FromFtpPassiveModeIT.java | 3 +-
.../remote/integration/FromFtpPollFileOnlyIT.java | 3 +-
.../remote/integration/FromFtpPreMoveDeleteIT.java | 3 +-
.../FromFtpPreMoveFileExpressionIT.java | 3 +-
.../integration/FromFtpPreMoveFilePostfixIT.java | 3 +-
.../integration/FromFtpPreMoveFilePrefixIT.java | 3 +-
.../remote/integration/FromFtpPreMoveNoopIT.java | 3 +-
.../remote/integration/FromFtpRecursiveNoopIT.java | 4 +-
.../FromFtpRecursiveNotStepwiseNoBasePathIT.java | 3 +-
.../remote/integration/FromFtpRegexPatternIT.java | 3 +-
.../FromFtpRemoteFileFilterDirectoryIT.java | 3 +-
.../integration/FromFtpRemoteFileFilterIT.java | 3 +-
.../FromFtpRemoteFileSortByExpressionIT.java | 3 +-
...mFtpRemoteFileSortByIgnoreCaseExpressionIT.java | 3 +-
.../FromFtpRemoteFileSortByNestedExpressionIT.java | 3 +-
.../integration/FromFtpRemoteFileSorterIT.java | 3 +-
.../FromFtpServerLanguageCodeAndTimeoutIT.java | 3 +-
.../integration/FromFtpServerLanguageCodeIT.java | 3 +-
...mpleNoEndpointPathRelativeMoveToAbsoluteIT.java | 3 +-
...mpleNoEndpointPathRelativeMoveToRelativeIT.java | 3 +-
.../FromFtpSimpleRelativeMoveToAbsoluteIT.java | 3 +-
.../FromFtpSimpleRelativeMoveToRelativeIT.java | 3 +-
.../FromFtpStartingDirAndFileNameClashIT.java | 3 +-
.../remote/integration/FromFtpToAsciiFileIT.java | 3 +-
.../FromFtpToAsciiFileNoBodyConversionIT.java | 3 +-
.../remote/integration/FromFtpToBinaryFileIT.java | 3 +-
.../remote/integration/FromFtpToBinaryFilesIT.java | 3 +-
.../FromFtpToFileNoFileNameHeaderIT.java | 3 +-
.../integration/FromFtpTwoSlashesIssueIT.java | 3 +-
.../FromQueueThenConsumeFtpToMockIT.java | 3 +-
.../file/remote/integration/FtpAnonymousIT.java | 3 +-
.../FtpBadLoginMockNoopConnectionLeakIT.java | 4 +-
.../integration/FtpConsumerAbsolutePathIT.java | 3 +-
.../integration/FtpConsumerAsyncStressIT.java | 3 +-
.../integration/FtpConsumerBodyAsStringIT.java | 3 +-
.../FtpConsumerDeleteNoWritePermissionIT.java | 3 +-
.../FtpConsumerDirectoriesNotMatchedIT.java | 3 +-
.../integration/FtpConsumerDisconnectIT.java | 4 +-
.../integration/FtpConsumerExcludeExtIT.java | 3 +-
.../integration/FtpConsumerExcludeNameIT.java | 3 +-
.../integration/FtpConsumerIPV6BodyAsStringIT.java | 3 +-
.../integration/FtpConsumerIncludeExtIT.java | 3 +-
.../integration/FtpConsumerIncludeNameIT.java | 3 +-
...ConsumerLocalWorkDirectoryAsAbsolutePathIT.java | 3 +-
.../FtpConsumerLocalWorkDirectoryDirectIT.java | 3 +-
.../FtpConsumerLocalWorkDirectoryIT.java | 3 +-
.../FtpConsumerMultipleDirectoriesIT.java | 3 +-
.../FtpConsumerNotEagerMaxMessagesPerPollIT.java | 3 +-
.../integration/FtpConsumerRelativeFileNameIT.java | 3 +-
.../integration/FtpConsumerResumeDownloadIT.java | 4 +-
.../integration/FtpConsumerSkipDotFilesIT.java | 3 +-
.../remote/integration/FtpConsumerTemplateIT.java | 3 +-
.../FtpConsumerTemplateUseListFalseIT.java | 3 +-
.../FtpConsumerUsingFTPClientConfigIT.java | 3 +-
.../integration/FtpConsumerWithCharsetIT.java | 3 +-
.../integration/FtpConsumerWithNoFileOptionIT.java | 3 +-
...FtpProducerAllowNullBodyFileAlreadyExistIT.java | 3 +-
.../integration/FtpProducerDisconnectIT.java | 4 +-
.../FtpProducerDisconnectOnBatchCompleteIT.java | 4 +-
.../integration/FtpProducerFileExistAppendIT.java | 4 +-
.../integration/FtpProducerFileExistFailIT.java | 4 +-
.../integration/FtpProducerFileExistIgnoreIT.java | 4 +-
.../FtpProducerFileExistOverrideIT.java | 3 +-
.../integration/FtpProducerFileWithCharsetIT.java | 3 +-
.../FtpProducerRootFileExistFailIT.java | 3 +-
.../integration/FtpShutdownCompleteAllTasksIT.java | 3 +-
.../FtpShutdownCompleteCurrentTaskOnlyIT.java | 3 +-
.../FtpSimpleConsumeStreamingStepwiseIT.java | 3 +-
.../SftpConsumerLocalWorkDirectoryIT.java | 3 +-
.../ToFtpTempFileTargetFileExistIT.java | 3 +-
.../sftp/integration/SftpFromSedaDeleteFileIT.java | 3 +-
.../apache/camel/component/git/GitTestSupport.java | 8 +--
.../component/google/drive/FileConverterIT.java | 3 +-
.../pubsublite/GooglePubsubLiteComponentTest.java | 9 +--
.../pubsublite/GooglePubsubLiteProducerTest.java | 5 +-
.../http/common/HttpHeaderFilterStrategyTest.java | 7 +--
.../http/common/cookie/CookieHandlerTest.java | 5 +-
.../http/CamelComponentVerifierExtensionTest.java | 9 +--
.../component/http/CamelComponentVerifierTest.java | 9 +--
.../camel/component/http/FollowRedirectTest.java | 4 +-
.../component/http/HttpAuthenticationTest.java | 9 +--
.../apache/camel/component/http/HttpBodyTest.java | 9 +--
.../http/HttpBodyWithOtherProtocolNameTest.java | 5 +-
.../component/http/HttpBridgeEndpointTest.java | 9 +--
.../camel/component/http/HttpCamelHeadersTest.java | 9 +--
.../camel/component/http/HttpCharsetTest.java | 9 +--
.../camel/component/http/HttpCompressionTest.java | 9 +--
.../camel/component/http/HttpConcurrentTest.java | 9 +--
.../component/http/HttpDefaultPortNumberTest.java | 9 +--
.../component/http/HttpDisableStreamCacheTest.java | 9 +--
.../HttpInvalidHttpClientConfigurationTest.java | 64 ----------------------
.../camel/component/http/HttpMethodsTest.java | 9 +--
.../component/http/HttpNoCamelHeaderTest.java | 9 +--
.../http/HttpNoConnectionRedeliveryTest.java | 9 +--
.../camel/component/http/HttpNoConnectionTest.java | 9 +--
.../http/HttpOAuth2AuthenticationTest.java | 3 +-
.../apache/camel/component/http/HttpPathTest.java | 9 +--
.../component/http/HttpPollingConsumerTest.java | 9 +--
.../http/HttpProducerBridgeEndpointTest.java | 9 +--
.../http/HttpProducerConnectionCloseTest.java | 9 +--
.../http/HttpProducerContentLengthTest.java | 9 +--
.../http/HttpProducerContentTypeTest.java | 9 +--
.../HttpProducerContentTypeWithCharsetTest.java | 13 ++---
.../HttpProducerContentTypeWithSemiColonTest.java | 9 +--
.../http/HttpProducerCustomHeaderTest.java | 9 +--
.../HttpProducerExplicitConnectionCloseTest.java | 9 +--
.../component/http/HttpProducerLoadManualIT.java | 10 +---
.../component/http/HttpProducerNullBodyTest.java | 13 ++---
.../component/http/HttpProducerRestartTest.java | 9 +--
.../http/HttpProducerSelectMethodTest.java | 9 +--
.../HttpProducerTwoHeadersWithSameKeyTest.java | 9 +--
.../HttpProducerTwoParametersWithSameKeyTest.java | 9 +--
.../component/http/HttpProducerUserAgentTest.java | 9 +--
.../component/http/HttpProxyAndBasicAuthTest.java | 9 +--
.../camel/component/http/HttpProxyServerTest.java | 9 +--
.../component/http/HttpQueryParameterTest.java | 9 +--
.../apache/camel/component/http/HttpQueryTest.java | 9 +--
.../camel/component/http/HttpRedirectTest.java | 9 +--
.../component/http/HttpReferenceParameterTest.java | 9 +--
.../camel/component/http/HttpSOTimeoutTest.java | 9 +--
.../http/HttpSendDynamicAwareBasicAuthTest.java | 9 +--
.../http/HttpSendDynamicAwareEmptyPathTest.java | 9 +--
.../http/HttpSendDynamicAwareHeadersTest.java | 9 +--
.../http/HttpSendDynamicAwareMultiValueTest.java | 9 +--
.../http/HttpSendDynamicAwarePathHeaderTest.java | 9 +--
.../http/HttpSendDynamicAwareRawParameterTest.java | 9 +--
.../http/HttpSendDynamicAwareRawTest.java | 9 +--
.../component/http/HttpSendDynamicAwareTest.java | 9 +--
.../HttpSendDynamicAwareUriWithSpacesTest.java | 9 +--
.../HttpSendDynamicAwareUriWithoutSlashTest.java | 9 +--
.../camel/component/http/HttpSetHeaderIdsTest.java | 9 +--
.../component/http/HttpSquareBracketTest.java | 9 +--
.../http/HttpThrowExceptionOnFailureTest.java | 9 +--
.../camel/component/http/HttpToDSOTimeoutTest.java | 9 +--
.../component/http/HttpWithHttpUriHeaderTest.java | 9 +--
.../component/http/HttpsAuthenticationTest.java | 11 +---
.../apache/camel/component/http/HttpsGetTest.java | 11 +---
.../HttpsProducerWithSystemPropertiesTest.java | 9 +--
.../component/http/HttpsServerTestSupport.java | 10 +---
.../http/HttpsSslContextParametersGetTest.java | 11 +---
...psTwoComponentsSslContextParametersGetTest.java | 11 +---
...tpsTwoDifferentSslContextParametersGetTest.java | 11 +---
.../http/ManagedHttpProducerPoolStatsTest.java | 9 +--
.../http/rest/RestCamelComponentVerifierTest.java | 9 +--
.../camel/component/ical/ICalDataFormatTest.java | 12 +---
.../JacksonNotUseDefaultObjectMapperTest.java | 5 +-
.../JaxbDataFormatSchemaValidationSpringTest.java | 5 +-
...ormatSchemaValidationWithObjectFactoryTest.java | 7 +--
.../org/apache/camel/example/DataFormatTest.java | 5 +-
.../idempotent/JCacheIdempotentRepositoryTest.java | 10 +---
.../camel/component/jcr/JcrAuthTestBase.java | 3 +-
.../camel/component/jcr/JcrGetNodeByIdTest.java | 7 +--
.../component/jcr/JcrNodePathCreationTest.java | 6 +-
.../jcr/JcrRouteDifferentWorkspaceTestSupport.java | 8 ++-
.../camel/component/jcr/JcrRouteTestSupport.java | 5 +-
.../component/jdbc/AbstractJdbcTestSupport.java | 10 +---
.../jetty/HttpProducerJMXBeansIssueManualIT.java | 3 +-
.../jetty/HttpStreamCacheFileStopIssueTest.java | 5 +-
.../camel/component/jetty/HttpsAsyncRouteTest.java | 10 +---
.../jetty/HttpsRouteSetupWithSystemPropsTest.java | 6 +-
.../camel/component/jetty/HttpsRouteTest.java | 10 +---
.../camel/component/jetty/JettyEnableJmxTest.java | 15 +++--
.../component/jetty/JettyWithXPathChoiceTest.java | 6 +-
.../camel/component/jetty/MainHttpsRouteTest.java | 10 +---
.../jetty/file/JettyHttpFileCacheTest.java | 6 +-
.../component/jgroups/JGroupsComponentTest.java | 5 +-
.../JGroupsComponentWithChannelPropertiesTest.java | 5 +-
.../component/jgroups/JGroupsConsumerTest.java | 5 +-
.../component/jgroups/JGroupsProducerTest.java | 5 +-
.../spring/tx/AbstractTransactionIT.java | 5 +-
.../tx/JMSTransactionThrottlingRoutePolicyIT.java | 3 +-
.../camel/component/scp/ScpAlgorithmsTest.java | 8 ---
.../camel/component/scp/ScpServerTestSupport.java | 9 +--
.../jsonvalidator/FileValidatorRouteTest.java | 9 +--
.../Jt400ComponentDefaultConnectionPoolTest.java | 9 +--
...00ComponentDefaultSecureConnectionPoolTest.java | 9 +--
.../camel/component/jt400/Jt400ComponentTest.java | 8 +--
.../jt400/Jt400ConfigurationConnectionTest.java | 11 +---
.../Jt400ConfigurationSecureConnectionTest.java | 11 +---
.../component/jt400/Jt400ConfigurationTest.java | 5 +-
.../jt400/Jt400DataQueueProducerTest.java | 5 +-
.../camel/component/jt400/Jt400EndpointTest.java | 5 +-
.../component/jt400/Jt400PgmEndpointTest.java | 5 +-
.../component/jt400/Jt400SecureTestSupport.java | 8 +--
.../component/jt400/Jt400SrvPgmEndpointTest.java | 5 +-
.../camel/component/jt400/Jt400TestSupport.java | 8 +--
.../kubernetes/KubernetesTestSupport.java | 3 +-
.../ConfigMapPropertiesFunctionRouteTest.java | 4 +-
.../SecretPropertiesFunctionRouteTest.java | 4 +-
.../camel/component/kudu/AbstractKuduTest.java | 15 +++--
.../apache/camel/component/ldif/LdifRouteIT.java | 5 +-
...elDBAggregateConcurrentDifferentGroupsTest.java | 5 +-
.../LevelDBAggregateConcurrentSameGroupTest.java | 5 +-
.../LevelDBAggregateDiscardOnTimeoutTest.java | 5 +-
.../LevelDBAggregateForceCompletionHeaderTest.java | 5 +-
.../LevelDBAggregateLoadAndRecoverTest.java | 3 +-
.../LevelDBAggregateLoadConcurrentTest.java | 3 +-
.../leveldb/LevelDBAggregateLoadTest.java | 3 +-
...DBAggregateNotLostRemovedWhenConfirmedTest.java | 5 +-
.../leveldb/LevelDBAggregateNotLostTest.java | 5 +-
...ggregateRecoverDeadLetterChannelFailedTest.java | 6 +-
...velDBAggregateRecoverDeadLetterChannelTest.java | 6 +-
.../leveldb/LevelDBAggregateRecoverTest.java | 5 +-
...DBAggregateRecoverWithRedeliveryPolicyTest.java | 5 +-
.../LevelDBAggregateRecoverWithSedaTest.java | 6 +-
.../LevelDBAggregateSerializedHeadersTest.java | 3 +-
.../component/leveldb/LevelDBAggregateTest.java | 5 +-
...velDBAggregateTimeoutCompletionRestartTest.java | 5 +-
.../LevelDBAggregationRepositoryAlotDataTest.java | 10 +---
...velDBAggregationRepositoryLoadExistingTest.java | 10 +---
...velDBAggregationRepositoryMultipleRepoTest.java | 10 +---
...DBAggregationRepositoryRecoverExistingTest.java | 5 +-
.../leveldb/LevelDBAggregationRepositoryTest.java | 10 +---
.../leveldb/LevelDBBigPayloadManualTest.java | 3 +-
.../camel/component/leveldb/LevelDBBinaryTest.java | 5 +-
.../leveldb/LevelDBCustomSerializationTest.java | 5 +-
.../leveldb/LevelDBExchangeSerializationTest.java | 10 +---
.../component/leveldb/LevelDBGetNotFoundTest.java | 10 +---
.../camel/component/leveldb/LevelDBSetupTest.java | 8 +--
...ngAggregateRecoverWithRedeliveryPolicyTest.java | 6 +-
.../leveldb/LevelDBSpringAggregateTest.java | 6 +-
.../component/mail/MailAttachmentNamesTest.java | 14 +++--
.../component/mail/MailBatchConsumerTest.java | 5 +-
.../component/mail/MailCommitOnCompletionTest.java | 5 +-
.../camel/component/mail/MailConvertersTest.java | 5 +-
.../camel/component/mail/MailCopyToTest.java | 5 +-
.../mail/MailDoNotDeleteIfProcessFailsTest.java | 5 +-
.../camel/component/mail/MailFetchSizeTest.java | 5 +-
.../component/mail/MailFetchSizeZeroTest.java | 5 +-
.../MailIdempotentRepositoryDuplicateTest.java | 5 +-
.../mail/MailIdempotentRepositoryTest.java | 5 +-
.../component/mail/MailMaxMessagesPerPollTest.java | 5 +-
.../camel/component/mail/MailMessageTest.java | 5 +-
.../camel/component/mail/MailMoveToTest.java | 5 +-
.../component/mail/MailPollEnrichNoMailTest.java | 5 +-
.../camel/component/mail/MailPollEnrichTest.java | 5 +-
.../component/mail/MailPostProcessActionTest.java | 5 +-
.../mail/MailProcessOnlyUnseenMessagesTest.java | 5 +-
.../camel/component/mail/MailSearchTermTest.java | 5 +-
.../MailSearchTermUriConfigLast24HoursTest.java | 5 +-
.../mail/MailSearchTermUriConfigTest.java | 5 +-
.../mail/MailShutdownCompleteAllTasksTest.java | 5 +-
.../MailShutdownCompleteCurrentTaskOnlyTest.java | 5 +-
.../camel/component/mail/MailSortTermTest.java | 5 +-
.../component/mail/MailSortTermThreeTest.java | 5 +-
.../camel/component/mail/MailSortTermTwoTest.java | 5 +-
.../component/mail/MailUsingCustomSessionTest.java | 5 +-
.../mail/MultipleDestinationConsumeTest.java | 6 +-
.../camel/component/mail/RawMailMessageTest.java | 5 +-
.../multipart/MimeMultipartDataFormatTest.java | 5 +-
.../camel/component/metrics/CounterRouteTest.java | 5 +-
.../component/metrics/HistogramRouteTest.java | 5 +-
.../camel/component/metrics/MeterRouteTest.java | 5 +-
.../camel/component/metrics/TimerRouteTest.java | 5 +-
.../component/micrometer/CounterRouteTest.java | 5 +-
.../camel/component/micrometer/TimerRouteTest.java | 5 +-
.../CamelMicroProfilePropertiesSourceTest.java | 5 +-
.../health/CamelMicroProfileHealthTestSupport.java | 5 +-
.../camel/component/mina/MinaFiltersTest.java | 5 +-
...tProducerEndOfDataAndValidationTestSupport.java | 4 +-
...rConsumerEndOfDataAndValidationTestSupport.java | 6 +-
.../integration/AbstractMongoDbITSupport.java | 5 +-
.../mybatis/MyBatisShutdownAllTasksTest.java | 6 +-
.../MyBatisShutdownCurrentTaskOnlyTest.java | 6 +-
.../component/mybatis/MyBatisTestSupport.java | 4 +-
.../NettyHttpBasicAuthConstraintMapperTest.java | 10 +---
.../netty/http/NettyHttpBasicAuthTest.java | 10 +---
.../component/netty/http/NettyHttpSSLTest.java | 11 +---
...ttyHttpSimpleBasicAuthConstraintMapperTest.java | 10 +---
.../netty/http/NettyHttpSimpleBasicAuthTest.java | 10 +---
.../http/NettyHttpStreamCacheFileResponseTest.java | 5 +-
.../netty/http/NettySharedHttpServerTest.java | 5 +-
.../camel/component/netty/NettyConverterTest.java | 4 +-
.../camel/component/netty/NettyRedeliveryTest.java | 5 +-
...ttyUseSharedWorkerThreadPoolManyRoutesTest.java | 10 +---
.../mqtt5/PahoMqtt5ReconnectAfterFailureIT.java | 5 +-
.../paho/mqtt5/PahoMqtt5SendDynamicAwareTest.java | 5 +-
.../apache/camel/component/pdf/PdfAppendTest.java | 7 ---
.../camel/component/pdf/PdfCreationTest.java | 7 ---
.../slot/integration/PgReplicationSlotCamelIT.java | 9 +--
.../camel/component/printer/PrinterPrintTest.java | 5 +-
.../component/pulsar/PulsarComponentTest.java | 5 +-
.../quartz/FromFileQuartzSchedulerTest.java | 5 +-
.../component/quartz/QuartzPropertiesTest.java | 5 +-
.../quickfixj/QuickfixjConvertersTest.java | 12 +---
.../rocketmq/RocketMQRequestReplyRouteIT.java | 8 +--
.../camel/component/rocketmq/RocketMQRouteIT.java | 8 ---
.../camel/dataformat/rss/RssDataFormatTest.java | 5 +-
.../saxon/XPathSplitChoicePerformanceTest.java | 5 +-
.../camel/builder/saxon/XQueryFilterTest.java | 6 +-
.../builder/saxon/XQueryRecipientListTest.java | 6 +-
.../camel/builder/saxon/XQueryTransformTest.java | 6 +-
.../builder/saxon/XQueryTransformTextTest.java | 6 +-
.../saxon/XQueryWithNamespacesFilterTest.java | 6 +-
.../xquery/XQueryWithExplicitTypeTest.java | 6 +-
.../camel/converter/saxon/SaxonConverterTest.java | 5 +-
.../xpath/XPathLanguageDefaultSettingsTest.java | 5 +-
.../camel/language/xpath/XPathLanguageTest.java | 5 +-
.../servlet/HttpClientRouteExampleSpringTest.java | 6 +-
.../servlet/HttpClientRouteSpringTest.java | 5 +-
.../servlet/ServletCamelRouterTestSupport.java | 18 ++----
.../component/sjms/SjmsSendDynamicAwareTest.java | 6 +-
.../producer/InOutQueueProducerAsyncLoadTest.java | 10 +---
.../producer/InOutQueueProducerSyncLoadTest.java | 10 +---
.../sjms/support/JmsCommonTestSupport.java | 5 +-
.../component/sjms2/support/Jms2TestSupport.java | 4 +-
.../camel/component/slack/SlackConsumerTest.java | 5 +-
.../component/spring/batch/SpringBatchIT.java | 6 +-
.../spring/batch/SpringBatchJobLauncherIT.java | 4 +-
.../spring/jdbc/AbstractJdbcTestSupport.java | 11 +---
.../springldap/SpringLdapProducerTest.java | 5 +-
.../SpringRabbitMQSendDynamicAwareTest.java | 6 +-
.../spring/ws/ConsumerBreadcrumbIdTest.java | 5 +-
...ConsumerEndpointMappingByBeanNameRouteTest.java | 5 +-
...erEndpointMappingResponseHandlingRouteTest.java | 5 +-
.../ws/ConsumerEndpointMappingRouteTest.java | 5 +-
.../ws/ConsumerExceptionPropagationRouteTest.java | 4 +-
.../spring/ws/ConsumerMarshallingRouteTest.java | 5 +-
.../spring/ws/addressing/AbstractWSATests.java | 5 +-
.../ws/addressing/CamelDirectSenderTest.java | 5 +-
.../ConsumerWSAEndpointMappingRouteTest.java | 5 +-
.../ws/addressing/ProducerParamsBasicTest.java | 5 +-
.../addressing/ProducerParamsPrecedenceTest.java | 5 +-
.../ProducerWss4JSecurityHeaderManualTest.java | 5 +-
.../component/sql/CamelSqlEmptyResultTest.java | 11 +---
.../camel/component/sql/SqlAggregateBatchTest.java | 11 +---
.../sql/SqlConsumerDeleteBatchCompleteTest.java | 11 +---
.../component/sql/SqlConsumerDeleteFailedTest.java | 11 +---
.../camel/component/sql/SqlConsumerDeleteTest.java | 11 +---
.../sql/SqlConsumerDeleteTransformTest.java | 11 +---
.../sql/SqlConsumerDynamicParameterTest.java | 11 +---
.../sql/SqlConsumerMaxMessagesPerPollTest.java | 11 +---
.../sql/SqlConsumerOutputTypeSelectListTest.java | 11 +---
...lConsumerOutputTypeSelectListWithClassTest.java | 11 +---
.../sql/SqlConsumerOutputTypeStreamListTest.java | 11 +---
.../camel/component/sql/SqlConsumerTest.java | 11 +---
.../camel/component/sql/SqlDataSourceRefTest.java | 5 +-
.../camel/component/sql/SqlDataSourceTest.java | 5 +-
.../camel/component/sql/SqlEndpointLikeTest.java | 5 +-
.../sql/SqlEndpointMisconfigureDataSourceTest.java | 11 +---
.../camel/component/sql/SqlEndpointTest.java | 11 +---
.../component/sql/SqlGeneratedKeysInLoopTest.java | 10 +---
.../camel/component/sql/SqlGeneratedKeysTest.java | 10 +---
.../camel/component/sql/SqlPreserveHeaderTest.java | 11 +---
...qlProducerAlwaysPopulateStatementFalseTest.java | 11 +---
.../SqlProducerAlwaysPopulateStatementTest.java | 11 +---
.../camel/component/sql/SqlProducerAndInTest.java | 11 +---
.../component/sql/SqlProducerConcurrentTest.java | 11 +---
.../sql/SqlProducerExpressionParameterTest.java | 11 +---
.../component/sql/SqlProducerInMultiTest.java | 11 +---
.../camel/component/sql/SqlProducerInTest.java | 11 +---
.../component/sql/SqlProducerInVariablesTest.java | 11 +---
.../component/sql/SqlProducerInsertNullTest.java | 11 +---
.../camel/component/sql/SqlProducerJSONTest.java | 11 +---
.../sql/SqlProducerNamedParameterNotExistTest.java | 11 +---
.../sql/SqlProducerNamedParameterTest.java | 11 +---
.../sql/SqlProducerNamedParametersTest.java | 11 +---
.../camel/component/sql/SqlProducerNoopTest.java | 11 +---
.../sql/SqlProducerNullBodyHeaderTest.java | 11 +---
.../component/sql/SqlProducerNullBodyTest.java | 11 +---
.../component/sql/SqlProducerOutputHeaderTest.java | 11 +---
.../sql/SqlProducerOutputHeaderWithQueryTest.java | 11 +---
.../sql/SqlProducerOutputTypeSelectListTest.java | 11 +---
...lProducerOutputTypeSelectListWithClassTest.java | 11 +---
...SqlProducerOutputTypeSelectOneNoResultTest.java | 11 +---
.../sql/SqlProducerOutputTypeStreamListTest.java | 11 +---
.../sql/SqlProducerParametersCountTest.java | 11 +---
.../sql/SqlProducerReuseParameterTest.java | 11 +---
.../component/sql/SqlProducerSeparatorTest.java | 11 +---
.../camel/component/sql/SqlProducerToDTest.java | 11 +---
.../sql/SqlProducerUseMessageBodyForSqlTest.java | 11 +---
.../component/sql/SqlProducerWhereIssueTest.java | 11 +---
.../apache/camel/component/sql/SqlRouteTest.java | 11 +---
.../component/sql/SqlTransactedRouteTest.java | 11 +---
.../sql/stored/CallableStatementWrapperTest.java | 11 ++--
.../sql/stored/ProducerBatchInvalidTest.java | 12 ++--
.../component/sql/stored/ProducerBatchTest.java | 12 ++--
.../sql/stored/ProducerBodyArrayTest.java | 12 ++--
.../component/sql/stored/ProducerInOutTest.java | 12 ++--
.../camel/component/sql/stored/ProducerTest.java | 12 ++--
.../ProducerUseMessageBodyForTemplateTest.java | 12 ++--
.../sql/stored/SqlFunctionDataSourceTest.java | 12 ++--
.../sql/stored/SqlStoredDataSourceTest.java | 5 +-
.../component/sql/stored/TemplateCacheTest.java | 12 ++--
.../CustomizedJdbcMessageIdRepositoryTest.java | 6 +-
.../jdbc/JdbcCachedMessageIdRepositoryTest.java | 6 +-
...JdbcMessageIdRepositoryCustomTableNameTest.java | 6 +-
.../jdbc/JdbcMessageIdRepositoryTest.java | 6 +-
.../component/ssh/SshComponentTestSupport.java | 13 +----
.../StAXXPathSplitChoicePerformanceManualTest.java | 5 +-
.../component/stream/ScanStreamDelayTest.java | 6 +-
.../component/stream/ScanStreamFileManualTest.java | 6 +-
.../camel/component/stream/ScanStreamFileTest.java | 6 +-
.../stream/ScanStreamFileWithFilterTest.java | 6 +-
.../component/stream/SplitStreamFileTest.java | 6 +-
.../camel/component/stream/StreamFileTest.java | 6 +-
.../component/stream/StreamGroupLinesTest.java | 6 +-
.../StringTemplateContentCacheTest.java | 6 +-
.../tarfile/SpringTarFileDataFormatTest.java | 5 +-
.../dataformat/tarfile/TarFileDataFormatTest.java | 5 +-
.../tarfile/TarFileSplitAndDeleteTest.java | 5 +-
.../tarfile/TarSplitterRouteIssueTest.java | 5 +-
.../AggregationStrategyWithFilenameHeaderTest.java | 5 +-
.../AggregationStrategyWithPreservationTest.java | 5 +-
.../TarAggregationStrategyEmptyFirstFileTest.java | 5 +-
.../tarfile/TarAggregationStrategyTest.java | 5 +-
.../thymeleaf/ThymeleafContentCacheTest.java | 7 +--
...ymeleafWebApplicationResolverAllParamsTest.java | 8 +--
.../ThymeleafWebApplicationResolverTest.java | 8 +--
.../component/twitter/DirectMessageDirectIT.java | 5 +-
.../component/twitter/DirectMessagePollingIT.java | 6 +-
.../velocity/VelocityContentCacheTest.java | 6 +-
.../component/web3j/Web3jMockTestSupport.java | 5 +-
.../component/xmlsecurity/ECDSASignatureTest.java | 11 +---
.../xmlsecurity/SignatureAlgorithmTest.java | 5 +-
.../xmlsecurity/SignatureDigestMethodTest.java | 5 +-
.../xmlsecurity/XAdESSignaturePropertiesTest.java | 5 +-
.../component/xmlsecurity/XmlSignatureTest.java | 5 +-
.../xmlsecurity/EncryptionAlgorithmTest.java | 5 +-
.../xmlsecurity/XMLEncryption11Test.java | 5 +-
.../xmlsecurity/XMLSecurityDataFormatTest.java | 5 +-
.../deflater/GzipDataFormatFileDeleteTest.java | 5 +-
.../GzipDataFormatFileUnmarshalDeleteTest.java | 5 +-
.../ZipDeflaterDataFormatFileDeleteTest.java | 5 +-
...pDeflaterDataFormatFileUnmarshalDeleteTest.java | 5 +-
.../dataformat/zipfile/ZipFileDataFormatTest.java | 5 +-
.../zipfile/ZipFileSplitAndDeleteTest.java | 5 +-
.../zipfile/ZipFileSplitOneFileTest.java | 5 +-
.../zipfile/ZipSplitterRouteIssueTest.java | 5 +-
.../AggregationStrategyWithFilenameHeaderTest.java | 5 +-
.../AggregationStrategyWithPreservationTest.java | 5 +-
.../ZipAggregationStrategyEmptyFileTest.java | 5 +-
.../zipfile/ZipAggregationStrategySplitTest.java | 5 +-
.../zipfile/ZipAggregationStrategyTest.java | 5 +-
.../integration/ZooKeeperServiceCallRouteIT.java | 4 +-
.../ZooKeeperServiceRegistrationITBase.java | 6 +-
.../FileBatchConsumerMemoryLeakManualTest.java | 5 +-
.../builder/endpoint/FileConsumeCharsetTest.java | 9 +--
.../camel/builder/endpoint/FileDelayTest.java | 9 +--
.../FtpCronScheduledRoutePolicyManualTest.java | 8 +--
.../FromJmsToJdbcIdempotentConsumerToJmsTest.java | 4 +-
...FromJmsToJdbcIdempotentConsumerToJmsXaTest.java | 12 +---
.../itest/validator/ValidatorSchemaImportTest.java | 3 +-
537 files changed, 836 insertions(+), 2701 deletions(-)
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroConsumerTestSupport.java b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroConsumerTestSupport.java
index b127455ba7a..3f8585680bf 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroConsumerTestSupport.java
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroConsumerTestSupport.java
@@ -27,7 +27,6 @@ import org.apache.camel.avro.impl.KeyValueProtocolImpl;
import org.apache.camel.avro.test.TestPojo;
import org.apache.camel.avro.test.TestReflection;
import org.apache.camel.avro.test.TestReflectionImpl;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
@@ -59,10 +58,7 @@ public abstract class AvroConsumerTestSupport extends AvroTestSupport {
protected abstract void initializeTranceiver() throws IOException;
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
-
+ public void doPostTearDown() throws Exception {
if (transceiver != null) {
transceiver.close();
}
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroHttpSpringProducerTest.java b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroHttpSpringProducerTest.java
index 2c2ef7e2e29..d2d02f84079 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroHttpSpringProducerTest.java
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroHttpSpringProducerTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.avro;
import org.apache.camel.CamelContext;
import org.apache.camel.spring.SpringCamelContext;
import org.apache.camel.util.IOHelper;
-import org.junit.jupiter.api.AfterEach;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -28,9 +27,7 @@ public class AvroHttpSpringProducerTest extends AvroHttpProducerTest {
private AbstractApplicationContext applicationContext;
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
IOHelper.close(applicationContext);
}
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringConsumerTest.java b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringConsumerTest.java
index 15e36080dde..ced4b99d700 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringConsumerTest.java
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringConsumerTest.java
@@ -21,8 +21,6 @@ import org.apache.camel.avro.impl.KeyValueProtocolImpl;
import org.apache.camel.avro.test.TestReflectionImpl;
import org.apache.camel.spring.SpringCamelContext;
import org.apache.camel.util.IOHelper;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -31,18 +29,13 @@ public class AvroNettySpringConsumerTest extends AvroNettyConsumerTest {
private AbstractApplicationContext applicationContext;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() {
keyValue = (KeyValueProtocolImpl) applicationContext.getBean("keyValue");
testReflection = (TestReflectionImpl) applicationContext.getBean("testReflection");
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
IOHelper.close(applicationContext);
}
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringProducerTest.java b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringProducerTest.java
index aa3b79d035a..cd26e0cba68 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringProducerTest.java
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroNettySpringProducerTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.avro;
import org.apache.camel.CamelContext;
import org.apache.camel.spring.SpringCamelContext;
import org.apache.camel.util.IOHelper;
-import org.junit.jupiter.api.AfterEach;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -28,9 +27,7 @@ public class AvroNettySpringProducerTest extends AvroNettyProducerTest {
private AbstractApplicationContext applicationContext;
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
IOHelper.close(applicationContext);
}
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroProducerTestSupport.java b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroProducerTestSupport.java
index c42548d3a9e..2645b9cbfd7 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroProducerTestSupport.java
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/test/java/org/apache/camel/component/avro/AvroProducerTestSupport.java
@@ -24,7 +24,6 @@ import org.apache.camel.avro.generated.Value;
import org.apache.camel.avro.impl.KeyValueProtocolImpl;
import org.apache.camel.avro.test.TestReflectionImpl;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -46,10 +45,7 @@ public abstract class AvroProducerTestSupport extends AvroTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
-
+ public void doPostTearDown() {
if (server != null) {
server.close();
}
diff --git a/components/camel-avro/src/test/java/org/apache/camel/dataformat/avro/AvroGenericMarshalAndUnmarshalTest.java b/components/camel-avro/src/test/java/org/apache/camel/dataformat/avro/AvroGenericMarshalAndUnmarshalTest.java
index 9b02ac83e6b..cff3db9f00b 100644
--- a/components/camel-avro/src/test/java/org/apache/camel/dataformat/avro/AvroGenericMarshalAndUnmarshalTest.java
+++ b/components/camel-avro/src/test/java/org/apache/camel/dataformat/avro/AvroGenericMarshalAndUnmarshalTest.java
@@ -25,7 +25,6 @@ import org.apache.avro.generic.GenericRecord;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -36,10 +35,8 @@ public class AvroGenericMarshalAndUnmarshalTest extends CamelTestSupport {
private Schema schema;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
schema = getSchema();
- super.setUp();
}
@Test
diff --git a/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java b/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
index 7cf39175aa2..2dbd7855cfa 100644
--- a/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
+++ b/components/camel-aws/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
@@ -24,8 +24,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.component.aws.xray.TestDataBuilder.TestTrace;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -44,15 +42,13 @@ public class SpringAwsXRaySimpleRouteTest extends CamelSpringTestSupport {
return new ClassPathXmlApplicationContext("org/apache/camel/aws/xray/AwsXRaySimpleRouteTest.xml");
}
- @BeforeEach
- public void setUp() throws Exception {
+ @Override
+ public void doPreSetup() {
socketListener.before();
- super.setUp();
}
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ @Override
+ public void doPostTearDown() {
socketListener.after();
}
diff --git a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
index dae99619702..91e74090c4b 100644
--- a/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
+++ b/components/camel-aws/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
@@ -21,7 +21,6 @@ import java.util.List;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -36,10 +35,7 @@ public class SesComponentSpringTest extends CamelSpringTestSupport {
private AmazonSESClientMock sesClient;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() {
sesClient = context.getRegistry().lookupByNameAndType("amazonSESClient", AmazonSESClientMock.class);
}
diff --git a/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbClientOperationsIT.java b/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbClientOperationsIT.java
index 98c0fe2797a..5fe02330f6f 100644
--- a/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbClientOperationsIT.java
+++ b/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbClientOperationsIT.java
@@ -62,7 +62,7 @@ class CosmosDbClientOperationsIT {
}
@AfterEach
- void tearDown() {
+ void cleanup() {
// delete all databases being used in the test after each test
clientWrapper.readAllDatabases()
.toIterable()
diff --git a/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbContainerOperationsIT.java b/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbContainerOperationsIT.java
index 8112b276068..b68d214b66b 100644
--- a/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbContainerOperationsIT.java
+++ b/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbContainerOperationsIT.java
@@ -79,7 +79,7 @@ class CosmosDbContainerOperationsIT {
}
@AfterAll
- void tearDown() {
+ void cleanup() {
clientWrapper.getDatabase(DATABASE_NAME).delete().block();
clientWrapper.getDatabase(LEASE_DATABASE_NAME).delete().block();
}
diff --git a/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbDatabaseOperationsIT.java b/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbDatabaseOperationsIT.java
index b6654ea2b11..4de1bc16927 100644
--- a/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbDatabaseOperationsIT.java
+++ b/components/camel-azure/camel-azure-cosmosdb/src/test/java/org/apache/camel/component/azure/cosmosdb/integration/operations/CosmosDbDatabaseOperationsIT.java
@@ -72,7 +72,7 @@ class CosmosDbDatabaseOperationsIT {
}
@AfterAll
- void tearDown() {
+ void cleanup() {
clientWrapper.getDatabase(DATABASE_NAME).delete().block();
}
diff --git a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsConsumerIT.java b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsConsumerIT.java
index bacd363466e..5403d6be97e 100644
--- a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsConsumerIT.java
+++ b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsConsumerIT.java
@@ -118,7 +118,7 @@ class EventHubsConsumerIT extends CamelTestSupport {
}
@AfterAll
- public void tearDown() {
+ public void cleanup() {
// delete testing container
containerAsyncClient.delete().block();
}
diff --git a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerCustomClientIT.java b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerCustomClientIT.java
index 84d9b19f2c9..222cb7223f5 100644
--- a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerCustomClientIT.java
+++ b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerCustomClientIT.java
@@ -70,7 +70,7 @@ class EventHubsProducerCustomClientIT extends CamelTestSupport {
}
@AfterAll
- public void tearDown() {
+ public void cleanup() {
if (consumerAsyncClient != null) {
consumerAsyncClient.close();
}
diff --git a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerIT.java b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerIT.java
index 097ae11d8fd..acf052f15b5 100644
--- a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerIT.java
+++ b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventHubsProducerIT.java
@@ -127,7 +127,7 @@ class EventHubsProducerIT extends CamelTestSupport {
}
@AfterAll
- public void tearDown() {
+ public void cleanup() {
consumerAsyncClient.close();
}
diff --git a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventProcessorIT.java b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventProcessorIT.java
index 371b02a4259..54a5f001cc7 100644
--- a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventProcessorIT.java
+++ b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/EventProcessorIT.java
@@ -109,7 +109,7 @@ public class EventProcessorIT {
}
@AfterAll
- public void tearDown() {
+ public void cleanup() {
containerAsyncClient.delete().block();
}
}
diff --git a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/operations/EventHubsProducerOperationsIT.java b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/operations/EventHubsProducerOperationsIT.java
index ad9cca3e2e0..a152acdcd9b 100644
--- a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/operations/EventHubsProducerOperationsIT.java
+++ b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/integration/operations/EventHubsProducerOperationsIT.java
@@ -185,7 +185,7 @@ class EventHubsProducerOperationsIT extends CamelTestSupport {
}
@AfterAll
- public void tearDown() {
+ public void cleanup() {
producerAsyncClient.close();
consumerAsyncClient.close();
}
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueOperationsIT.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueOperationsIT.java
index c8f79669dbe..f2c3feb3a48 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueOperationsIT.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueOperationsIT.java
@@ -238,7 +238,7 @@ class QueueOperationsIT extends CamelTestSupport {
}
@AfterAll
- public void tearDown() {
+ public void cleanup() {
// make sure to clean everything
final List<QueueItem> queues = serviceClientWrapper.listQueues(null, null);
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueServiceOperationsIT.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueServiceOperationsIT.java
index 9fcd0b2cf31..4da6c86b759 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueServiceOperationsIT.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/operations/integration/QueueServiceOperationsIT.java
@@ -93,7 +93,7 @@ class QueueServiceOperationsIT {
}
@AfterAll
- public void tearDown() {
+ public void cleanup() {
final QueueServiceClient client = QueueClientFactory.createQueueServiceClient(configuration);
client.deleteQueue(queueName1);
diff --git a/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/BeanValidatorConfigurationTest.java b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/BeanValidatorConfigurationTest.java
index c3d8beda559..74d0798c503 100644
--- a/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/BeanValidatorConfigurationTest.java
+++ b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/BeanValidatorConfigurationTest.java
@@ -28,7 +28,6 @@ import jakarta.validation.TraversableResolver;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
@@ -48,13 +47,10 @@ public class BeanValidatorConfigurationTest extends CamelTestSupport {
private ConstraintValidatorFactory constraintValidatorFactory;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
this.messageInterpolator = new MyMessageInterpolator();
this.traversableResolver = new MyTraversableResolver();
this.constraintValidatorFactory = new MyConstraintValidatorFactory();
-
- super.setUp();
}
@Test
diff --git a/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryAutowireTest.java b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryAutowireTest.java
index ed070a10fb9..a5ada810688 100644
--- a/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryAutowireTest.java
+++ b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryAutowireTest.java
@@ -22,7 +22,6 @@ import jakarta.validation.bootstrap.GenericBootstrap;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
@@ -36,14 +35,11 @@ public class ValidatorFactoryAutowireTest extends CamelTestSupport {
private ValidatorFactory validatorFactory;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
GenericBootstrap bootstrap = Validation.byDefaultProvider();
bootstrap.providerResolver(new HibernateValidationProviderResolver());
this.validatorFactory = bootstrap.configure().buildValidatorFactory();
-
- super.setUp();
}
@Test
diff --git a/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryRegistryTest.java b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryRegistryTest.java
index 798072b0baa..d409c99a2fa 100644
--- a/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryRegistryTest.java
+++ b/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/ValidatorFactoryRegistryTest.java
@@ -22,7 +22,6 @@ import jakarta.validation.bootstrap.GenericBootstrap;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
@@ -39,15 +38,12 @@ public class ValidatorFactoryRegistryTest extends CamelTestSupport {
private ValidatorFactory otherValidatorFactory;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
GenericBootstrap bootstrap = Validation.byDefaultProvider();
bootstrap.providerResolver(new HibernateValidationProviderResolver());
this.validatorFactory = bootstrap.configure().buildValidatorFactory();
this.otherValidatorFactory = bootstrap.configure().buildValidatorFactory();
-
- super.setUp();
}
@Test
diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddressGatewayIT.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddressGatewayIT.java
index ba32659c1fc..509a370c717 100644
--- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddressGatewayIT.java
+++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddressGatewayIT.java
@@ -29,7 +29,6 @@ import com.braintreegateway.Result;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.braintree.internal.AddressGatewayApiMethod;
import org.apache.camel.component.braintree.internal.BraintreeApiCollection;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.slf4j.Logger;
@@ -73,8 +72,7 @@ public class AddressGatewayIT extends AbstractBraintreeTestSupport {
}
@Override
- @AfterEach
- public void tearDown() {
+ public void doPostTearDown() {
if (this.gateway != null && customer != null) {
for (String id : this.addressIds) {
if (this.gateway.address().delete(customer.getId(), id).isSuccess()) {
diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodGatewayIT.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodGatewayIT.java
index b79ea461d12..b6b03c530e7 100644
--- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodGatewayIT.java
+++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodGatewayIT.java
@@ -28,7 +28,6 @@ import com.braintreegateway.PaymentMethodRequest;
import com.braintreegateway.Result;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.braintree.internal.PaymentMethodGatewayApiMethod;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.slf4j.Logger;
@@ -72,8 +71,7 @@ public class PaymentMethodGatewayIT extends AbstractBraintreeTestSupport {
}
@Override
- @AfterEach
- public void tearDown() {
+ public void doPostTearDown() {
if (this.gateway != null) {
for (String token : this.paymentMethodsTokens) {
if (this.gateway.paymentMethod().delete(token).isSuccess()) {
diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/TransactionGatewayIT.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/TransactionGatewayIT.java
index afef825b85b..701c7caceed 100644
--- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/TransactionGatewayIT.java
+++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/TransactionGatewayIT.java
@@ -31,7 +31,6 @@ import com.braintreegateway.TransactionRequest;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.braintree.internal.BraintreeApiCollection;
import org.apache.camel.component.braintree.internal.TransactionGatewayApiMethod;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
@@ -66,8 +65,7 @@ public class TransactionGatewayIT extends AbstractBraintreeTestSupport {
}
@Override
- @AfterEach
- public void tearDown() {
+ public void doPostTearDown() {
if (this.gateway != null) {
for (String token : this.transactionIds) {
// TODO: cleanup
diff --git a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/processor/aggregate/CaffeineAggregationRepositoryOperationTest.java b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/processor/aggregate/CaffeineAggregationRepositoryOperationTest.java
index 3a146d7cc8b..0d22ae8f52b 100644
--- a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/processor/aggregate/CaffeineAggregationRepositoryOperationTest.java
+++ b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/processor/aggregate/CaffeineAggregationRepositoryOperationTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.support.DefaultExchangeHolder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -43,10 +42,8 @@ public class CaffeineAggregationRepositoryOperationTest extends CamelTestSupport
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
aggregationRepository.stop();
- super.tearDown();
}
private boolean exists(String key) {
diff --git a/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPTestSupport.java b/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPTestSupport.java
index bb08c69d0b2..46403db22bc 100644
--- a/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPTestSupport.java
+++ b/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPTestSupport.java
@@ -21,16 +21,13 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.util.FileUtil;
import org.eclipse.californium.core.CoapClient;
import org.eclipse.californium.elements.config.Configuration;
-import org.junit.jupiter.api.BeforeEach;
public class CoAPTestSupport extends CamelTestSupport {
protected static final int PORT = AvailablePortFinder.getNextAvailable();
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
Configuration.createStandardWithoutFile();
}
diff --git a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/CometdProducerConsumerTest.java b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/CometdProducerConsumerTest.java
index 68c19fa5986..ca3db868a77 100644
--- a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/CometdProducerConsumerTest.java
+++ b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/CometdProducerConsumerTest.java
@@ -30,7 +30,6 @@ import org.cometd.bayeux.server.SecurityPolicy;
import org.cometd.bayeux.server.ServerChannel;
import org.cometd.bayeux.server.ServerMessage;
import org.cometd.bayeux.server.ServerSession;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -117,13 +116,10 @@ public class CometdProducerConsumerTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
port = AvailablePortFinder.getNextAvailable();
uri = "cometd://127.0.0.1:" + port + "/service/test?baseResource=file:./target/test-classes/webapp&"
+ "timeout=240000&interval=0&maxInterval=30000&multiFrameInterval=1500&jsonCommented=true&sessionHeadersEnabled=true&logLevel=2";
-
- super.setUp();
}
@Override
diff --git a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/MultipCometdProducerConsumerTest.java b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/MultipCometdProducerConsumerTest.java
index 4ee71ac837c..930149c13c3 100644
--- a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/MultipCometdProducerConsumerTest.java
+++ b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/MultipCometdProducerConsumerTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
@@ -48,8 +47,7 @@ public class MultipCometdProducerConsumerTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
port1 = AvailablePortFinder.getNextAvailable();
port2 = AvailablePortFinder.getNextAvailable();
uri1 = "cometd://127.0.0.1:" + port1 + "/service/test?baseResource=file:./target/test-classes/webapp&"
@@ -57,7 +55,6 @@ public class MultipCometdProducerConsumerTest extends CamelTestSupport {
uri2 = "cometd://127.0.0.1:" + port2 + "/service/test?baseResource=file:./target/test-classes/webapp&"
+ "timeout=240000&interval=0&maxInterval=30000&multiFrameInterval=1500&jsonCommented=true&logLevel=2";
- super.setUp();
}
@Override
diff --git a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslCometdProducerConsumerTest.java b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslCometdProducerConsumerTest.java
index 32b34594add..eceb860693b 100644
--- a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslCometdProducerConsumerTest.java
+++ b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslCometdProducerConsumerTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -52,13 +51,10 @@ public class SslCometdProducerConsumerTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
port = AvailablePortFinder.getNextAvailable();
uri = "cometds://127.0.0.1:" + port + "/service/test?baseResource=file:./target/test-classes/webapp&"
+ "timeout=240000&interval=0&maxInterval=30000&multiFrameInterval=1500&jsonCommented=true&logLevel=2";
-
- super.setUp();
}
@Override
diff --git a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersCometdProducerConsumerTest.java b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersCometdProducerConsumerTest.java
index 76560ab5dc1..0c4c328654d 100644
--- a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersCometdProducerConsumerTest.java
+++ b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersCometdProducerConsumerTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.camel.support.jsse.TrustManagersParameters;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -54,13 +53,10 @@ public class SslContextParametersCometdProducerConsumerTest extends CamelTestSup
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
port = AvailablePortFinder.getNextAvailable();
uri = "cometds://127.0.0.1:" + port + "/service/test?baseResource=file:./target/test-classes/webapp&"
+ "timeout=240000&interval=0&maxInterval=30000&multiFrameInterval=1500&jsonCommented=true&logLevel=2";
-
- super.setUp();
}
@Override
diff --git a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersInUriCometdProducerConsumerTest.java b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersInUriCometdProducerConsumerTest.java
index bf1282081fc..73337a0f43d 100644
--- a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersInUriCometdProducerConsumerTest.java
+++ b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslContextParametersInUriCometdProducerConsumerTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.camel.support.jsse.TrustManagersParameters;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -75,12 +74,10 @@ public class SslContextParametersInUriCometdProducerConsumerTest extends CamelTe
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
port = AvailablePortFinder.getNextAvailable();
uri = "cometds://127.0.0.1:" + port + "/service/test?baseResource=file:./target/test-classes/webapp&"
+ "timeout=240000&interval=0&maxInterval=30000&multiFrameInterval=1500&jsonCommented=true&logLevel=2";
- super.setUp();
}
@Override
diff --git a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslGlobalContextParametersCometdProducerConsumerTest.java b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslGlobalContextParametersCometdProducerConsumerTest.java
index f501bc117a0..0f76d8e274c 100644
--- a/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslGlobalContextParametersCometdProducerConsumerTest.java
+++ b/components/camel-cometd/src/test/java/org/apache/camel/component/cometd/SslGlobalContextParametersCometdProducerConsumerTest.java
@@ -29,7 +29,6 @@ import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.camel.support.jsse.TrustManagersParameters;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -56,13 +55,10 @@ public class SslGlobalContextParametersCometdProducerConsumerTest extends CamelT
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
port = AvailablePortFinder.getNextAvailable();
uri = "cometds://127.0.0.1:" + port + "/service/test?baseResource=file:./target/test-classes/webapp&"
+ "timeout=240000&interval=0&maxInterval=30000&multiFrameInterval=1500&jsonCommented=true&logLevel=2";
-
- super.setUp();
}
@Override
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
index 9bc13449ebf..f8911f43c13 100644
--- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
@@ -21,7 +21,6 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -31,10 +30,8 @@ public class CouchbaseComponentTest extends CamelTestSupport {
private CouchbaseComponent component;
- @BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
component = context.getComponent("couchbase", CouchbaseComponent.class);
}
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/ECDSASignatureTest.java b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/ECDSASignatureTest.java
index e6e66fcd929..bc2f713ed97 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/ECDSASignatureTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/ECDSASignatureTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.slf4j.Logger;
@@ -128,10 +127,8 @@ public class ECDSASignatureTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
disableJMX();
- super.setUp();
}
}
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java
index 81352a05be6..343f3f08f76 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/component/crypto/SignatureTest.java
@@ -38,7 +38,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.support.jsse.KeyStoreParameters;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
@@ -389,11 +388,9 @@ public class SignatureTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
setUpKeys();
disableJMX();
- super.setUp();
}
public void setUpKeys() throws Exception {
diff --git a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
index 87e8f660d3a..becba92d8a5 100644
--- a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
+++ b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
@@ -35,8 +35,6 @@ import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -54,17 +52,13 @@ public class CxfRsConsumerSimpleBindingImplTest extends CamelTestSupport {
private CloseableHttpClient httpclient;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void setupResources() throws Exception {
httpclient = HttpClientBuilder.create().build();
jaxb = JAXBContext.newInstance(CustomerList.class, Customer.class, Order.class, Product.class);
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void cleanupResources() throws Exception {
httpclient.close();
}
diff --git a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
index f9fcca8c087..dd3473c9a2b 100644
--- a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
+++ b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
@@ -50,8 +50,6 @@ import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.io.entity.InputStreamEntity;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -72,17 +70,13 @@ public class CxfRsConsumerSimpleBindingTest extends CamelTestSupport {
private CloseableHttpClient httpclient;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
httpclient = HttpClientBuilder.create().build();
jaxb = JAXBContext.newInstance(CustomerList.class, Customer.class, Order.class, Product.class);
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
httpclient.close();
}
diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/CxfPayloadConverterTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/CxfPayloadConverterTest.java
index b2411659fd5..1e95eca72b8 100644
--- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/CxfPayloadConverterTest.java
+++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/CxfPayloadConverterTest.java
@@ -38,7 +38,6 @@ import org.apache.camel.StreamCache;
import org.apache.camel.component.cxf.common.CxfPayload;
import org.apache.camel.test.junit5.ExchangeTestSupport;
import org.apache.cxf.staxutils.StaxUtils;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
@@ -56,9 +55,7 @@ public class CxfPayloadConverterTest extends ExchangeTestSupport {
private FileInputStream inputStream;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void setupResources() throws Exception {
File file = new File("src/test/resources/org/apache/camel/component/cxf/converter/test.xml");
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfCustomizedExceptionTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfCustomizedExceptionTest.java
index a561d37f877..279ce254295 100644
--- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfCustomizedExceptionTest.java
+++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfCustomizedExceptionTest.java
@@ -43,8 +43,6 @@ import org.apache.cxf.binding.soap.SoapFault;
import org.apache.cxf.frontend.ClientFactoryBean;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.interceptor.Fault;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
@@ -78,18 +76,13 @@ public class CxfCustomizedExceptionTest extends CamelTestSupport {
private Bus bus;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void setupResources() {
bus = BusFactory.getDefaultBus();
- super.setUp();
-
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void cleanupResources() {
//TODO need to shutdown the server
- super.tearDown();
}
@Override
diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfMessageCustomizedExceptionTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfMessageCustomizedExceptionTest.java
index 02f426eb233..9dfdbc394b5 100644
--- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfMessageCustomizedExceptionTest.java
+++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfMessageCustomizedExceptionTest.java
@@ -16,17 +16,13 @@
*/
package org.apache.camel.component.cxf.jaxws;
-import org.junit.jupiter.api.BeforeEach;
-
/**
* Test for throwing the CustomizedException from Camel CXF consumer with MESSAGE DataFormat
*/
public class CxfMessageCustomizedExceptionTest extends CxfCustomizedExceptionTest {
- @BeforeEach
@Override
- public void setUp() throws Exception {
+ public void setupResources() {
routerEndpointURI = "cxf://" + routerAddress + "?" + SERVICE_CLASS + "&DataFormat=RAW";
- super.setUp();
}
}
diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfPayLoadCustomizedExceptionTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfPayLoadCustomizedExceptionTest.java
index 3eff61a2d37..811473d0a31 100644
--- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfPayLoadCustomizedExceptionTest.java
+++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfPayLoadCustomizedExceptionTest.java
@@ -16,18 +16,13 @@
*/
package org.apache.camel.component.cxf.jaxws;
-import org.junit.jupiter.api.BeforeEach;
-
/**
* Test for throwing the CustomizedException from Camel CXF consumer with PAYLOAD DataFormat
*/
public class CxfPayLoadCustomizedExceptionTest extends CxfCustomizedExceptionTest {
- @BeforeEach
@Override
- public void setUp() throws Exception {
+ public void setupResources() {
routerEndpointURI = "cxf://" + routerAddress + "?" + SERVICE_CLASS + "&DataFormat=PAYLOAD";
- super.setUp();
-
}
}
diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
index 87e8f660d3a..becba92d8a5 100644
--- a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
+++ b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
@@ -35,8 +35,6 @@ import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -54,17 +52,13 @@ public class CxfRsConsumerSimpleBindingImplTest extends CamelTestSupport {
private CloseableHttpClient httpclient;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void setupResources() throws Exception {
httpclient = HttpClientBuilder.create().build();
jaxb = JAXBContext.newInstance(CustomerList.class, Customer.class, Order.class, Product.class);
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void cleanupResources() throws Exception {
httpclient.close();
}
diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
index f9fcca8c087..736ba3f15ef 100644
--- a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
+++ b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
@@ -50,8 +50,6 @@ import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.io.entity.InputStreamEntity;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -72,17 +70,13 @@ public class CxfRsConsumerSimpleBindingTest extends CamelTestSupport {
private CloseableHttpClient httpclient;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void setupResources() throws Exception {
httpclient = HttpClientBuilder.create().build();
jaxb = JAXBContext.newInstance(CustomerList.class, Customer.class, Order.class, Product.class);
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void cleanupResources() throws Exception {
httpclient.close();
}
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java
index 4c3f62220d5..337473644c9 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.apache.camel.util.IOHelper;
import org.apache.hello_world_soap_http.Greeter;
import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -59,11 +58,8 @@ public abstract class AbstractCXFGreeterRouterTest extends CamelSpringTestSuppor
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
-
+ public void cleanupResources() {
IOHelper.close(applicationContext);
- super.tearDown();
}
@Test
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadFaultCauseEnabledTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadFaultCauseEnabledTest.java
index 26467401aaf..97ad72662ed 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadFaultCauseEnabledTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadFaultCauseEnabledTest.java
@@ -38,7 +38,6 @@ import org.apache.cxf.ext.logging.LoggingInInterceptor;
import org.apache.cxf.ext.logging.LoggingOutInterceptor;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.interceptor.Fault;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -56,10 +55,8 @@ public class CxfConsumerPayloadFaultCauseEnabledTest extends CamelSpringTestSupp
+ "/" + getClass().getSimpleName() + "/PersonService";
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void setupResources() {
CXFTestSupport.getPort1();
- super.setUp();
}
@Override
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java
index f4683953ac2..75ef154d5d8 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java
@@ -24,7 +24,7 @@ import org.apache.camel.component.cxf.spring.jaxws.CxfSpringEndpoint;
import org.apache.hello_world_soap_http.GreeterImpl;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -52,12 +52,8 @@ public class CxfGreeterPayLoadWithFeatureRouterTest extends AbstractCXFGreeterRo
endpoint = Endpoint.publish(address, implementor);
}
- @BeforeEach
- @Override
- public void setUp() throws Exception {
-
- super.setUp();
-
+ @Test
+ public void testResources() {
CxfEndpoint endpoint = getMandatoryEndpoint("cxf:bean:serviceEndpoint?dataFormat=PAYLOAD",
CxfEndpoint.class);
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadConsumerNamespaceOnEnvelopeTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadConsumerNamespaceOnEnvelopeTest.java
index 923c59fd1b6..64540b61c6f 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadConsumerNamespaceOnEnvelopeTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadConsumerNamespaceOnEnvelopeTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.cxf.common.CXFTestSupport;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.apache.camel.util.IOHelper;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -56,10 +55,8 @@ public class CxfPayloadConsumerNamespaceOnEnvelopeTest extends CamelSpringTestSu
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
IOHelper.close(applicationContext);
- super.tearDown();
}
@Override
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProducerNamespaceOnEnvelopeTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProducerNamespaceOnEnvelopeTest.java
index 8b72a71569c..b7f5c41e5fa 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProducerNamespaceOnEnvelopeTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProducerNamespaceOnEnvelopeTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.cxf.common.CXFTestSupport;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.apache.camel.util.IOHelper;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -55,10 +54,8 @@ public class CxfPayloadProducerNamespaceOnEnvelopeTest extends CamelSpringTestSu
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
IOHelper.close(applicationContext);
- super.tearDown();
}
@Override
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadRouterContentLengthTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadRouterContentLengthTest.java
index b668d9ba4d1..0a0dc527d4e 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadRouterContentLengthTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadRouterContentLengthTest.java
@@ -35,8 +35,6 @@ import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -80,8 +78,7 @@ public class CxfPayloadRouterContentLengthTest extends CamelSpringTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void setupResources() {
/*
* We start a undertow for the service in order to have better control over
* the response. The response must contain only a Content-Type and a
@@ -108,19 +105,16 @@ public class CxfPayloadRouterContentLengthTest extends CamelSpringTestSupport {
server.start();
// Load the CXF endpoints for the route
LOG.info("Start Routing Scenario at port {}", CXFTestSupport.getPort1());
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void cleanupResources() {
// close the spring context
IOHelper.close(applicationContext);
// stop the undertow server
if (server != null) {
server.stop();
}
- super.tearDown();
}
@Override
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringCustomizedExceptionTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringCustomizedExceptionTest.java
index 0a27f3629c8..cb2ba0fe3a3 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringCustomizedExceptionTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringCustomizedExceptionTest.java
@@ -29,8 +29,6 @@ import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.apache.camel.util.IOHelper;
import org.apache.cxf.binding.soap.SoapFault;
import org.apache.cxf.interceptor.Fault;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.springframework.context.support.AbstractApplicationContext;
@@ -57,18 +55,14 @@ public class CxfSpringCustomizedExceptionTest extends CamelSpringTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void setupResources() {
CXFTestSupport.getPort1();
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void cleanupResources() {
IOHelper.close(applicationContext);
- super.tearDown();
}
@Test
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java
index 358fe7c1c9e..eac96de1a9a 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfSpringRouterTest.java
@@ -69,19 +69,13 @@ public class CxfSpringRouterTest extends CamelSpringTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void setupResources() {
CXFTestSupport.getPort1();
- super.setUp();
-
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void cleanupResources() throws Exception {
// Don't close the application context, as it will cause some trouble on the bus shutdown
- super.tearDown();
-
}
@Override
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/converter/PayLoadConvertToPOJOTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/converter/PayLoadConvertToPOJOTest.java
index 074364e03db..2db79cf999a 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/converter/PayLoadConvertToPOJOTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/converter/PayLoadConvertToPOJOTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.non_wrapper.types.GetPersonResponse;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.apache.camel.util.IOHelper;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
@@ -47,10 +46,8 @@ public class PayLoadConvertToPOJOTest extends CamelSpringTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws Exception {
IOHelper.close(applicationContext);
- super.tearDown();
}
@Test
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/spring/FileToCxfMessageDataFormatTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/spring/FileToCxfMessageDataFormatTest.java
index 313a5a1f6c7..08cecf1faf1 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/spring/FileToCxfMessageDataFormatTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/spring/FileToCxfMessageDataFormatTest.java
@@ -24,8 +24,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.frontend.ServerFactoryBean;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,8 +41,7 @@ public class FileToCxfMessageDataFormatTest extends CamelSpringTestSupport {
private Server server;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void setupResources() {
deleteDirectory("target/filetocxf");
// set CXF
@@ -56,14 +53,10 @@ public class FileToCxfMessageDataFormatTest extends CamelSpringTestSupport {
server = factory.create();
server.start();
-
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void cleanupResources() {
server.stop();
server.destroy();
diff --git a/components/camel-cxf/camel-cxf-spring-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java b/components/camel-cxf/camel-cxf-spring-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
index a3ee472d9fb..baa955eadb8 100644
--- a/components/camel-cxf/camel-cxf-spring-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
+++ b/components/camel-cxf/camel-cxf-spring-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
@@ -31,8 +31,6 @@ import org.apache.cxf.transport.ConduitInitiatorManager;
import org.apache.cxf.transport.DestinationFactoryManager;
import org.apache.cxf.transport.MessageObserver;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.mockito.Mockito;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -47,9 +45,7 @@ public abstract class CamelTransportTestSupport extends CamelTestSupport {
protected Message inMessage;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
BusFactory bf = BusFactory.newInstance();
//setup the camel transport for the bus
bus = bf.createBus();
@@ -65,10 +61,8 @@ public abstract class CamelTransportTestSupport extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
bus.shutdown(true);
- super.tearDown();
}
protected CamelConduit setupCamelConduit(EndpointInfo endpointInfo, boolean send, boolean decoupled) {
diff --git a/components/camel-cxf/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java b/components/camel-cxf/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
index a3ee472d9fb..090dfc873f4 100644
--- a/components/camel-cxf/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
+++ b/components/camel-cxf/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
@@ -31,8 +31,6 @@ import org.apache.cxf.transport.ConduitInitiatorManager;
import org.apache.cxf.transport.DestinationFactoryManager;
import org.apache.cxf.transport.MessageObserver;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.mockito.Mockito;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -47,9 +45,7 @@ public abstract class CamelTransportTestSupport extends CamelTestSupport {
protected Message inMessage;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
BusFactory bf = BusFactory.newInstance();
//setup the camel transport for the bus
bus = bf.createBus();
@@ -65,10 +61,8 @@ public abstract class CamelTransportTestSupport extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws Exception {
bus.shutdown(true);
- super.tearDown();
}
protected CamelConduit setupCamelConduit(EndpointInfo endpointInfo, boolean send, boolean decoupled) {
diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/FileDisruptorShutdownCompleteAllTasksTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/FileDisruptorShutdownCompleteAllTasksTest.java
index 984c57e29ff..2452d34efb7 100644
--- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/FileDisruptorShutdownCompleteAllTasksTest.java
+++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/FileDisruptorShutdownCompleteAllTasksTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.ShutdownRunningTask;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
@@ -30,10 +29,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class FileDisruptorShutdownCompleteAllTasksTest extends CamelTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/disruptor");
- super.setUp();
}
@Test
diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/AbstractVmTestSupport.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/AbstractVmTestSupport.java
index 721dbf422ab..510004af0af 100644
--- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/AbstractVmTestSupport.java
+++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/AbstractVmTestSupport.java
@@ -22,8 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.support.service.ServiceHelper;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
public abstract class AbstractVmTestSupport extends CamelTestSupport {
@@ -31,9 +29,7 @@ public abstract class AbstractVmTestSupport extends CamelTestSupport {
protected ProducerTemplate template2;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
context2 = new DefaultCamelContext();
template2 = context2.createProducerTemplate();
@@ -48,11 +44,9 @@ public abstract class AbstractVmTestSupport extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
ServiceHelper.stopService(template2);
context2.stop();
- super.tearDown();
}
protected RouteBuilder createRouteBuilderForSecondContext() {
diff --git a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java
index 5dcf67220eb..8d6a33232a4 100644
--- a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java
+++ b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/EhcacheTestSupport.java
@@ -57,9 +57,7 @@ public class EhcacheTestSupport extends CamelTestSupport {
}
@Override
- public void tearDown() throws Exception {
- super.tearDown();
-
+ public void doPostTearDown() {
if (cacheManager != null) {
cacheManager.close();
}
diff --git a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/processor/aggregate/EhcacheAggregationRepositoryOperationTest.java b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/processor/aggregate/EhcacheAggregationRepositoryOperationTest.java
index 9763de4dc83..1bb7f779cf6 100644
--- a/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/processor/aggregate/EhcacheAggregationRepositoryOperationTest.java
+++ b/components/camel-ehcache/src/test/java/org/apache/camel/component/ehcache/processor/aggregate/EhcacheAggregationRepositoryOperationTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.ehcache.EhcacheTestSupport;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.support.DefaultExchangeHolder;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -43,10 +42,8 @@ public class EhcacheAggregationRepositoryOperationTest extends EhcacheTestSuppor
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
aggregationRepository.stop();
- super.tearDown();
}
private boolean exists(String key) {
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataFormatTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataFormatTest.java
index 7a24e7e8b1b..0cd4bba4d2c 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataFormatTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataFormatTest.java
@@ -29,7 +29,6 @@ import org.hl7.fhir.r4.model.Address;
import org.hl7.fhir.r4.model.Base;
import org.hl7.fhir.r4.model.HumanName;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -43,9 +42,7 @@ public class FhirJsonDataFormatTest extends CamelTestSupport {
private MockEndpoint mockEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataformatErrorHandlerTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataformatErrorHandlerTest.java
index 971a7374934..6518be89c72 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataformatErrorHandlerTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirJsonDataformatErrorHandlerTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.fhir.FhirJsonDataFormat;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -45,9 +44,7 @@ public class FhirJsonDataformatErrorHandlerTest extends CamelTestSupport {
private final FhirContext fhirContext = FhirContext.forR4();
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataFormatTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataFormatTest.java
index c6845b573b5..3ab6296a192 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataFormatTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataFormatTest.java
@@ -29,7 +29,6 @@ import org.hl7.fhir.r4.model.Address;
import org.hl7.fhir.r4.model.Base;
import org.hl7.fhir.r4.model.HumanName;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -43,9 +42,7 @@ public class FhirXmlDataFormatTest extends CamelTestSupport {
private MockEndpoint mockEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataformatErrorHandlerTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataformatErrorHandlerTest.java
index 1c019d010eb..c98e3dc5083 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataformatErrorHandlerTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/FhirXmlDataformatErrorHandlerTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.fhir.FhirXmlDataFormat;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -42,9 +41,7 @@ public class FhirXmlDataformatErrorHandlerTest extends CamelTestSupport {
private final FhirContext fhirContext = FhirContext.forR4();
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatConfigSpringTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatConfigSpringTest.java
index 650112f628a..37cd4bbe6a2 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatConfigSpringTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatConfigSpringTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.fhir.FhirDataFormat;
import org.apache.camel.reifier.dataformat.DataFormatReifier;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.hl7.fhir.r4.model.IdType;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -39,12 +38,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class FhirDataformatConfigSpringTest extends CamelSpringTestSupport {
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
- }
-
@Test
public void defaultFhirJsonConfigTest() {
FhirDataFormat fhirJson = getDataformat("fhirJson");
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatDefaultConfigSpringTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatDefaultConfigSpringTest.java
index df45104ad70..ec968dd5c9b 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatDefaultConfigSpringTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirDataformatDefaultConfigSpringTest.java
@@ -20,7 +20,6 @@ import ca.uhn.fhir.context.FhirVersionEnum;
import org.apache.camel.CamelContext;
import org.apache.camel.component.fhir.FhirDataFormat;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -31,12 +30,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
public class FhirDataformatDefaultConfigSpringTest extends CamelSpringTestSupport {
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
- }
-
@Test
public void defaultFhirJsonConfigTest() {
FhirDataFormat fhirJson = getDataformat("fhirJson");
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataFormatSpringTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataFormatSpringTest.java
index a75ae0a22b1..c357cbc96aa 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataFormatSpringTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataFormatSpringTest.java
@@ -28,7 +28,6 @@ import org.hl7.fhir.r4.model.Address;
import org.hl7.fhir.r4.model.Base;
import org.hl7.fhir.r4.model.HumanName;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -44,9 +43,7 @@ public class FhirJsonDataFormatSpringTest extends CamelSpringTestSupport {
private MockEndpoint mockEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataformatErrorHandlerSpringTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataformatErrorHandlerSpringTest.java
index b562c0374e6..2e4d16ace95 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataformatErrorHandlerSpringTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirJsonDataformatErrorHandlerSpringTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -39,9 +38,7 @@ public class FhirJsonDataformatErrorHandlerSpringTest extends CamelSpringTestSup
private MockEndpoint mockEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataFormatSpringTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataFormatSpringTest.java
index 75b09d6afac..bd724d27359 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataFormatSpringTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataFormatSpringTest.java
@@ -28,7 +28,6 @@ import org.hl7.fhir.r4.model.Address;
import org.hl7.fhir.r4.model.Base;
import org.hl7.fhir.r4.model.HumanName;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -45,9 +44,7 @@ public class FhirXmlDataFormatSpringTest extends CamelSpringTestSupport {
private MockEndpoint mockEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataformatErrorHandlerSpringTest.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataformatErrorHandlerSpringTest.java
index 2b1c9ef8fa4..4ecde56bbcc 100644
--- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataformatErrorHandlerSpringTest.java
+++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/dataformat/spring/FhirXmlDataformatErrorHandlerSpringTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.hl7.fhir.r4.model.Patient;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -37,9 +36,7 @@ public class FhirXmlDataformatErrorHandlerSpringTest extends CamelSpringTestSupp
private MockEndpoint mockEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTestBase.java b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTestBase.java
index 4c40891548b..fb6d9ce8ee4 100644
--- a/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTestBase.java
+++ b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTestBase.java
@@ -58,8 +58,7 @@ public class FileWatchComponentTestBase extends CamelTestSupport {
}
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
cleanTestDir(new File(testPath()));
}
diff --git a/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java b/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java
index fa3ad9d5d9f..c2840db4add 100644
--- a/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java
+++ b/components/camel-fop/src/test/java/org/apache/camel/component/fop/FopComponentTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.pdmodel.PDDocument;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
@@ -43,27 +42,13 @@ public class FopComponentTest extends CamelTestSupport {
@Produce("direct:start")
protected ProducerTemplate template;
- private boolean canTest = true;
-
@Override
- @BeforeEach
- public void setUp() {
+ public void doPreSetup() {
deleteDirectory("target/data");
-
- try {
- super.setUp();
- } catch (Exception e) {
- canTest = false;
- }
}
@Test
public void createPdfUsingXmlDataAndXsltTransformation() throws Exception {
- if (!canTest) {
- // cannot run on CI
- return;
- }
-
resultEndpoint.expectedMessageCount(1);
FileInputStream inputStream = new FileInputStream("src/test/data/xml/data.xml");
diff --git a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java
index e9b6e385b8d..f4eecac34f6 100644
--- a/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java
+++ b/components/camel-freemarker/src/test/java/org/apache/camel/component/freemarker/FreemarkerContentCacheTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
@@ -40,10 +39,7 @@ public class FreemarkerContentCacheTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() {
// create a vm file in the classpath as this is the tricky reloading stuff
template.sendBodyAndHeader("file://target/test-classes/org/apache/camel/component/freemarker?fileExist=Override",
"Hello ${headers.name}", Exchange.FILE_NAME, "hello.ftl");
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpSoTimeoutTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpSoTimeoutTest.java
index deb7b4d0b38..efd173d0c1e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpSoTimeoutTest.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpSoTimeoutTest.java
@@ -26,8 +26,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.commons.net.ftp.FTPClient;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
@@ -47,20 +45,16 @@ public class FtpSoTimeoutTest extends CamelTestSupport {
// --- Set up
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
// the created server socket makes it possible for the FTP client to
// establish the socket connection.
// However, no message will ever be sent back, thus a read timeout
// should occur within FTPClient#__getReply()
serverSocket = new ServerSocket(0);
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (serverSocket != null) {
serverSocket.close();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFileToFtpDefaultRootRenameStrategyIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFileToFtpDefaultRootRenameStrategyIT.java
index 41d4c9380d5..99993189b51 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFileToFtpDefaultRootRenameStrategyIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFileToFtpDefaultRootRenameStrategyIT.java
@@ -35,8 +35,7 @@ public class FromFileToFtpDefaultRootRenameStrategyIT extends FtpServerTestSuppo
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpActivePortRangeIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpActivePortRangeIT.java
index 7f04fae77e2..9ce1d4e6af8 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpActivePortRangeIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpActivePortRangeIT.java
@@ -32,8 +32,7 @@ public class FromFtpActivePortRangeIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientConfigRefIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientConfigRefIT.java
index d4c9ea63336..ee9610cc5b2 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientConfigRefIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientConfigRefIT.java
@@ -44,8 +44,7 @@ public class FromFtpClientConfigRefIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientDataTimeoutIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientDataTimeoutIT.java
index 4bb833ebd1c..375419bb386 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientDataTimeoutIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientDataTimeoutIT.java
@@ -32,8 +32,7 @@ public class FromFtpClientDataTimeoutIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeout2IT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeout2IT.java
index 77113155d8b..21613fe5884 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeout2IT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeout2IT.java
@@ -32,8 +32,7 @@ public class FromFtpClientSoTimeout2IT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeoutIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeoutIT.java
index 9722be962a3..493b19d1787 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeoutIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpClientSoTimeoutIT.java
@@ -32,8 +32,7 @@ public class FromFtpClientSoTimeoutIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateIT.java
index b00fedb5ea7..f0bfd2fbe5a 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateIT.java
@@ -36,8 +36,7 @@ public class FromFtpConsumerTemplateIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateRollbackIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateRollbackIT.java
index cbf90348e98..71e0d6dd825 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateRollbackIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpConsumerTemplateRollbackIT.java
@@ -44,8 +44,7 @@ public class FromFtpConsumerTemplateRollbackIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDeleteFileIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDeleteFileIT.java
index a573eb8626e..811333dd01b 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDeleteFileIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDeleteFileIT.java
@@ -42,8 +42,7 @@ public class FromFtpDeleteFileIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDoNotDeleteFileIfProcessFailsIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDoNotDeleteFileIfProcessFailsIT.java
index c154436a3e4..de337000dbb 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDoNotDeleteFileIfProcessFailsIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpDoNotDeleteFileIfProcessFailsIT.java
@@ -39,8 +39,7 @@ public class FromFtpDoNotDeleteFileIfProcessFailsIT extends FtpServerTestSupport
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpKeepLastModifiedIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpKeepLastModifiedIT.java
index ef31917d136..619f469a61f 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpKeepLastModifiedIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpKeepLastModifiedIT.java
@@ -43,8 +43,7 @@ public class FromFtpKeepLastModifiedIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
template.sendBodyAndHeader(getFtpUrl(), "Hello World", "CamelFileName", "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileAbsoluteFolderRecursiveIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileAbsoluteFolderRecursiveIT.java
index 10158e73035..b91cb280fe2 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileAbsoluteFolderRecursiveIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileAbsoluteFolderRecursiveIT.java
@@ -34,8 +34,7 @@ public class FromFtpMoveFileAbsoluteFolderRecursiveIT extends FtpServerTestSuppo
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileIT.java
index 3332a59ac01..27ceef8d98e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileIT.java
@@ -40,8 +40,7 @@ public class FromFtpMoveFileIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePostfixIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePostfixIT.java
index 8a660fbf4a4..7de0d7eb71a 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePostfixIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePostfixIT.java
@@ -40,8 +40,7 @@ public class FromFtpMoveFilePostfixIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePrefixIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePrefixIT.java
index a87725fb793..1fcecc7b246 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePrefixIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFilePrefixIT.java
@@ -40,8 +40,7 @@ public class FromFtpMoveFilePrefixIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileRecursiveIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileRecursiveIT.java
index 6db0d80c652..ead8bdc5671 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileRecursiveIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileRecursiveIT.java
@@ -34,8 +34,7 @@ public class FromFtpMoveFileRecursiveIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileToHiddenFolderRecursiveIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileToHiddenFolderRecursiveIT.java
index b0092960978..ba8653b63ae 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileToHiddenFolderRecursiveIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpMoveFileToHiddenFolderRecursiveIT.java
@@ -34,8 +34,7 @@ public class FromFtpMoveFileToHiddenFolderRecursiveIT extends FtpServerTestSuppo
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoEndpointPathRelativeMoveToAbsoluteIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoEndpointPathRelativeMoveToAbsoluteIT.java
index 84f96b463e8..188d60dd913 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoEndpointPathRelativeMoveToAbsoluteIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoEndpointPathRelativeMoveToAbsoluteIT.java
@@ -31,8 +31,7 @@ public class FromFtpNoEndpointPathRelativeMoveToAbsoluteIT extends FtpServerTest
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIT.java
index 4d666e3f8a3..b1e24bfba3f 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIT.java
@@ -39,8 +39,7 @@ public class FromFtpNoopIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIdempotentFalseIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIdempotentFalseIT.java
index 964b6c029bc..d7518e6fb4e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIdempotentFalseIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNoopIdempotentFalseIT.java
@@ -39,8 +39,7 @@ public class FromFtpNoopIdempotentFalseIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNotDownloadIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNotDownloadIT.java
index 09204173767..a571f9f2ac0 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNotDownloadIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpNotDownloadIT.java
@@ -39,8 +39,7 @@ public class FromFtpNotDownloadIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPassiveModeIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPassiveModeIT.java
index e9349b2eb44..b7a68f1486e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPassiveModeIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPassiveModeIT.java
@@ -32,8 +32,7 @@ public class FromFtpPassiveModeIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPollFileOnlyIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPollFileOnlyIT.java
index 7d4f05ea251..115c6772223 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPollFileOnlyIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPollFileOnlyIT.java
@@ -35,8 +35,7 @@ public class FromFtpPollFileOnlyIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveDeleteIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveDeleteIT.java
index fc676e32755..d9b5b3d9a80 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveDeleteIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveDeleteIT.java
@@ -43,8 +43,7 @@ public class FromFtpPreMoveDeleteIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFileExpressionIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFileExpressionIT.java
index a6c532dc625..3371165a3d7 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFileExpressionIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFileExpressionIT.java
@@ -41,8 +41,7 @@ public class FromFtpPreMoveFileExpressionIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePostfixIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePostfixIT.java
index 866bf20e621..0c1284f69cf 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePostfixIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePostfixIT.java
@@ -39,8 +39,7 @@ public class FromFtpPreMoveFilePostfixIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePrefixIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePrefixIT.java
index 112f638f7cf..95225555123 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePrefixIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveFilePrefixIT.java
@@ -40,8 +40,7 @@ public class FromFtpPreMoveFilePrefixIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveNoopIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveNoopIT.java
index ee9a1c837ed..61b8599ffc3 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveNoopIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpPreMoveNoopIT.java
@@ -42,8 +42,7 @@ public class FromFtpPreMoveNoopIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNoopIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNoopIT.java
index bcb363e5fc7..9f0725b3c14 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNoopIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNoopIT.java
@@ -31,9 +31,7 @@ public class FromFtpRecursiveNoopIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
template.sendBodyAndHeader(getFtpUrl(), "a", Exchange.FILE_NAME, "a.txt");
template.sendBodyAndHeader(getFtpUrl(), "b", Exchange.FILE_NAME, "b.txt");
template.sendBodyAndHeader(getFtpUrl(), "a2", Exchange.FILE_NAME, "foo/a.txt");
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNotStepwiseNoBasePathIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNotStepwiseNoBasePathIT.java
index ffc9d77466f..caeb886a136 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNotStepwiseNoBasePathIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRecursiveNotStepwiseNoBasePathIT.java
@@ -29,8 +29,7 @@ public class FromFtpRecursiveNotStepwiseNoBasePathIT extends FtpServerTestSuppor
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRegexPatternIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRegexPatternIT.java
index c1106e42134..cc79006c272 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRegexPatternIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRegexPatternIT.java
@@ -33,8 +33,7 @@ public class FromFtpRegexPatternIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterDirectoryIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterDirectoryIT.java
index f568063b408..77033fd1b93 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterDirectoryIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterDirectoryIT.java
@@ -40,8 +40,7 @@ public class FromFtpRemoteFileFilterDirectoryIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterIT.java
index 272ee734240..e0e0c932a8e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileFilterIT.java
@@ -40,8 +40,7 @@ public class FromFtpRemoteFileFilterIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByExpressionIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByExpressionIT.java
index 6a5a00a7b42..8812210abb4 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByExpressionIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByExpressionIT.java
@@ -32,8 +32,7 @@ public class FromFtpRemoteFileSortByExpressionIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByIgnoreCaseExpressionIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByIgnoreCaseExpressionIT.java
index 668a4e68c00..fdcf3ff963a 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByIgnoreCaseExpressionIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByIgnoreCaseExpressionIT.java
@@ -34,8 +34,7 @@ public class FromFtpRemoteFileSortByIgnoreCaseExpressionIT extends FtpServerTest
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByNestedExpressionIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByNestedExpressionIT.java
index 24e96861628..e131cc885b7 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByNestedExpressionIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSortByNestedExpressionIT.java
@@ -32,8 +32,7 @@ public class FromFtpRemoteFileSortByNestedExpressionIT extends FtpServerTestSupp
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSorterIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSorterIT.java
index eaa144e0ba4..6b00ea75373 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSorterIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpRemoteFileSorterIT.java
@@ -39,8 +39,7 @@ public class FromFtpRemoteFileSorterIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeAndTimeoutIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeAndTimeoutIT.java
index 88cbe00d8c0..a25e5a14f2b 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeAndTimeoutIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeAndTimeoutIT.java
@@ -33,8 +33,7 @@ public class FromFtpServerLanguageCodeAndTimeoutIT extends FtpServerTestSupport
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeIT.java
index bca5bab2030..1b0a8c68ed5 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpServerLanguageCodeIT.java
@@ -32,8 +32,7 @@ public class FromFtpServerLanguageCodeIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToAbsoluteIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToAbsoluteIT.java
index 8d3312f9b4d..99fd34cbde4 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToAbsoluteIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToAbsoluteIT.java
@@ -31,8 +31,7 @@ public class FromFtpSimpleNoEndpointPathRelativeMoveToAbsoluteIT extends FtpServ
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToRelativeIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToRelativeIT.java
index a2c14881ce3..042a19dd32b 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToRelativeIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleNoEndpointPathRelativeMoveToRelativeIT.java
@@ -31,8 +31,7 @@ public class FromFtpSimpleNoEndpointPathRelativeMoveToRelativeIT extends FtpServ
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToAbsoluteIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToAbsoluteIT.java
index a7da86e6867..c5d913591fe 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToAbsoluteIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToAbsoluteIT.java
@@ -31,8 +31,7 @@ public class FromFtpSimpleRelativeMoveToAbsoluteIT extends FtpServerTestSupport
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToRelativeIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToRelativeIT.java
index 1af48719316..b50de34a698 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToRelativeIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpSimpleRelativeMoveToRelativeIT.java
@@ -31,8 +31,7 @@ public class FromFtpSimpleRelativeMoveToRelativeIT extends FtpServerTestSupport
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpStartingDirAndFileNameClashIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpStartingDirAndFileNameClashIT.java
index 0b2e4bad9a4..fe01c6b2224 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpStartingDirAndFileNameClashIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpStartingDirAndFileNameClashIT.java
@@ -32,8 +32,7 @@ public class FromFtpStartingDirAndFileNameClashIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileIT.java
index c9c910bcf54..033f04ef842 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileIT.java
@@ -44,8 +44,7 @@ public class FromFtpToAsciiFileIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileNoBodyConversionIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileNoBodyConversionIT.java
index e2850e5f290..7fdbed1d7b5 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileNoBodyConversionIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToAsciiFileNoBodyConversionIT.java
@@ -41,8 +41,7 @@ public class FromFtpToAsciiFileNoBodyConversionIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFileIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFileIT.java
index f2c11630b56..f5730da67fa 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFileIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFileIT.java
@@ -47,8 +47,7 @@ public class FromFtpToBinaryFileIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFilesIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFilesIT.java
index f07f6f6ad62..a687df602ed 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFilesIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToBinaryFilesIT.java
@@ -45,8 +45,7 @@ public class FromFtpToBinaryFilesIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToFileNoFileNameHeaderIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToFileNoFileNameHeaderIT.java
index fb38c3c4326..5cab69075e5 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToFileNoFileNameHeaderIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpToFileNoFileNameHeaderIT.java
@@ -42,8 +42,7 @@ public class FromFtpToFileNoFileNameHeaderIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpTwoSlashesIssueIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpTwoSlashesIssueIT.java
index d3372628b2c..a60b2fb5c43 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpTwoSlashesIssueIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromFtpTwoSlashesIssueIT.java
@@ -39,8 +39,7 @@ public class FromFtpTwoSlashesIssueIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromQueueThenConsumeFtpToMockIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromQueueThenConsumeFtpToMockIT.java
index 567f69739c7..7b91699c318 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromQueueThenConsumeFtpToMockIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FromQueueThenConsumeFtpToMockIT.java
@@ -46,8 +46,7 @@ public class FromQueueThenConsumeFtpToMockIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpAnonymousIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpAnonymousIT.java
index 5d6391b1f17..e19480f845d 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpAnonymousIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpAnonymousIT.java
@@ -36,8 +36,7 @@ public class FtpAnonymousIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpBadLoginMockNoopConnectionLeakIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpBadLoginMockNoopConnectionLeakIT.java
index 8d0eed5c706..fd06df87462 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpBadLoginMockNoopConnectionLeakIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpBadLoginMockNoopConnectionLeakIT.java
@@ -62,9 +62,7 @@ public class FtpBadLoginMockNoopConnectionLeakIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), FtpEndpoint.class);
endpoint.setFtpClient(new FTPClient() {
@Override
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAbsolutePathIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAbsolutePathIT.java
index a1add2fe0ee..d632ade39a9 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAbsolutePathIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAbsolutePathIT.java
@@ -35,8 +35,7 @@ public class FtpConsumerAbsolutePathIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAsyncStressIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAsyncStressIT.java
index 07cfbfd783f..ed1123d7cd9 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAsyncStressIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerAsyncStressIT.java
@@ -35,8 +35,7 @@ public class FtpConsumerAsyncStressIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
for (int i = 0; i < files; i++) {
template.sendBodyAndHeader("file://{{ftp.root.dir}}/filestress", "Hello World", Exchange.FILE_NAME,
i + ".txt");
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerBodyAsStringIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerBodyAsStringIT.java
index a0553a6b112..aa2df0f2432 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerBodyAsStringIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerBodyAsStringIT.java
@@ -36,8 +36,7 @@ public class FtpConsumerBodyAsStringIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDeleteNoWritePermissionIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDeleteNoWritePermissionIT.java
index 1f6409eb235..22bce0ea51e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDeleteNoWritePermissionIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDeleteNoWritePermissionIT.java
@@ -35,8 +35,7 @@ public class FtpConsumerDeleteNoWritePermissionIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDirectoriesNotMatchedIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDirectoriesNotMatchedIT.java
index b8fc374af54..7a677919694 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDirectoriesNotMatchedIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDirectoriesNotMatchedIT.java
@@ -32,8 +32,7 @@ public class FtpConsumerDirectoriesNotMatchedIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDisconnectIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDisconnectIT.java
index 2f361e5a205..1fe47e93e5c 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDisconnectIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerDisconnectIT.java
@@ -37,9 +37,7 @@ public class FtpConsumerDisconnectIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
// ask the singleton FtpEndpoint to make use of a custom FTPClient
// so that we can hold a reference on it inside the test below
FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), FtpEndpoint.class);
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeExtIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeExtIT.java
index 6ba41bd1e71..99214ebd81d 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeExtIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeExtIT.java
@@ -29,8 +29,7 @@ public class FtpConsumerExcludeExtIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeNameIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeNameIT.java
index c994a5c3c86..f080967dd63 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeNameIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerExcludeNameIT.java
@@ -32,8 +32,7 @@ public class FtpConsumerExcludeNameIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIPV6BodyAsStringIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIPV6BodyAsStringIT.java
index d41aa9951c8..fd60f9a4a10 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIPV6BodyAsStringIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIPV6BodyAsStringIT.java
@@ -38,8 +38,7 @@ public class FtpConsumerIPV6BodyAsStringIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeExtIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeExtIT.java
index 85dc4bf3934..914a926da2a 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeExtIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeExtIT.java
@@ -29,8 +29,7 @@ public class FtpConsumerIncludeExtIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeNameIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeNameIT.java
index c989b4943e5..2004c0b3ab2 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeNameIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerIncludeNameIT.java
@@ -32,8 +32,7 @@ public class FtpConsumerIncludeNameIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryAsAbsolutePathIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryAsAbsolutePathIT.java
index bcacb87c26c..f2d8d222f9a 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryAsAbsolutePathIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryAsAbsolutePathIT.java
@@ -50,8 +50,7 @@ public class FtpConsumerLocalWorkDirectoryAsAbsolutePathIT extends FtpServerTest
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryDirectIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryDirectIT.java
index 2e07aeeeae5..c51ba10ef25 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryDirectIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryDirectIT.java
@@ -44,8 +44,7 @@ public class FtpConsumerLocalWorkDirectoryDirectIT extends FtpServerTestSupport
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryIT.java
index dd99eb3d740..3b945e3ba68 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerLocalWorkDirectoryIT.java
@@ -50,8 +50,7 @@ public class FtpConsumerLocalWorkDirectoryIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerMultipleDirectoriesIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerMultipleDirectoriesIT.java
index 9c28409374b..6b9f9a97ed2 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerMultipleDirectoriesIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerMultipleDirectoriesIT.java
@@ -36,8 +36,7 @@ public class FtpConsumerMultipleDirectoriesIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerNotEagerMaxMessagesPerPollIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerNotEagerMaxMessagesPerPollIT.java
index 649aecfcb8b..1075c4f08d7 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerNotEagerMaxMessagesPerPollIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerNotEagerMaxMessagesPerPollIT.java
@@ -31,8 +31,7 @@ public class FtpConsumerNotEagerMaxMessagesPerPollIT extends FtpServerTestSuppor
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerRelativeFileNameIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerRelativeFileNameIT.java
index 90a4bdac0a0..9937d5946b8 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerRelativeFileNameIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerRelativeFileNameIT.java
@@ -36,8 +36,7 @@ public class FtpConsumerRelativeFileNameIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
sendFile(getFtpUrl(), "Hello World", "out/filename-consumer-hello.txt");
sendFile(getFtpUrl(), "Bye World", "out/filename-consumer-bye.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerResumeDownloadIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerResumeDownloadIT.java
index 976a3b0d681..acfc8191683 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerResumeDownloadIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerResumeDownloadIT.java
@@ -44,9 +44,7 @@ public class FtpConsumerResumeDownloadIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
// create file on FTP server to download
Path myserver = service.ftpFile("myserver");
createDirectory(myserver);
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerSkipDotFilesIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerSkipDotFilesIT.java
index a509bef10c2..04bb888fb08 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerSkipDotFilesIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerSkipDotFilesIT.java
@@ -32,8 +32,7 @@ public class FtpConsumerSkipDotFilesIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateIT.java
index cfd6581dd0a..ebc8b38cb6c 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateIT.java
@@ -39,8 +39,7 @@ public class FtpConsumerTemplateIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateUseListFalseIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateUseListFalseIT.java
index 4d67828164d..dc79dd5c424 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateUseListFalseIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerTemplateUseListFalseIT.java
@@ -37,8 +37,7 @@ public class FtpConsumerTemplateUseListFalseIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerUsingFTPClientConfigIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerUsingFTPClientConfigIT.java
index 3d2fcd820ac..028cebc74e8 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerUsingFTPClientConfigIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerUsingFTPClientConfigIT.java
@@ -34,8 +34,7 @@ public class FtpConsumerUsingFTPClientConfigIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithCharsetIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithCharsetIT.java
index 3a72b700a2a..5b094db12bd 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithCharsetIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithCharsetIT.java
@@ -49,8 +49,7 @@ public class FtpConsumerWithCharsetIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
byte[] iso = payload.getBytes(StandardCharsets.ISO_8859_1);
byte[] utf = payload.getBytes(StandardCharsets.UTF_8);
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithNoFileOptionIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithNoFileOptionIT.java
index 09e237352f6..a30ddc31798 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithNoFileOptionIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpConsumerWithNoFileOptionIT.java
@@ -38,8 +38,7 @@ public class FtpConsumerWithNoFileOptionIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerAllowNullBodyFileAlreadyExistIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerAllowNullBodyFileAlreadyExistIT.java
index 60f2d3ee687..cab6608dfb9 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerAllowNullBodyFileAlreadyExistIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerAllowNullBodyFileAlreadyExistIT.java
@@ -30,8 +30,7 @@ public class FtpProducerAllowNullBodyFileAlreadyExistIT extends FtpServerTestSup
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
template.sendBodyAndHeader(getFtpUrl(), "Hello world", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectIT.java
index 6355899e1c1..a356ace08fd 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectIT.java
@@ -28,9 +28,7 @@ public class FtpProducerDisconnectIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
// ask the singleton FtpEndpoint to make use of a custom FTPClient
// so that we can hold a reference on it inside the test below
FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), FtpEndpoint.class);
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectOnBatchCompleteIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectOnBatchCompleteIT.java
index a31acbf1ae1..2fa5d652728 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectOnBatchCompleteIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerDisconnectOnBatchCompleteIT.java
@@ -34,9 +34,7 @@ public class FtpProducerDisconnectOnBatchCompleteIT extends FtpServerTestSupport
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
// ask the singleton FtpEndpoint to make use of a custom FTPClient
// so that we can hold a reference on it inside the test below
FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), FtpEndpoint.class);
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java
index e865d43fcdc..c44a78435b6 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistAppendIT.java
@@ -31,9 +31,7 @@ public class FtpProducerFileExistAppendIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
template.sendBodyAndHeader(getFtpUrl(), "Hello World\n", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java
index 4be02910c67..bc65dfdd1cb 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistFailIT.java
@@ -36,9 +36,7 @@ public class FtpProducerFileExistFailIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
template.sendBodyAndHeader(getFtpUrl(), "Hello World", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistIgnoreIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistIgnoreIT.java
index bb0fe0b8ade..3197ff512ef 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistIgnoreIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistIgnoreIT.java
@@ -30,9 +30,7 @@ public class FtpProducerFileExistIgnoreIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
template.sendBodyAndHeader(getFtpUrl(), "Hello World", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistOverrideIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistOverrideIT.java
index 53ec2b30796..a9c20789577 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistOverrideIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileExistOverrideIT.java
@@ -30,8 +30,7 @@ public class FtpProducerFileExistOverrideIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
template.sendBodyAndHeader(getFtpUrl(), "Hello World", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileWithCharsetIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileWithCharsetIT.java
index 5892b664156..0ffe9b83d69 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileWithCharsetIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerFileWithCharsetIT.java
@@ -44,7 +44,7 @@ public class FtpProducerFileWithCharsetIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
byte[] utf = payload.getBytes(StandardCharsets.UTF_8);
byte[] iso = payload.getBytes(StandardCharsets.ISO_8859_1);
@@ -57,7 +57,6 @@ public class FtpProducerFileWithCharsetIT extends FtpServerTestSupport {
for (byte b : iso) {
LOG.debug("iso byte: {}", b);
}
- super.setUp();
}
@Test
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java
index 4c268a9e5fe..78513deb8c0 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpProducerRootFileExistFailIT.java
@@ -35,8 +35,7 @@ public class FtpProducerRootFileExistFailIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
// create existing file on ftp server
template.sendBodyAndHeader(getFtpUrl(), "Hello World", Exchange.FILE_NAME, "hello.txt");
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteAllTasksIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteAllTasksIT.java
index dfe6d7a0cc3..eb1f9f311c5 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteAllTasksIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteAllTasksIT.java
@@ -36,8 +36,7 @@ public class FtpShutdownCompleteAllTasksIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteCurrentTaskOnlyIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteCurrentTaskOnlyIT.java
index bf0484d8dad..dcea8e00e24 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteCurrentTaskOnlyIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpShutdownCompleteCurrentTaskOnlyIT.java
@@ -36,8 +36,7 @@ public class FtpShutdownCompleteCurrentTaskOnlyIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpSimpleConsumeStreamingStepwiseIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpSimpleConsumeStreamingStepwiseIT.java
index 1c43a44e52e..6087a9f862a 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpSimpleConsumeStreamingStepwiseIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpSimpleConsumeStreamingStepwiseIT.java
@@ -49,8 +49,7 @@ public class FtpSimpleConsumeStreamingStepwiseIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpConsumerLocalWorkDirectoryIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpConsumerLocalWorkDirectoryIT.java
index 12d75f7c3cc..7c1efb84156 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpConsumerLocalWorkDirectoryIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpConsumerLocalWorkDirectoryIT.java
@@ -51,8 +51,7 @@ public class SftpConsumerLocalWorkDirectoryIT extends SftpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/ToFtpTempFileTargetFileExistIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/ToFtpTempFileTargetFileExistIT.java
index 94f47abb7ce..c699ed57eff 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/ToFtpTempFileTargetFileExistIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/ToFtpTempFileTargetFileExistIT.java
@@ -37,8 +37,7 @@ public class ToFtpTempFileTargetFileExistIT extends FtpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
prepareFtpServer();
}
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/integration/SftpFromSedaDeleteFileIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/integration/SftpFromSedaDeleteFileIT.java
index e2b8b7621eb..7cef4cf26cb 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/integration/SftpFromSedaDeleteFileIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/integration/SftpFromSedaDeleteFileIT.java
@@ -43,8 +43,7 @@ public class SftpFromSedaDeleteFileIT extends SftpServerTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
createSampleFile();
}
diff --git a/components/camel-git/src/test/java/org/apache/camel/component/git/GitTestSupport.java b/components/camel-git/src/test/java/org/apache/camel/component/git/GitTestSupport.java
index 49a9eb86b21..28ea9bc8df7 100644
--- a/components/camel-git/src/test/java/org/apache/camel/component/git/GitTestSupport.java
+++ b/components/camel-git/src/test/java/org/apache/camel/component/git/GitTestSupport.java
@@ -27,7 +27,6 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
import org.eclipse.jgit.util.SystemReader;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
@@ -59,18 +58,15 @@ public class GitTestSupport extends CamelTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
File localPath = File.createTempFile(gitLocalRepo, "");
localPath.delete();
File path = new File(gitLocalRepo);
path.deleteOnExit();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
File path = new File(gitLocalRepo);
deleteDirectory(path);
}
diff --git a/components/camel-google/camel-google-drive/src/test/java/org/apache/camel/component/google/drive/FileConverterIT.java b/components/camel-google/camel-google-drive/src/test/java/org/apache/camel/component/google/drive/FileConverterIT.java
index f1ad5eb99bd..047208d5399 100644
--- a/components/camel-google/camel-google-drive/src/test/java/org/apache/camel/component/google/drive/FileConverterIT.java
+++ b/components/camel-google/camel-google-drive/src/test/java/org/apache/camel/component/google/drive/FileConverterIT.java
@@ -43,9 +43,8 @@ public class FileConverterIT extends AbstractGoogleDriveTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/convertertest");
- super.setUp();
}
@Test
diff --git a/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteComponentTest.java b/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteComponentTest.java
index 7111b4fe36c..e6ef1841441 100644
--- a/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteComponentTest.java
+++ b/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteComponentTest.java
@@ -21,17 +21,18 @@ import java.util.Map;
import org.apache.camel.Endpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class GooglePubsubLiteComponentTest extends CamelTestSupport {
private GooglePubsubLiteComponent googlePubsubLiteComponent;
- @BeforeEach
- public void setUp() throws Exception {
+ @Override
+ public void doPreSetup() {
googlePubsubLiteComponent = new GooglePubsubLiteComponent();
}
diff --git a/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteProducerTest.java b/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteProducerTest.java
index 894fa39fe32..bc1da31f5fc 100644
--- a/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteProducerTest.java
+++ b/components/camel-google/camel-google-pubsub-lite/src/test/java/org/apache/camel/component/google/pubsublite/GooglePubsubLiteProducerTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -44,8 +43,8 @@ public class GooglePubsubLiteProducerTest extends CamelTestSupport {
@Mock
private Publisher mockPublisher;
- @BeforeEach
- public void setUp() {
+ @Override
+ public void doPreSetup() {
MockitoAnnotations.initMocks(this);
}
diff --git a/components/camel-http-common/src/test/java/org/apache/camel/http/common/HttpHeaderFilterStrategyTest.java b/components/camel-http-common/src/test/java/org/apache/camel/http/common/HttpHeaderFilterStrategyTest.java
index 4acc8d1fcf6..0865a150078 100644
--- a/components/camel-http-common/src/test/java/org/apache/camel/http/common/HttpHeaderFilterStrategyTest.java
+++ b/components/camel-http-common/src/test/java/org/apache/camel/http/common/HttpHeaderFilterStrategyTest.java
@@ -17,10 +17,8 @@
package org.apache.camel.http.common;
import org.apache.camel.Exchange;
-import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -32,10 +30,9 @@ public class HttpHeaderFilterStrategyTest extends CamelTestSupport {
private Exchange exchange;
@Override
- @BeforeEach
- public void setUp() {
+ public void doPostSetup() throws Exception {
filter = new HttpHeaderFilterStrategy();
- exchange = new DefaultExchange(new DefaultCamelContext());
+ exchange = new DefaultExchange(context);
}
@Test
diff --git a/components/camel-http-common/src/test/java/org/apache/camel/http/common/cookie/CookieHandlerTest.java b/components/camel-http-common/src/test/java/org/apache/camel/http/common/cookie/CookieHandlerTest.java
index a9350d5ff34..c093f8128fc 100644
--- a/components/camel-http-common/src/test/java/org/apache/camel/http/common/cookie/CookieHandlerTest.java
+++ b/components/camel-http-common/src/test/java/org/apache/camel/http/common/cookie/CookieHandlerTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.http.base.cookie.CookieHandler;
import org.apache.camel.http.base.cookie.ExchangeCookieHandler;
import org.apache.camel.http.base.cookie.InstanceCookieHandler;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@@ -67,9 +66,7 @@ public class CookieHandlerTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
exchange = createExchangeWithBody(null);
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java
index 09eaab3ba99..618f0356bdf 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierExtensionTest.java
@@ -34,7 +34,6 @@ import org.apache.hc.core5.http.io.HttpRequestHandler;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -51,9 +50,7 @@ public class CamelComponentVerifierExtensionTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getHttpProcessor())
.register("/basic", new BasicValidationHandler(GET.name(), null, null, getExpectedContent()))
@@ -70,10 +67,8 @@ public class CamelComponentVerifierExtensionTest extends BaseHttpTest {
verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java
index a66553ea65c..38903ec120d 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/CamelComponentVerifierTest.java
@@ -33,7 +33,6 @@ import org.apache.hc.core5.http.io.HttpRequestHandler;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -50,9 +49,7 @@ public class CamelComponentVerifierTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getHttpProcessor())
.register("/basic", new BasicValidationHandler(GET.name(), null, null, getExpectedContent()))
@@ -69,10 +66,8 @@ public class CamelComponentVerifierTest extends BaseHttpTest {
verifier = component.getVerifier();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java
index d39e2c0cdb0..d214940bc04 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/FollowRedirectTest.java
@@ -32,7 +32,7 @@ public class FollowRedirectTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -42,8 +42,6 @@ public class FollowRedirectTest extends BaseHttpTest {
response.setCode(303);
}).create();
localServer.start();
-
- super.setUp();
}
@Test
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java
index 087288c230a..fd0171a195b 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpAuthenticationTest.java
@@ -33,7 +33,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -52,7 +51,7 @@ public class HttpAuthenticationTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -60,14 +59,10 @@ public class HttpAuthenticationTest extends BaseHttpTest {
new AuthenticationValidationHandler(GET.name(), null, null, getExpectedContent(), user, password))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java
index 39e41760543..a3c0447508e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.camel.component.http.handler.HeaderValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -43,7 +42,7 @@ public class HttpBodyTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put(CONTENT_TYPE, IMAGE_JPEG.getMimeType());
@@ -57,14 +56,10 @@ public class HttpBodyTest extends BaseHttpTest {
localServer.start();
endpointUrl = getProtocolString() + "localhost:" + localServer.getLocalPort();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java
index 39857c3f580..9ed7145826e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBodyWithOtherProtocolNameTest.java
@@ -17,14 +17,11 @@
package org.apache.camel.component.http;
import org.apache.camel.CamelContext;
-import org.junit.jupiter.api.BeforeEach;
public class HttpBodyWithOtherProtocolNameTest extends HttpBodyTest {
- @BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public void doPreSetup() throws Exception {
setProtocolString("newHttp://");
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java
index d28c2ad385d..890ddb19008 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpBridgeEndpointTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.component.http.handler.BasicRawQueryValidationHandler;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -38,7 +37,7 @@ public class HttpBridgeEndpointTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -48,14 +47,10 @@ public class HttpBridgeEndpointTest extends BaseHttpTest {
localServer.start();
url = "http://localhost:" + localServer.getLocalPort();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java
index 5e11be1c815..550424973e2 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCamelHeadersTest.java
@@ -29,7 +29,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.HttpContext;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -43,7 +42,7 @@ public class HttpCamelHeadersTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put("TestHeader", "test");
expectedHeaders.put(ACCEPT_LANGUAGE, "pl");
@@ -56,14 +55,10 @@ public class HttpCamelHeadersTest extends BaseHttpTest {
new MyHeaderValidationHandler(GET.name(), "HTTP/1.0", getExpectedContent(), expectedHeaders))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java
index 852e21460ec..353d4c17ce9 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCharsetTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,20 +36,16 @@ public class HttpCharsetTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/", new BasicValidationHandler(POST.name(), null, getBody(), getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java
index b8344eec00a..f3c785d597b 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpCompressionTest.java
@@ -47,7 +47,6 @@ import org.apache.hc.core5.http.io.entity.HttpEntityWrapper;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.http.protocol.HttpProcessor;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -64,7 +63,7 @@ public class HttpCompressionTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put(CONTENT_TYPE, TEXT_PLAIN.getMimeType());
expectedHeaders.put(CONTENT_ENCODING, "gzip");
@@ -76,14 +75,10 @@ public class HttpCompressionTest extends BaseHttpTest {
new HeaderValidationHandler(POST.name(), null, getBody(), getExpectedContent(), expectedHeaders))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java
index a90911968a4..6b18e23b25d 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpConcurrentTest.java
@@ -29,7 +29,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -43,7 +42,7 @@ public class HttpConcurrentTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -57,14 +56,10 @@ public class HttpConcurrentTest extends BaseHttpTest {
response.setEntity(new StringEntity(Integer.toString(counter.incrementAndGet())));
}).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java
index d7b2ac409a7..446f0e8a2c2 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDefaultPortNumberTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.client5.http.HttpHostConnectException;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -41,20 +40,16 @@ public class HttpDefaultPortNumberTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/search", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java
index 5bf884d1a5e..1fa9f91bd8e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpDisableStreamCacheTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.TypeConverter;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -40,20 +39,16 @@ public class HttpDisableStreamCacheTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/test/", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java
deleted file mode 100644
index 0b77cb4f474..00000000000
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.http;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.FailedToCreateRouteException;
-import org.apache.camel.ResolveEndpointFailedException;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import static org.apache.camel.component.http.HttpMethods.POST;
-import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-
-/**
- * Unit test of invalid configuration
- */
-public class HttpInvalidHttpClientConfigurationTest extends CamelTestSupport {
-
- private FailedToCreateRouteException exception;
-
- @BeforeEach
- @Override
- public void setUp() throws Exception {
- try {
- super.setUp();
- fail("Should have thrown ResolveEndpointFailedException");
- } catch (FailedToCreateRouteException e) {
- exception = e;
- }
- }
-
- @Test
- public void testInvalidHostConfiguration() {
- ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class, exception.getCause());
- assertTrue(cause.getMessage().endsWith("Unknown parameters=[{xxx=true}]"));
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:start").setHeader(Exchange.HTTP_METHOD, POST).to("http://www.google.com?httpClient.xxx=true");
- }
- };
- }
-}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java
index ceee33de01d..4515f8922f5 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpMethodsTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -49,7 +48,7 @@ public class HttpMethodsTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -68,14 +67,10 @@ public class HttpMethodsTest extends BaseHttpTest {
localServer.start();
baseUrl = "http://localhost:" + localServer.getLocalPort();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java
index 7a7b01650f3..0380cdf5cb5 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoCamelHeaderTest.java
@@ -21,7 +21,6 @@ import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,7 +36,7 @@ public class HttpNoCamelHeaderTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -57,14 +56,10 @@ public class HttpNoCamelHeaderTest extends BaseHttpTest {
response.setHeader(Exchange.TO_ENDPOINT, "foo");
}).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java
index 150d4de81fc..ffa76dbfcf4 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionRedeliveryTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.util.TimeValue;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -40,20 +39,16 @@ public class HttpNoConnectionRedeliveryTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/search", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java
index 0939ff51bdc..0150b260efd 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpNoConnectionTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.util.TimeValue;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
@@ -42,7 +41,7 @@ public class HttpNoConnectionTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -50,14 +49,10 @@ public class HttpNoConnectionTest extends BaseHttpTest {
localServer.start();
endpointUrl = "http://localhost:" + localServer.getLocalPort();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java
index 4520ed43e33..f926fd734ed 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpOAuth2AuthenticationTest.java
@@ -40,7 +40,7 @@ public class HttpOAuth2AuthenticationTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put("Authorization", "Bearer " + FAKE_TOKEN);
@@ -58,7 +58,6 @@ public class HttpOAuth2AuthenticationTest extends BaseHttpTest {
.create();
localServer.start();
- super.setUp();
}
@Test
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java
index ec8b95b2a79..84e0f93e4a1 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPathTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,7 +33,7 @@ public class HttpPathTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -46,14 +45,10 @@ public class HttpPathTest extends BaseHttpTest {
localServer.start();
endpointUrl = "http://localhost:" + localServer.getLocalPort();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java
index a2b774ed306..1a12ec9f295 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpPollingConsumerTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.RuntimeCamelException;
import org.apache.camel.component.http.handler.DelayValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -40,9 +39,7 @@ public class HttpPollingConsumerTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -52,10 +49,8 @@ public class HttpPollingConsumerTest extends BaseHttpTest {
endpointUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java
index 92a5d2c9cd6..b1b2b635671 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerBridgeEndpointTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.HeaderValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -43,7 +42,7 @@ public class HttpProducerBridgeEndpointTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
String[] absentHeaders = new String[] { "qp1", "qp2", "qp3", "qp4", "qp5" };
Map<String, String> noBridgeExpectedHeaders = new HashMap<>();
noBridgeExpectedHeaders.put("qp1", INSTANT.toString());
@@ -73,14 +72,10 @@ public class HttpProducerBridgeEndpointTest extends BaseHttpTest {
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java
index 2167895d457..d820235b09c 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerConnectionCloseTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.spi.Registry;
import org.apache.hc.core5.http.HeaderElements;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -44,20 +43,16 @@ public class HttpProducerConnectionCloseTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/myget", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java
index 8f96f77a105..26eed0e2a1e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentLengthTest.java
@@ -24,7 +24,6 @@ import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -42,9 +41,7 @@ public class HttpProducerContentLengthTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -78,10 +75,8 @@ public class HttpProducerContentLengthTest extends BaseHttpTest {
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java
index c188d3bbe75..99f2fa571ad 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeTest.java
@@ -23,7 +23,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -42,9 +41,7 @@ public class HttpProducerContentTypeTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -61,10 +58,8 @@ public class HttpProducerContentTypeTest extends BaseHttpTest {
endpointUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java
index 850a00ee162..72630ab5950 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithCharsetTest.java
@@ -23,11 +23,12 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
public class HttpProducerContentTypeWithCharsetTest extends BaseHttpTest {
@@ -41,9 +42,7 @@ public class HttpProducerContentTypeWithCharsetTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -61,10 +60,8 @@ public class HttpProducerContentTypeWithCharsetTest extends BaseHttpTest {
endpointUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java
index d3c3ce95b73..9999882520e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerContentTypeWithSemiColonTest.java
@@ -23,7 +23,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -42,9 +41,7 @@ public class HttpProducerContentTypeWithSemiColonTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -61,10 +58,8 @@ public class HttpProducerContentTypeWithSemiColonTest extends BaseHttpTest {
endpointUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java
index 8e2335b96e5..2fcfbfedd9e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerCustomHeaderTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.http.handler.HeaderValidationHandler;
import org.apache.hc.core5.http.HttpHeaders;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -36,7 +35,7 @@ public class HttpProducerCustomHeaderTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
expectedHeaders.put(HttpHeaders.HOST, CUSTOM_HOST);
@@ -60,14 +59,10 @@ public class HttpProducerCustomHeaderTest extends BaseHttpTest {
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java
index f6afd7c5c15..c4c59b246b7 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerExplicitConnectionCloseTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.HeaderElements;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,20 +36,16 @@ public class HttpProducerExplicitConnectionCloseTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/myget", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java
index 63b27461300..66d4cd1df7e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerLoadManualIT.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.camel.util.StopWatch;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -46,21 +45,16 @@ public class HttpProducerLoadManualIT extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/echo", new DrinkValidationHandler(GET.name(), null, null, "myHeader")).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
-
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java
index fbfe40d5916..01704a80cdd 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerNullBodyTest.java
@@ -20,11 +20,12 @@ import org.apache.camel.Exchange;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
public class HttpProducerNullBodyTest extends BaseHttpTest {
@@ -34,9 +35,7 @@ public class HttpProducerNullBodyTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -52,10 +51,8 @@ public class HttpProducerNullBodyTest extends BaseHttpTest {
endpointUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java
index 34475030bbc..c32c75f30ed 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerRestartTest.java
@@ -24,7 +24,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -38,9 +37,7 @@ public class HttpProducerRestartTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -56,10 +53,8 @@ public class HttpProducerRestartTest extends BaseHttpTest {
endpointUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java
index e8077050c54..2bdebb4555e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerSelectMethodTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -41,9 +40,7 @@ public class HttpProducerSelectMethodTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -57,10 +54,8 @@ public class HttpProducerSelectMethodTest extends BaseHttpTest {
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java
index 64f6d300ea8..78302769ed9 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoHeadersWithSameKeyTest.java
@@ -26,7 +26,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -43,7 +42,7 @@ public class HttpProducerTwoHeadersWithSameKeyTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -72,14 +71,10 @@ public class HttpProducerTwoHeadersWithSameKeyTest extends BaseHttpTest {
response.setCode(HttpStatus.SC_OK);
}).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java
index 937c89ba5ad..bdbd75e1dec 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerTwoParametersWithSameKeyTest.java
@@ -24,7 +24,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -41,7 +40,7 @@ public class HttpProducerTwoParametersWithSameKeyTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -56,14 +55,10 @@ public class HttpProducerTwoParametersWithSameKeyTest extends BaseHttpTest {
response.setCode(HttpStatus.SC_OK);
}).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java
index 938305799db..c0bac218b81 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProducerUserAgentTest.java
@@ -23,7 +23,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -39,9 +38,7 @@ public class HttpProducerUserAgentTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -59,10 +56,8 @@ public class HttpProducerUserAgentTest extends BaseHttpTest {
http.setUserAgent("MyAgent");
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java
index 9be42eddbdf..18a9c775760 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyAndBasicAuthTest.java
@@ -32,7 +32,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -49,7 +48,7 @@ public class HttpProxyAndBasicAuthTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
proxy = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -59,14 +58,10 @@ public class HttpProxyAndBasicAuthTest extends BaseHttpTest {
.create();
proxy.start();
- super.setUp();
-
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (proxy != null) {
proxy.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java
index dc624e8b97f..83510cd2adf 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java
@@ -33,7 +33,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -46,7 +45,7 @@ public class HttpProxyServerTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
Map<String, String> expectedHeaders = new HashMap<>();
// Don't test anymore the Proxy-Connection header as it is highly discouraged, so its support has been removed
// https://issues.apache.org/jira/browse/HTTPCLIENT-1957
@@ -58,14 +57,10 @@ public class HttpProxyServerTest extends BaseHttpTest {
new HeaderValidationHandler(GET.name(), null, null, getExpectedContent(), expectedHeaders))
.create();
proxy.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (proxy != null) {
proxy.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java
index 34d15dd69a9..a7c62e4aab4 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryParameterTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkQueryValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,21 +33,17 @@ public class HttpQueryParameterTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/moes", new DrinkQueryValidationHandler(GET.name(), null, null, "drink"))
.register("/joes", new DrinkQueryValidationHandler(GET.name(), null, null, "drink")).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java
index d88fc0ad575..f3cd6d24f20 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpQueryTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,9 +33,7 @@ public class HttpQueryTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -50,10 +47,8 @@ public class HttpQueryTest extends BaseHttpTest {
baseUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java
index f3f8e7576d3..d88893309b6 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpRedirectTest.java
@@ -27,7 +27,6 @@ import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.HttpRequestHandler;
import org.apache.hc.core5.http.protocol.HttpContext;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -45,7 +44,7 @@ public class HttpRedirectTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -54,14 +53,10 @@ public class HttpRedirectTest extends BaseHttpTest {
.register("/testPost", new RedirectPostHandler(308))
.register("/test", new RedirectHandler(HttpStatus.SC_MOVED_PERMANENTLY)).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
index 3cc6677ea1b..0988c20c230 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpReferenceParameterTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.core5.http.protocol.BasicHttpContext;
import org.apache.hc.core5.http.protocol.HttpContext;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertSame;
@@ -51,12 +50,14 @@ public class HttpReferenceParameterTest extends CamelTestSupport {
private HttpContext testHttpContext;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
this.testBinding = new TestHttpBinding();
this.testConfigurer = new TestClientConfigurer();
this.testHttpContext = new BasicHttpContext();
- super.setUp();
+ }
+
+ @Override
+ protected void doPostSetup() throws Exception {
this.endpoint1 = context.getEndpoint(TEST_URI_1, HttpEndpoint.class);
this.endpoint2 = context.getEndpoint(TEST_URI_2, HttpEndpoint.class);
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java
index 7665c23ae39..1f8991e6874 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSOTimeoutTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.component.http.handler.DelayValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.util.Timeout;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -35,20 +34,16 @@ public class HttpSOTimeoutTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/", new DelayValidationHandler(GET.name(), null, null, getExpectedContent(), 2000)).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java
index abe9996f856..1af4509e10e 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareBasicAuthTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkAuthValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,15 +36,13 @@ public class HttpSendDynamicAwareBasicAuthTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/joes", new DrinkAuthValidationHandler(GET.name(), null, null, "drink")).create();
localServer.start();
-
- super.setUp();
}
@Override
@@ -60,10 +57,8 @@ public class HttpSendDynamicAwareBasicAuthTest extends BaseHttpTest {
return context;
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java
index bf9ff2d3ad7..60cc3304a42 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareEmptyPathTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,20 +33,16 @@ public class HttpSendDynamicAwareEmptyPathTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/", new DrinkValidationHandler(GET.name(), null, null, "drink")).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java
index 57070ef1b4c..714ed8ed9c8 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareHeadersTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -35,21 +34,17 @@ public class HttpSendDynamicAwareHeadersTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/dynamicAware", new BasicValidationHandler(GET.name(), "par1=val1&par2=val2", null, null))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java
index a352cfee6b0..88bdd91b3da 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareMultiValueTest.java
@@ -26,7 +26,6 @@ import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -39,7 +38,7 @@ public class HttpSendDynamicAwareMultiValueTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy())
@@ -48,14 +47,10 @@ public class HttpSendDynamicAwareMultiValueTest extends BaseHttpTest {
.register("/dynamicAware", new BasicValidationHandler("GET", null, null, null))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java
index 06afb5f530f..93eea4fc661 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwarePathHeaderTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -35,20 +34,16 @@ public class HttpSendDynamicAwarePathHeaderTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/mybar", new DrinkValidationHandler(GET.name(), null, null, "drink")).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java
index 301a526e87f..bb0c030049d 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawParameterTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,7 +33,7 @@ public class HttpSendDynamicAwareRawParameterTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy())
@@ -43,14 +42,10 @@ public class HttpSendDynamicAwareRawParameterTest extends BaseHttpTest {
.register("/dynamicAware", new BasicValidationHandler("GET", "par1=val1&par2=val2", null, null))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java
index 1b7d1b9c663..dec1dcbf766 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareRawTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -39,7 +38,7 @@ public class HttpSendDynamicAwareRawTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -48,14 +47,10 @@ public class HttpSendDynamicAwareRawTest extends BaseHttpTest {
new DrinkValidationHandler(GET.name(), "drink=wine&password=se+%ret.$", null, "drink"))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java
index 5fb0ffd216b..f81463907a8 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.DrinkValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -35,21 +34,17 @@ public class HttpSendDynamicAwareTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/moes", new DrinkValidationHandler(GET.name(), null, null, "drink"))
.register("/joes", new DrinkValidationHandler(GET.name(), null, null, "drink")).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java
index fd8aba57626..18fc9a20ecd 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithSpacesTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -38,20 +37,16 @@ public class HttpSendDynamicAwareUriWithSpacesTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/users/*", new BasicValidationHandler("GET", null, null, "a user")).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java
index f0437ecebc6..fe6ba374f81 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSendDynamicAwareUriWithoutSlashTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -38,20 +37,16 @@ public class HttpSendDynamicAwareUriWithoutSlashTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/users/*", new BasicValidationHandler("GET", null, null, "a user")).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java
index 1faea6e2ddf..2ba2c212731 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSetHeaderIdsTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -35,7 +34,7 @@ public class HttpSetHeaderIdsTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -45,14 +44,10 @@ public class HttpSetHeaderIdsTest extends BaseHttpTest {
httpResponse.setEntity(new StringEntity(u));
}).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java
index 267d09643ba..8b9eb124440 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpSquareBracketTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,9 +33,7 @@ public class HttpSquareBracketTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -50,10 +47,8 @@ public class HttpSquareBracketTest extends BaseHttpTest {
baseUrl = "http://localhost:" + localServer.getLocalPort();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java
index 790eeb879bc..5af8d72ac42 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpThrowExceptionOnFailureTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.http.base.HttpOperationFailedException;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -43,7 +42,7 @@ public class HttpThrowExceptionOnFailureTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -51,14 +50,10 @@ public class HttpThrowExceptionOnFailureTest extends BaseHttpTest {
localServer.start();
baseUrl = "http://localhost:" + localServer.getLocalPort();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java
index 27237a2a47b..c86d014dbe2 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpToDSOTimeoutTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -36,7 +35,7 @@ public class HttpToDSOTimeoutTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -56,14 +55,10 @@ public class HttpToDSOTimeoutTest extends BaseHttpTest {
localServer.start();
baseUrl = "http://localhost:" + localServer.getLocalPort();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java
index bdde3ad544f..37e4117ceef 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpWithHttpUriHeaderTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -32,20 +31,16 @@ public class HttpWithHttpUriHeaderTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java
index 3ce48429b96..be43b4d2166 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsAuthenticationTest.java
@@ -41,8 +41,6 @@ import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -61,9 +59,8 @@ public class HttpsAuthenticationTest extends BaseHttpsTest {
@BindToRegistry("basicAuthContext")
private HttpContext basicAuthContexts = basicAuthContext();
- @BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -71,14 +68,10 @@ public class HttpsAuthenticationTest extends BaseHttpsTest {
new AuthenticationValidationHandler(GET.name(), null, null, getExpectedContent(), user, password))
.create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java
index 57325216814..561cf247252 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsGetTest.java
@@ -23,8 +23,6 @@ import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -39,22 +37,17 @@ public class HttpsGetTest extends BaseHttpsTest {
@BindToRegistry("sslContextParameters")
private SSLContextParameters sslContextParameters = new SSLContextParameters();
- @BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/mail/", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java
index ad70000b9ec..3abb0b056c5 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsProducerWithSystemPropertiesTest.java
@@ -32,7 +32,6 @@ import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.ssl.SSLContexts;
import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -82,9 +81,7 @@ public class HttpsProducerWithSystemPropertiesTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
URL serverKeystoreUurl = HttpsServerTestSupport.class.getResource("/localhost.p12");
URL serverTrustStoreUrl = HttpsServerTestSupport.class.getResource("/localhost.p12");
SSLContext sslcontext = SSLContexts.custom()
@@ -107,10 +104,8 @@ public class HttpsProducerWithSystemPropertiesTest extends BaseHttpTest {
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java
index 2caf816a60c..43cf1e25e3a 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsServerTestSupport.java
@@ -25,7 +25,6 @@ import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
public abstract class HttpsServerTestSupport extends HttpServerTestSupport {
@@ -35,19 +34,14 @@ public abstract class HttpsServerTestSupport extends HttpServerTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
System.setProperty("javax.net.ssl.trustStorePassword", PASSWORD);
final URL keystoreResourceUrl = HttpsServerTestSupport.class.getResource(KEYSTORE);
System.setProperty("javax.net.ssl.trustStore", new File(keystoreResourceUrl.toURI()).getAbsolutePath());
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
-
+ public void doPostTearDown() throws Exception {
System.clearProperty("javax.net.ssl.trustStorePassword");
System.clearProperty("javax.net.ssl.trustStore");
}
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java
index cf3f678004b..807dee4cf38 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsSslContextParametersGetTest.java
@@ -20,8 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.http.handler.BasicValidationHandler;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.http.HttpMethods.GET;
@@ -30,22 +28,17 @@ public class HttpsSslContextParametersGetTest extends HttpsGetTest {
private HttpServer localServer;
- @BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
.register("/mail/", new BasicValidationHandler(GET.name(), null, null, getExpectedContent())).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java
index 757e995b87f..db3789c7e04 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoComponentsSslContextParametersGetTest.java
@@ -23,8 +23,6 @@ import org.apache.camel.test.AvailablePortFinder;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
@@ -49,21 +47,16 @@ public class HttpsTwoComponentsSslContextParametersGetTest extends BaseHttpsTest
@BindToRegistry("https-bar")
private HttpComponent httpComponent1 = new HttpComponent();
- @BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext()).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java
index 45c73782b81..d8061ed2f75 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpsTwoDifferentSslContextParametersGetTest.java
@@ -22,8 +22,6 @@ import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -45,21 +43,16 @@ public class HttpsTwoDifferentSslContextParametersGetTest extends BaseHttpsTest
@BindToRegistry("sslContextParameters2")
private SSLContextParameters sslContextParameters2 = new SSLContextParameters();
- @BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext()).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java
index 3f9d9f04bb4..71803226393 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/ManagedHttpProducerPoolStatsTest.java
@@ -26,7 +26,6 @@ import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -45,7 +44,7 @@ public class ManagedHttpProducerPoolStatsTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor())
.setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory())
.setSslContext(getSSLContext())
@@ -54,14 +53,10 @@ public class ManagedHttpProducerPoolStatsTest extends BaseHttpTest {
response.setCode(HttpStatus.SC_OK);
}).create();
localServer.start();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java
index 69cd90d064d..3d729a66f51 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/rest/RestCamelComponentVerifierTest.java
@@ -32,7 +32,6 @@ import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.http.protocol.ResponseContent;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -48,9 +47,7 @@ public class RestCamelComponentVerifierTest extends BaseHttpTest {
@BeforeEach
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
localServer = ServerBootstrap.bootstrap()
.setHttpProcessor(getHttpProcessor())
.register("/verify", new BasicValidationHandler(GET.name(), null, null, getExpectedContent()))
@@ -67,10 +64,8 @@ public class RestCamelComponentVerifierTest extends BaseHttpTest {
parameters.put("path", "verify");
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
if (localServer != null) {
localServer.stop();
diff --git a/components/camel-ical/src/test/java/org/apache/camel/component/ical/ICalDataFormatTest.java b/components/camel-ical/src/test/java/org/apache/camel/component/ical/ICalDataFormatTest.java
index cc869941af8..46e4dc3db79 100644
--- a/components/camel-ical/src/test/java/org/apache/camel/component/ical/ICalDataFormatTest.java
+++ b/components/camel-ical/src/test/java/org/apache/camel/component/ical/ICalDataFormatTest.java
@@ -45,8 +45,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.converter.IOConverter;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
@@ -57,20 +55,14 @@ public class ICalDataFormatTest extends CamelTestSupport {
private java.util.TimeZone defaultTimeZone;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPostSetup() {
defaultTimeZone = java.util.TimeZone.getDefault();
java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("America/New_York"));
-
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
java.util.TimeZone.setDefault(defaultTimeZone);
-
- super.tearDown();
}
@Test
diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonNotUseDefaultObjectMapperTest.java b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonNotUseDefaultObjectMapperTest.java
index e14c1ae6cef..56f89497448 100644
--- a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonNotUseDefaultObjectMapperTest.java
+++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonNotUseDefaultObjectMapperTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.BindToRegistry;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,10 +37,8 @@ public class JacksonNotUseDefaultObjectMapperTest extends CamelTestSupport {
private ObjectMapper objectMapper = new ObjectMapper();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
df.setUseDefaultObjectMapper(false);
- super.setUp();
}
@Test
diff --git a/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationSpringTest.java b/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationSpringTest.java
index 35c046345ce..3a5add466bb 100644
--- a/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationSpringTest.java
+++ b/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationSpringTest.java
@@ -33,7 +33,6 @@ import org.apache.camel.converter.jaxb.message.Message;
import org.apache.camel.converter.jaxb.message.ObjectFactory;
import org.apache.camel.converter.jaxb.person.Person;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,9 +58,7 @@ public class JaxbDataFormatSchemaValidationSpringTest extends CamelSpringTestSup
private JAXBContext jbCtx;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
jbCtx = JAXBContext.newInstance(Person.class, Message.class);
}
diff --git a/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationWithObjectFactoryTest.java b/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationWithObjectFactoryTest.java
index 68741e95d9b..4eaf749cb14 100644
--- a/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationWithObjectFactoryTest.java
+++ b/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/JaxbDataFormatSchemaValidationWithObjectFactoryTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.converter.jaxb.message.Message;
import org.apache.camel.converter.jaxb.message.ObjectFactory;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
@@ -49,11 +48,7 @@ public class JaxbDataFormatSchemaValidationWithObjectFactoryTest extends CamelTe
private JAXBContext jbCtx;
@Override
- @BeforeEach
- public void setUp() throws Exception {
-
- super.setUp();
-
+ public void doPostSetup() throws Exception {
XmlRootElement xmlRootElementAnnotation = Message.class.getAnnotation(XmlRootElement.class);
assertNull(xmlRootElementAnnotation);
diff --git a/components/camel-jaxb/src/test/java/org/apache/camel/example/DataFormatTest.java b/components/camel-jaxb/src/test/java/org/apache/camel/example/DataFormatTest.java
index 4c3cc059153..91da57a532b 100644
--- a/components/camel-jaxb/src/test/java/org/apache/camel/example/DataFormatTest.java
+++ b/components/camel-jaxb/src/test/java/org/apache/camel/example/DataFormatTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.converter.jaxb.JaxbDataFormat;
import org.apache.camel.foo.bar.PersonType;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -33,9 +32,7 @@ public class DataFormatTest extends CamelTestSupport {
private MockEndpoint resultEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
}
diff --git a/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/processor/idempotent/JCacheIdempotentRepositoryTest.java b/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/processor/idempotent/JCacheIdempotentRepositoryTest.java
index 8379136d27e..f1488d35bd6 100644
--- a/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/processor/idempotent/JCacheIdempotentRepositoryTest.java
+++ b/components/camel-jcache/src/test/java/org/apache/camel/component/jcache/processor/idempotent/JCacheIdempotentRepositoryTest.java
@@ -23,8 +23,6 @@ import org.apache.camel.component.jcache.JCacheHelper;
import org.apache.camel.component.jcache.JCacheManager;
import org.apache.camel.component.jcache.support.HazelcastTest;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,9 +39,7 @@ public class JCacheIdempotentRepositoryTest extends CamelTestSupport {
private JCacheIdempotentRepository repository;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
cacheManager = JCacheHelper.createManager(context, new JCacheConfiguration("idempotent-repository"));
cache = cacheManager.getCache();
@@ -54,9 +50,7 @@ public class JCacheIdempotentRepositoryTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() throws Exception {
repository.stop();
cacheManager.close();
}
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
index dd65fe36398..3179abebf94 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
@@ -48,9 +48,8 @@ public abstract class JcrAuthTestBase extends CamelTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPostSetup() {
deleteDirectory(REPO_PATH);
- super.setUp();
}
@Override
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrGetNodeByIdTest.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrGetNodeByIdTest.java
index 4e86e926ac6..858e171aed3 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrGetNodeByIdTest.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrGetNodeByIdTest.java
@@ -17,6 +17,7 @@
package org.apache.camel.component.jcr;
import javax.jcr.Node;
+import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.Value;
import javax.jcr.ValueFactory;
@@ -25,7 +26,6 @@ import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class JcrGetNodeByIdTest extends JcrRouteTestSupport {
@@ -37,10 +37,7 @@ public class JcrGetNodeByIdTest extends JcrRouteTestSupport {
private MockEndpoint result;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPreSetup() throws RepositoryException {
Session session = openSession();
Node node = session.getRootNode().addNode("home").addNode("test");
node.setProperty("content.approved", APPROVED);
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
index 0b9d10cea6f..b44b536e01e 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
@@ -23,7 +23,6 @@ import javax.jcr.ValueFactory;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@@ -36,10 +35,7 @@ public class JcrNodePathCreationTest extends JcrRouteTestSupport {
private Value[] multiValued;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPreSetup() throws Exception {
Session session = openSession();
ValueFactory valFact = session.getValueFactory();
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java
index 902acc9bbfd..6f20346aceb 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteDifferentWorkspaceTestSupport.java
@@ -47,9 +47,13 @@ public abstract class JcrRouteDifferentWorkspaceTestSupport extends CamelTestSup
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory(REPO_PATH);
- super.setUp();
+
+ }
+
+ @Override
+ protected void doPostSetup() throws Exception {
Session session = getRepository().login(new SimpleCredentials("user", "pass".toCharArray()));
Workspace workspace = session.getWorkspace();
workspace.createWorkspace(CUSTOM_WORKSPACE_NAME);
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java
index 75f4775fd4a..ed9957d7c1a 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java
@@ -27,7 +27,6 @@ import javax.jcr.SimpleCredentials;
import org.apache.camel.spi.Registry;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.jackrabbit.core.TransientRepository;
-import org.junit.jupiter.api.BeforeEach;
import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
@@ -43,10 +42,8 @@ public abstract class JcrRouteTestSupport extends CamelTestSupport {
private static final Repository repository = new TransientRepository(CONFIG_FILE, REPO_PATH);
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory(REPO_PATH);
- super.setUp();
}
protected Repository getRepository() {
diff --git a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java
index 40965ae885c..7a09d5f1c2c 100644
--- a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java
+++ b/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.jdbc;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
@@ -34,20 +33,15 @@ public abstract class AbstractJdbcTestSupport extends CamelTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
db = new EmbeddedDatabaseBuilder()
.setName(getClass().getSimpleName())
.setType(EmbeddedDatabaseType.DERBY)
.addScript("sql/init.sql").build();
-
- super.setUp();
}
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
-
+ public void doPostTearDown() {
db.shutdown();
}
}
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueManualIT.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueManualIT.java
index 204315b34e6..9c11990d2c5 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueManualIT.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueManualIT.java
@@ -34,11 +34,10 @@ public final class HttpProducerJMXBeansIssueManualIT extends BaseJettyTest {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
// to enable the JMX connector
enableJMX();
System.setProperty("org.apache.camel.jmx.createRmiConnector", "True");
- super.setUp();
}
@Override
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpStreamCacheFileStopIssueTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpStreamCacheFileStopIssueTest.java
index 5a939fd14eb..e082f8460a4 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpStreamCacheFileStopIssueTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpStreamCacheFileStopIssueTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.createDirectory;
@@ -35,11 +34,9 @@ public class HttpStreamCacheFileStopIssueTest extends BaseJettyTest {
private final String body = "12345678901234567890123456789012345678901234567890";
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/cachedir");
createDirectory("target/cachedir");
- super.setUp();
}
@Test
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsAsyncRouteTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsAsyncRouteTest.java
index ffe77718803..499897c0edd 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsAsyncRouteTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsAsyncRouteTest.java
@@ -33,8 +33,6 @@ import org.apache.camel.Processor;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -56,9 +54,7 @@ public class HttpsAsyncRouteTest extends HttpsRouteTest {
private static final Logger LOG = LoggerFactory.getLogger(HttpsAsyncRouteTest.class);
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
// ensure jsse clients can validate the self signed dummy localhost
// cert,
// use the server keystore as the trust store for these tests
@@ -69,10 +65,8 @@ public class HttpsAsyncRouteTest extends HttpsRouteTest {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
restoreSystemProperties();
- super.tearDown();
}
@Override
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteSetupWithSystemPropsTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteSetupWithSystemPropsTest.java
index be420cd444f..8f49970dfe8 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteSetupWithSystemPropsTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteSetupWithSystemPropsTest.java
@@ -21,7 +21,6 @@ import java.net.URL;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.parallel.ResourceLock;
import static org.apache.camel.component.jetty.BaseJettyTest.SSL_SYSPROPS;
@@ -30,8 +29,7 @@ import static org.apache.camel.component.jetty.BaseJettyTest.SSL_SYSPROPS;
public class HttpsRouteSetupWithSystemPropsTest extends HttpsRouteTest {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
// ensure jsse clients can validate the self signed dummy localhost
// cert,
// use the server keystore as the trust store for these tests
@@ -45,8 +43,6 @@ public class HttpsRouteSetupWithSystemPropsTest extends HttpsRouteTest {
setSystemProp("org.eclipse.jetty.ssl.password", pwd);
setSystemProp("jdk.tls.client.protocols", "TLSv1.3");
// END SNIPPET: e1
-
- super.setUp();
}
@Override
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteTest.java
index f819568baa7..ce90afcac32 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpsRouteTest.java
@@ -39,8 +39,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.support.jsse.SSLContextParameters;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -72,9 +70,7 @@ public class HttpsRouteTest extends BaseJettyTest {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
// ensure jsse clients can validate the self signed dummy localhost cert,
// use the server keystore as the trust store for these tests
URL trustStoreUrl = this.getClass().getClassLoader().getResource("jsse/localhost.p12");
@@ -84,10 +80,8 @@ public class HttpsRouteTest extends BaseJettyTest {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws Exception {
restoreSystemProperties();
- super.tearDown();
}
@Override
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyEnableJmxTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyEnableJmxTest.java
index 246e622b5e8..4e3a69b430d 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyEnableJmxTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyEnableJmxTest.java
@@ -28,8 +28,6 @@ import javax.management.ObjectName;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.AvailablePortFinder;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -50,20 +48,21 @@ public class JettyEnableJmxTest extends BaseJettyTest {
private MBeanServerConnection mbsc;
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws Exception {
releaseMBeanServers();
mbsc = null;
- super.tearDown();
disableJMX();
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
enableJMX();
releaseMBeanServers();
- super.setUp();
+
+ }
+
+ @Override
+ protected void doPostSetup() {
mbsc = getMBeanConnection();
}
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyWithXPathChoiceTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyWithXPathChoiceTest.java
index 30833c16b26..8c755709412 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyWithXPathChoiceTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyWithXPathChoiceTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.jetty;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.mock.MockEndpoint.expectsMessageCount;
@@ -54,10 +53,7 @@ public class JettyWithXPathChoiceTest extends BaseJettyTest {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
x = getMockEndpoint("mock:x");
y = getMockEndpoint("mock:y");
z = getMockEndpoint("mock:z");
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MainHttpsRouteTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MainHttpsRouteTest.java
index bbc6e2f9346..6a56d79d440 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MainHttpsRouteTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MainHttpsRouteTest.java
@@ -30,8 +30,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.apache.camel.support.jsse.ClientAuthentication;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -48,9 +46,7 @@ public class MainHttpsRouteTest extends BaseJettyTest {
protected final Properties originalValues = new Properties();
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
URL trustStoreUrl = this.getClass().getClassLoader().getResource("jsse/localhost.p12");
setSystemProp("javax.net.ssl.trustStore", trustStoreUrl.toURI().getPath());
setSystemProp("javax.net.ssl.trustStorePassword", "changeit");
@@ -58,10 +54,8 @@ public class MainHttpsRouteTest extends BaseJettyTest {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws Exception {
restoreSystemProperties();
- super.tearDown();
}
@Test
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/file/JettyHttpFileCacheTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/file/JettyHttpFileCacheTest.java
index e1665d1a4dc..571a07936c7 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/file/JettyHttpFileCacheTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/file/JettyHttpFileCacheTest.java
@@ -20,7 +20,6 @@ import java.io.File;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.createDirectory;
@@ -33,10 +32,7 @@ public class JettyHttpFileCacheTest extends CamelTestSupport {
+ " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ";
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
context.getStreamCachingStrategy().setSpoolThreshold(16);
context.getStreamCachingStrategy().setSpoolDirectory("target/cachedir");
deleteDirectory("target/cachedir");
diff --git a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentTest.java b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentTest.java
index 7a2928193fe..edfa388c5f3 100644
--- a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentTest.java
+++ b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.ObjectMessage;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -72,10 +71,8 @@ public class JGroupsComponentTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
clientChannel.close();
- super.tearDown();
}
@Test
diff --git a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentWithChannelPropertiesTest.java b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentWithChannelPropertiesTest.java
index d235426e634..163bdae92bb 100644
--- a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentWithChannelPropertiesTest.java
+++ b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsComponentWithChannelPropertiesTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.ObjectMessage;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -72,10 +71,8 @@ public class JGroupsComponentWithChannelPropertiesTest extends CamelTestSupport
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
clientChannel.close();
- super.tearDown();
}
@Test
diff --git a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsConsumerTest.java b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsConsumerTest.java
index 8b481b16e07..daecac51cfc 100644
--- a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsConsumerTest.java
+++ b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsConsumerTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.ObjectMessage;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.jgroups.JGroupsConstants.HEADER_JGROUPS_ORIGINAL_MESSAGE;
@@ -63,10 +62,8 @@ public class JGroupsConsumerTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
channel.close();
- super.tearDown();
}
// Tests
diff --git a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsProducerTest.java b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsProducerTest.java
index e3c9d0efdf0..6a968e5bc11 100644
--- a/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsProducerTest.java
+++ b/components/camel-jgroups/src/test/java/org/apache/camel/component/jgroups/JGroupsProducerTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.Receiver;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -69,10 +68,8 @@ public class JGroupsProducerTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
channel.close();
- super.tearDown();
}
@Test
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/AbstractTransactionIT.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/AbstractTransactionIT.java
index 83bfdf5ad2c..3b198123cc5 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/AbstractTransactionIT.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/AbstractTransactionIT.java
@@ -29,7 +29,6 @@ import org.apache.camel.processor.errorhandler.DeadLetterChannel;
import org.apache.camel.processor.errorhandler.DefaultErrorHandler;
import org.apache.camel.spring.spi.TransactionErrorHandler;
import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Tags;
@@ -46,9 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
public abstract class AbstractTransactionIT extends AbstractSpringJMSITSupport {
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
setCamelContextService(null);
context = null;
template = null;
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java
index 7cc8f612dcb..51fde838f8f 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/JMSTransactionThrottlingRoutePolicyIT.java
@@ -37,9 +37,8 @@ public class JMSTransactionThrottlingRoutePolicyIT extends AbstractSpringJMSITSu
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("activemq-data");
- super.setUp();
}
@Test
diff --git a/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpAlgorithmsTest.java b/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpAlgorithmsTest.java
index a71d826732a..722dc5396d4 100644
--- a/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpAlgorithmsTest.java
+++ b/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpAlgorithmsTest.java
@@ -49,14 +49,6 @@ public class ScpAlgorithmsTest extends ScpServerTestSupport {
};
}
- @Override
- public void setUp() {
- }
-
- @Override
- public void tearDown() {
- }
-
@Test
public void testScpSimpleProduceWithDifferentAlgorithms() throws Exception {
Config[] configs = new Config[] {
diff --git a/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpServerTestSupport.java b/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpServerTestSupport.java
index c9feb3adc0f..18b6a0689f5 100644
--- a/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpServerTestSupport.java
+++ b/components/camel-jsch/src/test/java/org/apache/camel/component/scp/ScpServerTestSupport.java
@@ -44,7 +44,6 @@ import org.apache.sshd.server.auth.password.PasswordAuthenticator;
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator;
import org.apache.sshd.server.session.ServerSession;
import org.apache.sshd.sftp.server.SftpSubsystemFactory;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.slf4j.Logger;
@@ -90,20 +89,16 @@ public abstract class ScpServerTestSupport extends CamelTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory(getScpPath());
createDirectory(getScpPath());
setupComplete = startSshd();
setupKnownHosts();
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
-
+ public void doPostTearDown() {
if (sshd != null) {
try {
sshd.stop(true);
diff --git a/components/camel-json-validator/src/test/java/org/apache/camel/component/jsonvalidator/FileValidatorRouteTest.java b/components/camel-json-validator/src/test/java/org/apache/camel/component/jsonvalidator/FileValidatorRouteTest.java
index fbed605573f..ea62864bfa3 100644
--- a/components/camel-json-validator/src/test/java/org/apache/camel/component/jsonvalidator/FileValidatorRouteTest.java
+++ b/components/camel-json-validator/src/test/java/org/apache/camel/component/jsonvalidator/FileValidatorRouteTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.util.FileUtil;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
@@ -68,10 +67,12 @@ public class FileValidatorRouteTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/validator");
- super.setUp();
+ }
+
+ @Override
+ protected void doPostSetup() {
validEndpoint = resolveMandatoryEndpoint("mock:valid", MockEndpoint.class);
invalidEndpoint = resolveMandatoryEndpoint("mock:invalid", MockEndpoint.class);
finallyEndpoint = resolveMandatoryEndpoint("mock:finally", MockEndpoint.class);
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultConnectionPoolTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultConnectionPoolTest.java
index 210fc223839..f87b76aeb1d 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultConnectionPoolTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultConnectionPoolTest.java
@@ -17,8 +17,6 @@
package org.apache.camel.component.jt400;
import com.ibm.as400.access.AS400ConnectionPool;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -29,9 +27,7 @@ public class Jt400ComponentDefaultConnectionPoolTest extends Jt400TestSupport {
private Jt400Component component;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
component = new Jt400Component();
component.setCamelContext(context);
try {
@@ -45,8 +41,7 @@ public class Jt400ComponentDefaultConnectionPoolTest extends Jt400TestSupport {
}
@Override
- @AfterEach
- public void tearDown() {
+ public void doPostTearDown() {
if (component != null) {
component.stop();
}
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultSecureConnectionPoolTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultSecureConnectionPoolTest.java
index 85404502188..6390df1d601 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultSecureConnectionPoolTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentDefaultSecureConnectionPoolTest.java
@@ -17,8 +17,6 @@
package org.apache.camel.component.jt400;
import com.ibm.as400.access.AS400ConnectionPool;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -29,9 +27,7 @@ public class Jt400ComponentDefaultSecureConnectionPoolTest extends Jt400TestSupp
private Jt400Component component;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
component = new Jt400Component();
component.setCamelContext(context);
try {
@@ -45,8 +41,7 @@ public class Jt400ComponentDefaultSecureConnectionPoolTest extends Jt400TestSupp
}
@Override
- @AfterEach
- public void tearDown() {
+ public void doPostTearDown() {
if (component != null) {
component.stop();
}
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java
index 697879aca74..a05128fd4ee 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ComponentTest.java
@@ -17,7 +17,6 @@
package org.apache.camel.component.jt400;
import org.apache.camel.Endpoint;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -32,12 +31,9 @@ public class Jt400ComponentTest extends Jt400TestSupport {
private Jt400Component component;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() {
component = new Jt400Component();
- component.setCamelContext(context());
+ component.setCamelContext(context);
}
/**
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationConnectionTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationConnectionTest.java
index 2f3188fead4..d64da666198 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationConnectionTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationConnectionTest.java
@@ -17,8 +17,6 @@
package org.apache.camel.component.jt400;
import com.ibm.as400.access.AS400;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -30,10 +28,7 @@ public class Jt400ConfigurationConnectionTest extends Jt400TestSupport {
private AS400 connection;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
jt400Configuration
= new Jt400Configuration("jt400://USER:password@host/QSYS.LIB/LIBRARY.LIB/QUEUE.DTAQ", getConnectionPool());
jt400Configuration.setCcsid(37);
@@ -41,12 +36,10 @@ public class Jt400ConfigurationConnectionTest extends Jt400TestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
if (connection != null) {
jt400Configuration.releaseConnection(connection);
}
- super.tearDown();
}
@Test
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationSecureConnectionTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationSecureConnectionTest.java
index 7425019b606..3439002ca8a 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationSecureConnectionTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationSecureConnectionTest.java
@@ -17,8 +17,6 @@
package org.apache.camel.component.jt400;
import com.ibm.as400.access.AS400;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -30,10 +28,7 @@ public class Jt400ConfigurationSecureConnectionTest extends Jt400SecureTestSuppo
private AS400 connection;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
jt400Configuration
= new Jt400Configuration("jt400://USER:password@host/QSYS.LIB/LIBRARY.LIB/QUEUE.DTAQ", getConnectionPool());
jt400Configuration.setCcsid(37);
@@ -42,12 +37,10 @@ public class Jt400ConfigurationSecureConnectionTest extends Jt400SecureTestSuppo
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
if (connection != null) {
jt400Configuration.releaseConnection(connection);
}
- super.tearDown();
}
@Test
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationTest.java
index 897d8454dc0..71f5d5ea837 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400ConfigurationTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.jt400;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -27,9 +26,7 @@ public class Jt400ConfigurationTest extends Jt400TestSupport {
private Jt400Configuration jt400Configuration;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
jt400Configuration
= new Jt400Configuration("jt400://USER:password@host/QSYS.LIB/LIBRARY.LIB/QUEUE.DTAQ", getConnectionPool());
}
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueProducerTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueProducerTest.java
index dfe1c90800b..a945fba0112 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueProducerTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueProducerTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.jt400;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -28,9 +27,7 @@ public class Jt400DataQueueProducerTest extends Jt400TestSupport {
private Jt400DataQueueProducer producer;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
Jt400Endpoint endpoint = resolveMandatoryEndpoint(
"jt400://user:" + PASSWORD + "@host/qsys.lib/library.lib/queue.dtaq?connectionPool=#mockPool",
Jt400Endpoint.class);
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400EndpointTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400EndpointTest.java
index 869841c081d..6e7410ca372 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400EndpointTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400EndpointTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.jt400;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -30,9 +29,7 @@ public class Jt400EndpointTest extends Jt400TestSupport {
private Jt400Endpoint endpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
endpoint = (Jt400Endpoint) resolveMandatoryEndpoint(
"jt400://user:password@host/qsys.lib/library.lib/queue.dtaq?ccsid=500&format=binary&guiAvailable=true&connectionPool=#mockPool");
}
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400PgmEndpointTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400PgmEndpointTest.java
index 6f7f05f4be1..83509cf547f 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400PgmEndpointTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400PgmEndpointTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.jt400;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -35,9 +34,7 @@ public class Jt400PgmEndpointTest extends Jt400TestSupport {
private Jt400Endpoint endpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
endpoint = (Jt400Endpoint) resolveMandatoryEndpoint("jt400://" + USER + ":" + PASSWORD
+ "@" + HOST + PGM
+ "?connectionPool=#mockPool&guiAvailable=true&format=binary&outputFieldsIdx=1,2&fieldsLength=10,512,255");
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java
index 1b314781f23..8ec80d8cfe4 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SecureTestSupport.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.jt400;
import com.ibm.as400.access.AS400ConnectionPool;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
/**
@@ -36,15 +35,12 @@ public abstract class Jt400SecureTestSupport extends CamelTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
connectionPool = new MockAS400SecureConnectionPool();
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
if (connectionPool != null) {
connectionPool.close();
}
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SrvPgmEndpointTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SrvPgmEndpointTest.java
index 8c6576ce584..3c6f27fc9f6 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SrvPgmEndpointTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400SrvPgmEndpointTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.jt400;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -36,9 +35,7 @@ public class Jt400SrvPgmEndpointTest extends Jt400TestSupport {
private Jt400Endpoint endpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
endpoint = (Jt400Endpoint) resolveMandatoryEndpoint("jt400://" + USER + ":" + PASSWORD
+ "@" + HOST + PGM
+ "?connectionPool=#mockPool&guiAvailable=true&format=binary&outputFieldsIdx=1,2&fieldsLength=10,512,255"
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java
index 912c9a0881d..ccdcd2d2899 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400TestSupport.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.jt400;
import com.ibm.as400.access.AS400ConnectionPool;
import org.apache.camel.BindToRegistry;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
/**
@@ -36,15 +35,12 @@ public abstract class Jt400TestSupport extends CamelTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
connectionPool = new MockAS400ConnectionPool();
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
if (connectionPool != null) {
connectionPool.close();
}
diff --git a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/KubernetesTestSupport.java b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/KubernetesTestSupport.java
index 3a82aae1b09..e3de1e0920f 100644
--- a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/KubernetesTestSupport.java
+++ b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/KubernetesTestSupport.java
@@ -43,11 +43,10 @@ public class KubernetesTestSupport extends CamelTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
// INSERT credentials and host here
authToken = System.getProperty("kubernetes.test.auth");
host = System.getProperty("kubernetes.test.host");
- super.setUp();
}
public static String toUrlEncoded(String str) throws UnsupportedEncodingException {
diff --git a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/ConfigMapPropertiesFunctionRouteTest.java b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/ConfigMapPropertiesFunctionRouteTest.java
index 82b962eb3ad..a782e7812a0 100644
--- a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/ConfigMapPropertiesFunctionRouteTest.java
+++ b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/ConfigMapPropertiesFunctionRouteTest.java
@@ -84,7 +84,7 @@ public class ConfigMapPropertiesFunctionRouteTest extends KubernetesTestSupport
}
@Override
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
if (client != null && cm != null) {
try {
client.resource(cm).delete();
@@ -92,8 +92,6 @@ public class ConfigMapPropertiesFunctionRouteTest extends KubernetesTestSupport
// ignore
}
}
-
- super.tearDown();
}
@Test
diff --git a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/SecretPropertiesFunctionRouteTest.java b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/SecretPropertiesFunctionRouteTest.java
index 63edbcd721a..4e00198c4eb 100644
--- a/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/SecretPropertiesFunctionRouteTest.java
+++ b/components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/properties/SecretPropertiesFunctionRouteTest.java
@@ -85,7 +85,7 @@ public class SecretPropertiesFunctionRouteTest extends KubernetesTestSupport {
}
@Override
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
if (client != null && sec != null) {
try {
client.resource(sec).delete();
@@ -93,8 +93,6 @@ public class SecretPropertiesFunctionRouteTest extends KubernetesTestSupport {
// ignore
}
}
-
- super.tearDown();
}
@Test
diff --git a/components/camel-kudu/src/test/java/org/apache/camel/component/kudu/AbstractKuduTest.java b/components/camel-kudu/src/test/java/org/apache/camel/component/kudu/AbstractKuduTest.java
index 3a3c6e0695f..8fdb10d88fc 100644
--- a/components/camel-kudu/src/test/java/org/apache/camel/component/kudu/AbstractKuduTest.java
+++ b/components/camel-kudu/src/test/java/org/apache/camel/component/kudu/AbstractKuduTest.java
@@ -30,9 +30,7 @@ import org.apache.kudu.client.KuduClient;
import org.apache.kudu.client.KuduException;
import org.apache.kudu.client.KuduTable;
import org.apache.kudu.client.PartialRow;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -77,19 +75,20 @@ public abstract class AbstractKuduTest extends CamelTestSupport {
LOG.trace("Table {} created.", tableName);
}
- @BeforeEach
- public void setUp() throws Exception {
+ @Override
+ public void doPreSetup() {
Assumptions.assumeTrue(ikc.hasKuduHarness(), "Skipping the test because the Kudu harness is not runnable");
+ }
- super.setUp();
+ @Override
+ protected void doPostSetup() {
ikc.setupCamelContext(this.context);
}
- @AfterEach
- public void tearDown() throws Exception {
+ @Override
+ public void doPostTearDown() {
if (ikc.hasKuduHarness()) {
deleteTestTable("TestTable");
- super.tearDown();
}
}
diff --git a/components/camel-ldif/src/test/java/org/apache/camel/component/ldif/LdifRouteIT.java b/components/camel-ldif/src/test/java/org/apache/camel/component/ldif/LdifRouteIT.java
index c1d4fe605a9..5c547423dcf 100644
--- a/components/camel-ldif/src/test/java/org/apache/camel/component/ldif/LdifRouteIT.java
+++ b/components/camel-ldif/src/test/java/org/apache/camel/component/ldif/LdifRouteIT.java
@@ -46,7 +46,6 @@ import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.ldap.client.api.DefaultLdapConnectionFactory;
import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.ldap.client.api.LdapConnectionConfig;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -110,8 +109,8 @@ public class LdifRouteIT extends LdifTestSupport {
return reg;
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
if (camel != null) {
camel.stop();
}
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentDifferentGroupsTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentDifferentGroupsTest.java
index f489dc8d9b7..aaf86637670 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentDifferentGroupsTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentDifferentGroupsTest.java
@@ -23,7 +23,6 @@ import java.util.concurrent.Executors;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -33,10 +32,8 @@ import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
public class LevelDBAggregateConcurrentDifferentGroupsTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentSameGroupTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentSameGroupTest.java
index a80383d4bff..1f61ede327c 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentSameGroupTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateConcurrentSameGroupTest.java
@@ -23,7 +23,6 @@ import java.util.concurrent.Executors;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -33,10 +32,8 @@ import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
public class LevelDBAggregateConcurrentSameGroupTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateDiscardOnTimeoutTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateDiscardOnTimeoutTest.java
index 3e4ae9264f1..987a21b7166 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateDiscardOnTimeoutTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateDiscardOnTimeoutTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -32,10 +31,8 @@ import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
public class LevelDBAggregateDiscardOnTimeoutTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateForceCompletionHeaderTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateForceCompletionHeaderTest.java
index 6f366e14fc2..e7f483b80b5 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateForceCompletionHeaderTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateForceCompletionHeaderTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -36,10 +35,8 @@ import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
public class LevelDBAggregateForceCompletionHeaderTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadAndRecoverTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadAndRecoverTest.java
index c2d6fd2d900..8ba1ee368a8 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadAndRecoverTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadAndRecoverTest.java
@@ -45,9 +45,8 @@ public class LevelDBAggregateLoadAndRecoverTest extends LevelDBTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadConcurrentTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadConcurrentTest.java
index 73dc47cbfa9..7aef65e23a4 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadConcurrentTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadConcurrentTest.java
@@ -40,9 +40,8 @@ public class LevelDBAggregateLoadConcurrentTest extends LevelDBTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadTest.java
index b336e76e413..6953a810366 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateLoadTest.java
@@ -37,9 +37,8 @@ public class LevelDBAggregateLoadTest extends LevelDBTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostRemovedWhenConfirmedTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostRemovedWhenConfirmedTest.java
index f802577235f..6af08d4fef8 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostRemovedWhenConfirmedTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostRemovedWhenConfirmedTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
import org.awaitility.Awaitility;
import org.hamcrest.Matchers;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -40,11 +39,9 @@ public class LevelDBAggregateNotLostRemovedWhenConfirmedTest extends LevelDBTest
private LevelDBAggregationRepository repo;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
repo = new LevelDBAggregationRepository("repo1", "target/data/leveldb.dat");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostTest.java
index ff2c0009bcb..85d492a6a0b 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateNotLostTest.java
@@ -25,7 +25,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
import org.awaitility.Awaitility;
import org.hamcrest.Matchers;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -38,10 +37,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
public class LevelDBAggregateNotLostTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelFailedTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelFailedTest.java
index 93469c397b9..c96c50b6d4e 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelFailedTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelFailedTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -33,8 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class LevelDBAggregateRecoverDeadLetterChannelFailedTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
// enable recovery
getRepo().setUseRecovery(true);
@@ -44,8 +42,6 @@ public class LevelDBAggregateRecoverDeadLetterChannelFailedTest extends LevelDBT
getRepo().setDeadLetterUri("direct:dead");
// check faster
getRepo().setRecoveryInterval(1000, TimeUnit.MILLISECONDS);
-
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelTest.java
index 1ed9edef782..47775104f47 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverDeadLetterChannelTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -32,8 +31,7 @@ import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
public class LevelDBAggregateRecoverDeadLetterChannelTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
// enable recovery
getRepo().setUseRecovery(true);
@@ -43,8 +41,6 @@ public class LevelDBAggregateRecoverDeadLetterChannelTest extends LevelDBTestSup
getRepo().setDeadLetterUri("mock:dead");
// check faster
getRepo().setRecoveryInterval(500, TimeUnit.MILLISECONDS);
-
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverTest.java
index 3b27484732b..470e96ac53d 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -47,14 +46,12 @@ public class LevelDBAggregateRecoverTest extends LevelDBTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
// enable recovery
getRepo().setUseRecovery(true);
// check faster
getRepo().setRecoveryInterval(500, TimeUnit.MILLISECONDS);
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithRedeliveryPolicyTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithRedeliveryPolicyTest.java
index c2f477d812c..7d719edffb2 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithRedeliveryPolicyTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithRedeliveryPolicyTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -47,14 +46,12 @@ public class LevelDBAggregateRecoverWithRedeliveryPolicyTest extends LevelDBTest
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
// enable recovery
getRepo().setUseRecovery(true);
// check faster
getRepo().setRecoveryInterval(500, TimeUnit.MILLISECONDS);
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithSedaTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithSedaTest.java
index 2d04daa5a8f..beabdf77bd1 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithSedaTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateRecoverWithSedaTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -47,11 +46,8 @@ public class LevelDBAggregateRecoverWithSedaTest extends LevelDBTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
-
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateSerializedHeadersTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateSerializedHeadersTest.java
index 63ebbea50e9..2aaa0b6805f 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateSerializedHeadersTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateSerializedHeadersTest.java
@@ -39,10 +39,9 @@ public class LevelDBAggregateSerializedHeadersTest extends LevelDBTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
getRepo().setAllowSerializedHeaders(true);
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTest.java
index 8400f21b161..41deaa1646d 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Parameterized;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -34,10 +33,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class LevelDBAggregateTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTimeoutCompletionRestartTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTimeoutCompletionRestartTest.java
index 7a9902e4776..dafbe268708 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTimeoutCompletionRestartTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregateTimeoutCompletionRestartTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.leveldb;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -30,10 +29,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class LevelDBAggregateTimeoutCompletionRestartTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryAlotDataTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryAlotDataTest.java
index 36560677348..53438c76fc7 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryAlotDataTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryAlotDataTest.java
@@ -21,8 +21,6 @@ import java.io.File;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -35,9 +33,7 @@ public class LevelDBAggregationRepositoryAlotDataTest extends LevelDBTestSupport
private LevelDBFile levelDBFile;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
deleteDirectory("target/data");
File file = new File("target/data/leveldb.dat");
levelDBFile = new LevelDBFile();
@@ -46,10 +42,8 @@ public class LevelDBAggregationRepositoryAlotDataTest extends LevelDBTestSupport
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
levelDBFile.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryLoadExistingTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryLoadExistingTest.java
index d03f72457cf..522045fa66d 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryLoadExistingTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryLoadExistingTest.java
@@ -21,8 +21,6 @@ import java.io.File;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -36,9 +34,7 @@ public class LevelDBAggregationRepositoryLoadExistingTest extends LevelDBTestSup
private LevelDBFile levelDBFile;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
deleteDirectory("target/data");
File file = new File("target/data/leveldb.dat");
levelDBFile = new LevelDBFile();
@@ -47,10 +43,8 @@ public class LevelDBAggregationRepositoryLoadExistingTest extends LevelDBTestSup
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
levelDBFile.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryMultipleRepoTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryMultipleRepoTest.java
index 00763c492eb..0133d9efadd 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryMultipleRepoTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryMultipleRepoTest.java
@@ -21,8 +21,6 @@ import java.io.File;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -36,9 +34,7 @@ public class LevelDBAggregationRepositoryMultipleRepoTest extends LevelDBTestSup
private LevelDBFile levelDBFile;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
deleteDirectory("target/data");
File file = new File("target/data/leveldb.dat");
levelDBFile = new LevelDBFile();
@@ -47,10 +43,8 @@ public class LevelDBAggregationRepositoryMultipleRepoTest extends LevelDBTestSup
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
levelDBFile.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryRecoverExistingTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryRecoverExistingTest.java
index 0dd99e87efc..ba2b9fe9076 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryRecoverExistingTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryRecoverExistingTest.java
@@ -21,7 +21,6 @@ import java.io.File;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -36,9 +35,7 @@ public class LevelDBAggregationRepositoryRecoverExistingTest extends LevelDBTest
private LevelDBFile levelDBFile;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
deleteDirectory("target/data");
File file = new File("target/data/leveldb.dat");
levelDBFile = new LevelDBFile();
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryTest.java
index 618a7ff858b..f36b89d3334 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBAggregationRepositoryTest.java
@@ -21,8 +21,6 @@ import java.io.File;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -36,9 +34,7 @@ public class LevelDBAggregationRepositoryTest extends LevelDBTestSupport {
private LevelDBFile levelDBFile;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
deleteDirectory("target/data");
File file = new File("target/data/leveldb.dat");
levelDBFile = new LevelDBFile();
@@ -47,10 +43,8 @@ public class LevelDBAggregationRepositoryTest extends LevelDBTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
levelDBFile.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBigPayloadManualTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBigPayloadManualTest.java
index 5fd7b515d35..925e1f58e9f 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBigPayloadManualTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBigPayloadManualTest.java
@@ -45,9 +45,8 @@ public class LevelDBBigPayloadManualTest extends LevelDBTestSupport {
@BeforeEach
@Override
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBinaryTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBinaryTest.java
index d6d28bc37c8..116998ee183 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBinaryTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBBinaryTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.params.Parameterized;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -36,10 +35,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class LevelDBBinaryTest extends LevelDBTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBCustomSerializationTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBCustomSerializationTest.java
index 51bf2918392..8ddc1787086 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBCustomSerializationTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBCustomSerializationTest.java
@@ -37,7 +37,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.leveldb.serializer.JacksonLevelDBSerializer;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -49,10 +48,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class LevelDBCustomSerializationTest extends CamelTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBExchangeSerializationTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBExchangeSerializationTest.java
index 4ae4de0f4cf..3384d594b17 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBExchangeSerializationTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBExchangeSerializationTest.java
@@ -22,8 +22,6 @@ import java.util.Date;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -39,9 +37,7 @@ public class LevelDBExchangeSerializationTest extends LevelDBTestSupport {
private LevelDBFile levelDBFile;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
deleteDirectory("target/data");
File file = new File("target/data/leveldb.dat");
levelDBFile = new LevelDBFile();
@@ -50,10 +46,8 @@ public class LevelDBExchangeSerializationTest extends LevelDBTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
levelDBFile.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBGetNotFoundTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBGetNotFoundTest.java
index fda52cae2ad..37627cd83f7 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBGetNotFoundTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBGetNotFoundTest.java
@@ -21,8 +21,6 @@ import java.io.File;
import org.apache.camel.Exchange;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.params.Test;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.slf4j.Logger;
@@ -39,9 +37,7 @@ public class LevelDBGetNotFoundTest extends LevelDBTestSupport {
private Logger log = LoggerFactory.getLogger(getClass());
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
deleteDirectory("target/data");
File file = new File("target/data/leveldb.dat");
levelDBFile = new LevelDBFile();
@@ -50,10 +46,8 @@ public class LevelDBGetNotFoundTest extends LevelDBTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
levelDBFile.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
index 45399d991c8..bdcc977ec1b 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
@@ -33,14 +33,8 @@ public class LevelDBSetupTest extends CamelTestSupport {
private LevelDBFile levelDBFile;
@Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
deleteDirectory("leveldb.dat");
- super.tearDown();
}
/**
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateRecoverWithRedeliveryPolicyTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateRecoverWithRedeliveryPolicyTest.java
index 7d750372d3c..99138696693 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateRecoverWithRedeliveryPolicyTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateRecoverWithRedeliveryPolicyTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -45,10 +44,9 @@ public class LevelDBSpringAggregateRecoverWithRedeliveryPolicyTest extends Camel
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
+ super.doPreSetup();
deleteDirectory("target/data");
- super.setUp();
}
@Test
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateTest.java
index 3b9381da236..4d53797c9f8 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSpringAggregateTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.AggregationStrategy;
import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
@@ -35,10 +34,9 @@ import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
public class LevelDBSpringAggregateTest extends CamelSpringTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
+ super.doPreSetup();
deleteDirectory("target/data");
- super.setUp();
}
@Override
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentNamesTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentNamesTest.java
index abfb26695ac..b2c740b4499 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentNamesTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentNamesTest.java
@@ -38,10 +38,12 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class MailAttachmentNamesTest extends CamelTestSupport {
@@ -56,12 +58,12 @@ public class MailAttachmentNamesTest extends CamelTestSupport {
Session session;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
session = Mailbox.getSmtpSession();
+ }
- super.setUp();
-
+ @Override
+ protected void doPostSetup() {
Mailbox.clearAll();
resultEndpoint = getMockEndpoint("mock:result");
resultEndpoint.expectedMinimumMessageCount(1);
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailBatchConsumerTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailBatchConsumerTest.java
index 4e32c698b07..bab2b6ac3b4 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailBatchConsumerTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailBatchConsumerTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.body;
@@ -40,10 +39,8 @@ public class MailBatchConsumerTest extends CamelTestSupport {
private static final MailboxUser jones = Mailbox.getOrCreateUser("jones", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCommitOnCompletionTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCommitOnCompletionTest.java
index 615f62bb49a..6fc28a17b69 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCommitOnCompletionTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCommitOnCompletionTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
@@ -41,10 +40,8 @@ public class MailCommitOnCompletionTest extends CamelTestSupport {
private static final MailboxUser jones = Mailbox.getOrCreateUser("jonesCommitOnCompletion", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConvertersTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConvertersTest.java
index 96383fe7b95..c44dd14dda4 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConvertersTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailConvertersTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
@@ -40,11 +39,9 @@ public class MailConvertersTest extends CamelTestSupport {
private MailboxUser james;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
Mailbox.clearAll();
james = Mailbox.getOrCreateUser("james", "secret");
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCopyToTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCopyToTest.java
index 43ed40190bf..ada67c40808 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCopyToTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailCopyToTest.java
@@ -29,7 +29,6 @@ import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -41,10 +40,8 @@ public class MailCopyToTest extends CamelTestSupport {
private static final MailboxUser jones = Mailbox.getOrCreateUser("jones", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDoNotDeleteIfProcessFailsTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDoNotDeleteIfProcessFailsTest.java
index 3da6db5b132..acb048c5f70 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDoNotDeleteIfProcessFailsTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDoNotDeleteIfProcessFailsTest.java
@@ -29,7 +29,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -43,10 +42,8 @@ public class MailDoNotDeleteIfProcessFailsTest extends CamelTestSupport {
private static int counter;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java
index 42f1863e783..1fa1be17256 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeTest.java
@@ -29,7 +29,6 @@ import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -41,10 +40,8 @@ public class MailFetchSizeTest extends CamelTestSupport {
private static final MailboxUser jones = Mailbox.getOrCreateUser("jones", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeZeroTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeZeroTest.java
index f8e5acfa011..2bfb4814859 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeZeroTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailFetchSizeZeroTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,10 +37,8 @@ public class MailFetchSizeZeroTest extends CamelTestSupport {
private static final MailboxUser bill = Mailbox.getOrCreateUser("bill", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryDuplicateTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryDuplicateTest.java
index c113ce81fac..c8475b5ae2e 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryDuplicateTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryDuplicateTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.support.processor.idempotent.MemoryIdempotentRepository;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -46,11 +45,9 @@ public class MailIdempotentRepositoryDuplicateTest extends CamelTestSupport {
MemoryIdempotentRepository myRepo = new MemoryIdempotentRepository();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
myRepo.start();
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryTest.java
index ae3fe99a8b8..81f862f1823 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailIdempotentRepositoryTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.support.processor.idempotent.MemoryIdempotentRepository;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -46,11 +45,9 @@ public class MailIdempotentRepositoryTest extends CamelTestSupport {
private MemoryIdempotentRepository myRepo = new MemoryIdempotentRepository();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
myRepo.start();
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMaxMessagesPerPollTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMaxMessagesPerPollTest.java
index fdb3eaea0ef..f09d9747983 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMaxMessagesPerPollTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMaxMessagesPerPollTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
@@ -37,10 +36,8 @@ public class MailMaxMessagesPerPollTest extends CamelTestSupport {
private static final MailboxUser jones = Mailbox.getOrCreateUser("jones", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMessageTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMessageTest.java
index 99d34cab8a1..2208caf526b 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMessageTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMessageTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.support.ObjectHelper;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.util.CastUtils;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
@@ -83,9 +82,7 @@ public class MailMessageTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
Mailbox.clearAll();
endpoint = checkEndpoint("pop3://someone@myhost:30/subject");
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMoveToTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMoveToTest.java
index 0bcad3cf8f0..639b1b14dbe 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMoveToTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailMoveToTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -46,10 +45,8 @@ public class MailMoveToTest extends CamelTestSupport {
private static final MailboxUser jones2 = Mailbox.getOrCreateUser("jones2", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichNoMailTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichNoMailTest.java
index 67f523614ce..6fb813558aa 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichNoMailTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichNoMailTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
@@ -34,10 +33,8 @@ public class MailPollEnrichNoMailTest extends CamelTestSupport {
private static final MailboxUser bill = Mailbox.getOrCreateUser("bill", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichTest.java
index 009ec5cdaa5..7c343358db0 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPollEnrichTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,10 +37,8 @@ public class MailPollEnrichTest extends CamelTestSupport {
private static final MailboxUser bill = Mailbox.getOrCreateUser("bill", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPostProcessActionTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPostProcessActionTest.java
index 0dbea0adf6e..40bbf3aaac6 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPostProcessActionTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPostProcessActionTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.awaitility.Awaitility;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,10 +47,8 @@ public class MailPostProcessActionTest extends CamelTestSupport {
private TestPostProcessAction action = new TestPostProcessAction();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java
index 0bb220b5bc2..aca76f613e3 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailProcessOnlyUnseenMessagesTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
@@ -37,10 +36,8 @@ public class MailProcessOnlyUnseenMessagesTest extends CamelTestSupport {
private static final MailboxUser claus = Mailbox.getOrCreateUser("claus", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermTest.java
index 6e642e62e07..ab9a21f0fd7 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermTest.java
@@ -29,7 +29,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.component.mail.SearchTermBuilder.Op;
@@ -42,10 +41,8 @@ public class MailSearchTermTest extends CamelTestSupport {
private SearchTerm term = createSearchTerm();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
protected SearchTerm createSearchTerm() {
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigLast24HoursTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigLast24HoursTest.java
index 29a8d4cb6a7..b3725f6fd25 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigLast24HoursTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigLast24HoursTest.java
@@ -29,7 +29,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,10 +37,8 @@ public class MailSearchTermUriConfigLast24HoursTest extends CamelTestSupport {
private static final MailboxUser bill = Mailbox.getOrCreateUser("bill", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigTest.java
index aabe8c51dac..52c931b4fab 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSearchTermUriConfigTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -36,10 +35,8 @@ public class MailSearchTermUriConfigTest extends CamelTestSupport {
private static final MailboxUser bill = Mailbox.getOrCreateUser("bill", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteAllTasksTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteAllTasksTest.java
index acef50503e0..d0aaf1475fc 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteAllTasksTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteAllTasksTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -40,10 +39,8 @@ public class MailShutdownCompleteAllTasksTest extends CamelTestSupport {
private static final MailboxUser jones = Mailbox.getOrCreateUser("jones", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Override
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteCurrentTaskOnlyTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteCurrentTaskOnlyTest.java
index 6f08def93bb..3868c1ae357 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteCurrentTaskOnlyTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailShutdownCompleteCurrentTaskOnlyTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -39,10 +38,8 @@ public class MailShutdownCompleteCurrentTaskOnlyTest extends CamelTestSupport {
private static final MailboxUser jones = Mailbox.getOrCreateUser("jones", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTest.java
index 286ab7a2d20..697730e0a80 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.eclipse.angus.mail.imap.SortTerm;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -53,10 +52,8 @@ public class MailSortTermTest extends CamelTestSupport {
private SearchTerm searchTerm = new SearchTermBuilder().subject("Camel").build();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermThreeTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermThreeTest.java
index 51f80d2f920..57f1098c328 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermThreeTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermThreeTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.eclipse.angus.mail.imap.SortTerm;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -53,10 +52,8 @@ public class MailSortTermThreeTest extends CamelTestSupport {
private SearchTerm searchTerm = new SearchTermBuilder().subject("Camel").build();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTwoTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTwoTest.java
index 00dc12971b1..730d132ecfb 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTwoTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSortTermTwoTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.eclipse.angus.mail.imap.SortTerm;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -53,10 +52,8 @@ public class MailSortTermTwoTest extends CamelTestSupport {
private SearchTerm searchTerm = new SearchTermBuilder().subject("Camel").build();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
prepareMailbox();
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailUsingCustomSessionTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailUsingCustomSessionTest.java
index cdaca8c6b24..f901a2210a3 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailUsingCustomSessionTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailUsingCustomSessionTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -43,9 +42,7 @@ public class MailUsingCustomSessionTest extends CamelTestSupport {
private Session mailSession = Session.getInstance(new Properties());
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
Mailbox.clearAll();
}
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MultipleDestinationConsumeTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MultipleDestinationConsumeTest.java
index 5dc3adcf8f3..42bfca0f2a6 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MultipleDestinationConsumeTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MultipleDestinationConsumeTest.java
@@ -35,7 +35,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.support.ObjectHelper;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.util.CastUtils;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -105,11 +104,8 @@ public class MultipleDestinationConsumeTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
mailSession = Mailbox.getSmtpSession();
-
- super.setUp();
}
@Override
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/RawMailMessageTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/RawMailMessageTest.java
index 0916a379a43..e444bcff80a 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/RawMailMessageTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/RawMailMessageTest.java
@@ -32,7 +32,6 @@ import org.apache.camel.component.mail.Mailbox.MailboxUser;
import org.apache.camel.component.mail.Mailbox.Protocol;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -52,14 +51,12 @@ public class RawMailMessageTest extends CamelTestSupport {
private static final MailboxUser davsclaus = Mailbox.getOrCreateUser("davsclaus", "secret");
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
Mailbox.clearAll();
prepareMailbox(jonesPop3);
prepareMailbox(jonesRawPop3);
prepareMailbox(jonesImap);
prepareMailbox(jonesRawImap);
- super.setUp();
}
@Test
diff --git a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java
index 858d23c3b88..f36acfed870 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java
@@ -37,7 +37,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.util.IOHelper;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -53,9 +52,7 @@ public class MimeMultipartDataFormatTest extends CamelTestSupport {
private AttachmentMessage in;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
exchange = new DefaultExchange(context);
in = exchange.getIn(AttachmentMessage.class);
}
diff --git a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/CounterRouteTest.java b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/CounterRouteTest.java
index 7ab74843f68..ca725b6d8b5 100644
--- a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/CounterRouteTest.java
+++ b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/CounterRouteTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
import org.mockito.Mockito;
@@ -113,8 +112,8 @@ public class CounterRouteTest extends CamelSpringTestSupport {
};
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
endpoint.reset();
reset(mockRegistry, mockCounter);
}
diff --git a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/HistogramRouteTest.java b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/HistogramRouteTest.java
index d7d4aeead16..3b5da90defb 100644
--- a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/HistogramRouteTest.java
+++ b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/HistogramRouteTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
import org.mockito.Mockito;
@@ -85,8 +84,8 @@ public class HistogramRouteTest extends CamelSpringTestSupport {
};
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
endpoint.reset();
reset(mockRegistry);
}
diff --git a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/MeterRouteTest.java b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/MeterRouteTest.java
index c0fd72b62cb..c8e55da4d14 100644
--- a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/MeterRouteTest.java
+++ b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/MeterRouteTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
import org.mockito.Mockito;
@@ -94,8 +93,8 @@ public class MeterRouteTest extends CamelSpringTestSupport {
};
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
endpoint.reset();
reset(mockRegistry, mockMeter);
}
diff --git a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/TimerRouteTest.java b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/TimerRouteTest.java
index 8520a2393c0..b2a9038c15c 100644
--- a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/TimerRouteTest.java
+++ b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/TimerRouteTest.java
@@ -27,7 +27,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
import org.mockito.Mockito;
@@ -92,8 +91,8 @@ public class TimerRouteTest extends CamelSpringTestSupport {
return context;
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
endpoint.reset();
reset(mockRegistry, mockTimer);
}
diff --git a/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/CounterRouteTest.java b/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/CounterRouteTest.java
index d4c068fad0c..578a9f9aefb 100644
--- a/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/CounterRouteTest.java
+++ b/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/CounterRouteTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
@@ -90,8 +89,8 @@ public class CounterRouteTest extends CamelSpringTestSupport {
};
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
endpoint.reset();
}
diff --git a/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/TimerRouteTest.java b/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/TimerRouteTest.java
index f161c6b3577..e4e1b8d6bf8 100644
--- a/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/TimerRouteTest.java
+++ b/components/camel-micrometer/src/test/java/org/apache/camel/component/micrometer/TimerRouteTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
@@ -96,8 +95,8 @@ public class TimerRouteTest extends CamelSpringTestSupport {
return new AnnotationConfigApplicationContext();
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
endpoint.reset();
}
diff --git a/components/camel-microprofile/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java b/components/camel-microprofile/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java
index 67290b96ef9..6290f71d9b0 100644
--- a/components/camel-microprofile/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java
+++ b/components/camel-microprofile/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java
@@ -31,7 +31,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.assertj.core.api.Assertions;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -66,10 +65,8 @@ public class CamelMicroProfilePropertiesSourceTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
ConfigProviderResolver.instance().releaseConfig(config);
- super.tearDown();
}
@Override
diff --git a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
index f5849552acf..b81cace66bf 100644
--- a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
+++ b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
@@ -37,17 +37,14 @@ import org.apache.camel.health.HealthCheckResultBuilder;
import org.apache.camel.impl.health.AbstractHealthCheck;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.eclipse.microprofile.health.HealthCheckResponse;
-import org.junit.jupiter.api.AfterEach;
public class CamelMicroProfileHealthTestSupport extends CamelTestSupport {
protected SmallRyeHealthReporter reporter = new SmallRyeHealthReporter();
@SuppressWarnings("unchecked")
- @AfterEach
@Override
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
// Hack to clean up all registered checks
Stream.of(HealthType.LIVENESS, HealthType.READINESS)
.forEach(type -> {
diff --git a/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaFiltersTest.java b/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaFiltersTest.java
index 2bce8ca1c51..14852602d08 100644
--- a/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaFiltersTest.java
+++ b/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaFiltersTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.spi.Registry;
import org.apache.mina.core.filterchain.IoFilter;
import org.apache.mina.core.filterchain.IoFilterAdapter;
import org.apache.mina.core.session.IoSession;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -51,10 +50,8 @@ public class MinaFiltersTest extends BaseMinaTest {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
TestFilter.called = 0;
- super.tearDown();
}
private void testFilter(final String uri) throws Exception {
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpClientProducerEndOfDataAndValidationTestSupport.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpClientProducerEndOfDataAndValidationTestSupport.java
index b46088fc3c2..be9db9cc26a 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpClientProducerEndOfDataAndValidationTestSupport.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpClientProducerEndOfDataAndValidationTestSupport.java
@@ -177,10 +177,8 @@ public abstract class TcpClientProducerEndOfDataAndValidationTestSupport extends
}
@Override
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws InterruptedException {
MockEndpoint.assertIsSatisfied(context, 5, TimeUnit.SECONDS);
-
- super.tearDown();
}
@Test
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java
index 9954f640d14..e1ded8a621e 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java
@@ -37,7 +37,7 @@ import org.junit.jupiter.api.extension.RegisterExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.apache.camel.component.mllp.MllpExceptionTestSupport.*;
+import static org.apache.camel.component.mllp.MllpExceptionTestSupport.LOG_PHI_TRUE;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -116,10 +116,8 @@ public abstract class TcpServerConsumerEndOfDataAndValidationTestSupport extends
}
@Override
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws InterruptedException {
MockEndpoint.assertIsSatisfied(context, 5, TimeUnit.SECONDS);
-
- super.tearDown();
}
@Test
diff --git a/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java b/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java
index 93aecda1b9f..38f9efad13a 100644
--- a/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java
+++ b/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java
@@ -24,7 +24,6 @@ import org.apache.camel.CamelContext;
import org.apache.camel.test.infra.mongodb.services.MongoDBService;
import org.apache.camel.test.infra.mongodb.services.MongoDBServiceFactory;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.extension.RegisterExtension;
public abstract class AbstractMongoDbITSupport extends CamelTestSupport {
@@ -41,10 +40,8 @@ public abstract class AbstractMongoDbITSupport extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
gridFSBucket.find().forEach(gridFSFile -> gridFSBucket.delete(gridFSFile.getId()));
- super.tearDown();
mongo.close();
}
diff --git a/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownAllTasksTest.java b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownAllTasksTest.java
index d9a2281d025..cbe6f757d9b 100644
--- a/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownAllTasksTest.java
+++ b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownAllTasksTest.java
@@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.camel.ShutdownRunningTask;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
@@ -30,10 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class MyBatisShutdownAllTasksTest extends MyBatisTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() {
// super will insert 2 accounts already
Account account = new Account();
diff --git a/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownCurrentTaskOnlyTest.java b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownCurrentTaskOnlyTest.java
index e8d44e02023..badcb393b82 100644
--- a/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownCurrentTaskOnlyTest.java
+++ b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisShutdownCurrentTaskOnlyTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.mybatis;
import org.apache.camel.ShutdownRunningTask;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -27,10 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class MyBatisShutdownCurrentTaskOnlyTest extends MyBatisTestSupport {
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() {
// super will insert 2 accounts already
Account account = new Account();
diff --git a/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java
index d71a3ba87cd..19cda2e77be 100644
--- a/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java
+++ b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisTestSupport.java
@@ -58,9 +58,7 @@ public abstract class MyBatisTestSupport extends CamelTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
try (Connection connection = createConnection();
ResultSet checkTableExistResultSet = connection.getMetaData().getTables(null, null, getTableName(), null);
Statement deletePreExistingTableStatement = connection.createStatement();
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthConstraintMapperTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthConstraintMapperTest.java
index c4c6f9f6797..ad466ced6d0 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthConstraintMapperTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthConstraintMapperTest.java
@@ -22,8 +22,6 @@ import org.apache.camel.BindToRegistry;
import org.apache.camel.CamelExecutionException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
@@ -34,17 +32,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class NettyHttpBasicAuthConstraintMapperTest extends BaseNettyTest {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
System.setProperty("java.security.auth.login.config", "src/test/resources/myjaas.config");
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
System.clearProperty("java.security.auth.login.config");
- super.tearDown();
}
@BindToRegistry("mySecurityConfig")
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthTest.java
index 526a48dc07f..ec79f49f828 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthTest.java
@@ -20,8 +20,6 @@ import org.apache.camel.BindToRegistry;
import org.apache.camel.CamelExecutionException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
@@ -31,17 +29,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class NettyHttpBasicAuthTest extends BaseNettyTest {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
System.setProperty("java.security.auth.login.config", "src/test/resources/myjaas.config");
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
System.clearProperty("java.security.auth.login.config");
- super.tearDown();
}
@BindToRegistry("mySecurityConfig")
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSSLTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSSLTest.java
index 5d424261a71..2d93fb0a4cd 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSSLTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSSLTest.java
@@ -26,8 +26,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.netty.NettyConstants;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
@@ -41,22 +39,17 @@ public class NettyHttpSSLTest extends BaseNettyTest {
protected final Properties originalValues = new Properties();
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
// ensure jsse clients can validate the self signed dummy localhost cert,
// use the server keystore as the trust store for these tests
URL trustStoreUrl = this.getClass().getClassLoader().getResource("jsse/localhost.p12");
setSystemProp("javax.net.ssl.trustStore", trustStoreUrl.toURI().getPath());
setSystemProp("javax.net.ssl.trustStorePassword", "changeit");
-
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
restoreSystemProperties();
- super.tearDown();
}
protected void setSystemProp(String key, String value) {
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthConstraintMapperTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthConstraintMapperTest.java
index 74575a3ffa1..374a8ac4a83 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthConstraintMapperTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthConstraintMapperTest.java
@@ -22,8 +22,6 @@ import org.apache.camel.BindToRegistry;
import org.apache.camel.CamelExecutionException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
@@ -40,17 +38,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class NettyHttpSimpleBasicAuthConstraintMapperTest extends BaseNettyTest {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
System.setProperty("java.security.auth.login.config", "src/test/resources/myjaas.config");
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
System.clearProperty("java.security.auth.login.config");
- super.tearDown();
}
@BindToRegistry("myConstraint")
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthTest.java
index 33afc330531..620fd99ee56 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSimpleBasicAuthTest.java
@@ -19,8 +19,6 @@ package org.apache.camel.component.netty.http;
import org.apache.camel.CamelExecutionException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
@@ -36,17 +34,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class NettyHttpSimpleBasicAuthTest extends BaseNettyTest {
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
System.setProperty("java.security.auth.login.config", "src/test/resources/myjaas.config");
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
System.clearProperty("java.security.auth.login.config");
- super.tearDown();
}
private void sendUnauthorizedRequest() {
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpStreamCacheFileResponseTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpStreamCacheFileResponseTest.java
index 005ca6bd37c..ce69f8f5751 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpStreamCacheFileResponseTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpStreamCacheFileResponseTest.java
@@ -23,7 +23,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.builder.RouteBuilder;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.apache.camel.test.junit5.TestSupport.createDirectory;
@@ -37,11 +36,9 @@ public class NettyHttpStreamCacheFileResponseTest extends BaseNettyTest {
private final String body2 = "Bye " + body;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
deleteDirectory("target/cachedir");
createDirectory("target/cachedir");
- super.setUp();
}
@Test
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettySharedHttpServerTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettySharedHttpServerTest.java
index 4ce5d5b5b15..df1ed729dd1 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettySharedHttpServerTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettySharedHttpServerTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.netty.http;
import org.apache.camel.BindToRegistry;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -47,10 +46,8 @@ public class NettySharedHttpServerTest extends BaseNettyTest {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
nettySharedHttpServer.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyConverterTest.java b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyConverterTest.java
index e626420f58f..ddcf58b3b28 100644
--- a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyConverterTest.java
+++ b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyConverterTest.java
@@ -20,7 +20,6 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -47,8 +46,7 @@ public class NettyConverterTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() {
+ public void doPostTearDown() {
buf.release();
}
diff --git a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyRedeliveryTest.java b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyRedeliveryTest.java
index 66e2dbf83a5..6aab8f8c9f6 100644
--- a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyRedeliveryTest.java
+++ b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyRedeliveryTest.java
@@ -36,7 +36,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -99,9 +98,7 @@ public class NettyRedeliveryTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
alive = false;
listener.shutdown();
}
diff --git a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyUseSharedWorkerThreadPoolManyRoutesTest.java b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyUseSharedWorkerThreadPoolManyRoutesTest.java
index dd16ba2dc54..cd7d5208016 100644
--- a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyUseSharedWorkerThreadPoolManyRoutesTest.java
+++ b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyUseSharedWorkerThreadPoolManyRoutesTest.java
@@ -20,8 +20,6 @@ import io.netty.channel.EventLoopGroup;
import org.apache.camel.BindToRegistry;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.AvailablePortFinder;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,20 +43,16 @@ public class NettyUseSharedWorkerThreadPoolManyRoutesTest extends BaseNettyTest
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() {
before = Thread.activeCount();
ports = new AvailablePortFinder.Port[60];
for (int i = 0; i < ports.length; i++) {
ports[i] = AvailablePortFinder.find();
}
- super.setUp();
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
for (AvailablePortFinder.Port port : ports) {
port.release();
}
diff --git a/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ReconnectAfterFailureIT.java b/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ReconnectAfterFailureIT.java
index 285397148bf..709e0d132b1 100644
--- a/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ReconnectAfterFailureIT.java
+++ b/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ReconnectAfterFailureIT.java
@@ -34,7 +34,6 @@ import org.apache.camel.test.infra.mosquitto.services.MosquittoRemoteService;
import org.apache.camel.test.infra.mosquitto.services.MosquittoService;
import org.apache.camel.test.infra.mosquitto.services.MosquittoServiceFactory;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -90,9 +89,7 @@ public class PahoMqtt5ReconnectAfterFailureIT extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
- super.tearDown();
+ public void doPostTearDown() {
service.shutdown();
}
diff --git a/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5SendDynamicAwareTest.java b/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5SendDynamicAwareTest.java
index 07b4791baa8..f39dbbcd178 100644
--- a/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5SendDynamicAwareTest.java
+++ b/components/camel-paho-mqtt5/src/test/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5SendDynamicAwareTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.spi.SendDynamicAware;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -28,9 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class PahoMqtt5SendDynamicAwareTest extends CamelTestSupport {
PahoMqtt5SendDynamicAware pahoMqtt5SendDynamicAware;
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() {
this.pahoMqtt5SendDynamicAware = new PahoMqtt5SendDynamicAware();
}
diff --git a/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfAppendTest.java b/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfAppendTest.java
index 612631ae9aa..f421bb31bf1 100644
--- a/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfAppendTest.java
+++ b/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfAppendTest.java
@@ -41,7 +41,6 @@ import org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy;
import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.pdmodel.font.Standard14Fonts;
import org.apache.pdfbox.text.PDFTextStripper;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -54,12 +53,6 @@ public class PdfAppendTest extends CamelTestSupport {
@EndpointInject("mock:result")
protected MockEndpoint resultEndpoint;
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
- }
-
@Test
public void testAppend() throws Exception {
final String originalText = "Test";
diff --git a/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfCreationTest.java b/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfCreationTest.java
index efcd87c3674..95fa04b89f0 100644
--- a/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfCreationTest.java
+++ b/components/camel-pdf/src/test/java/org/apache/camel/component/pdf/PdfCreationTest.java
@@ -33,7 +33,6 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.encryption.AccessPermission;
import org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy;
import org.apache.pdfbox.text.PDFTextStripper;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -48,12 +47,6 @@ public class PdfCreationTest extends CamelTestSupport {
@EndpointInject("mock:result")
protected MockEndpoint resultEndpoint;
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
- }
-
@Test
public void testPdfCreation() throws Exception {
final String expectedText = "expectedText";
diff --git a/components/camel-pg-replication-slot/src/test/java/org/apache/camel/component/pg/replication/slot/integration/PgReplicationSlotCamelIT.java b/components/camel-pg-replication-slot/src/test/java/org/apache/camel/component/pg/replication/slot/integration/PgReplicationSlotCamelIT.java
index f9fdfbac317..21bfea73aa5 100644
--- a/components/camel-pg-replication-slot/src/test/java/org/apache/camel/component/pg/replication/slot/integration/PgReplicationSlotCamelIT.java
+++ b/components/camel-pg-replication-slot/src/test/java/org/apache/camel/component/pg/replication/slot/integration/PgReplicationSlotCamelIT.java
@@ -25,7 +25,6 @@ import java.util.Properties;
import org.apache.camel.EndpointInject;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,9 +36,7 @@ public class PgReplicationSlotCamelIT extends PgReplicationITSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
String url = String.format("jdbc:postgresql://%s/camel", service.getServiceAddress());
Properties props = new Properties();
props.setProperty("user", service.userName());
@@ -52,10 +49,8 @@ public class PgReplicationSlotCamelIT extends PgReplicationITSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() throws SQLException {
this.connection.close();
- super.tearDown();
}
@Override
diff --git a/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java b/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java
index 46f89324528..78f8e2cd58f 100644
--- a/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java
+++ b/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java
@@ -42,7 +42,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.util.IOHelper;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -69,8 +68,8 @@ public class PrinterPrintTest extends CamelTestSupport {
setupJavaPrint();
}
- @AfterEach
- public void tearDown() throws Exception {
+ @Override
+ public void doPostTearDown() throws Exception {
restoreJavaPrint();
}
diff --git a/components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/PulsarComponentTest.java b/components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/PulsarComponentTest.java
index 6b4ed016f7b..5fbc7bc3dcf 100644
--- a/components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/PulsarComponentTest.java
+++ b/components/camel-pulsar/src/test/java/org/apache/camel/component/pulsar/PulsarComponentTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.pulsar;
import org.apache.camel.component.pulsar.utils.AutoConfiguration;
import org.apache.camel.component.pulsar.utils.consumers.SubscriptionType;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentMatchers;
@@ -37,10 +36,8 @@ public class PulsarComponentTest extends CamelTestSupport {
private AutoConfiguration autoConfiguration;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
autoConfiguration = mock(AutoConfiguration.class);
- super.setUp();
}
@Test
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/FromFileQuartzSchedulerTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/FromFileQuartzSchedulerTest.java
index fd82888e50c..d72d1d05ad0 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/FromFileQuartzSchedulerTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/FromFileQuartzSchedulerTest.java
@@ -21,17 +21,14 @@ import java.io.File;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.util.FileUtil;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class FromFileQuartzSchedulerTest extends BaseQuartzTest {
protected MockEndpoint resultEndpoint;
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
FileUtil.removeDir(new File("target/inbox"));
- super.setUp();
}
@Test
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
index ee21056a0a8..ae2f233f7f4 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.quartz;
import java.io.InputStream;
import java.util.Properties;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -35,10 +34,8 @@ public class QuartzPropertiesTest extends BaseQuartzTest {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
quartz.stop();
- super.tearDown();
}
@Test
diff --git a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
index bdae0cbcd06..2f544276ff5 100644
--- a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
+++ b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
@@ -24,8 +24,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.quickfixj.converter.QuickfixjConverters;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import quickfix.Acceptor;
import quickfix.DataDictionary;
@@ -54,10 +52,7 @@ public class QuickfixjConvertersTest extends CamelTestSupport {
private QuickfixjEngine quickfixjEngine;
@Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
+ public void doPostSetup() throws Exception {
settingsFile = File.createTempFile("quickfixj_test_", ".cfg");
tempdir = settingsFile.getParentFile();
URL[] urls = new URL[] { tempdir.toURI().toURL() };
@@ -72,11 +67,8 @@ public class QuickfixjConvertersTest extends CamelTestSupport {
}
@Override
- @AfterEach
- public void tearDown() throws Exception {
+ public void doPostTearDown() {
Thread.currentThread().setContextClassLoader(contextClassLoader);
-
- super.tearDown();
}
@Test
diff --git a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java
index d67071da235..6b5bcd0b978 100644
--- a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java
+++ b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRequestReplyRouteIT.java
@@ -31,7 +31,6 @@ import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.common.message.MessageExt;
import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -69,8 +68,7 @@ public class RocketMQRequestReplyRouteIT extends RocketMQTestSupport {
@Override
@BeforeEach
- public void setUp() throws Exception {
- super.setUp();
+ public void doPostSetup() throws Exception {
replierProducer = new DefaultMQProducer("replierProducer");
replierProducer.setNamesrvAddr(rocketMQService.nameserverAddress());
replierProducer.start();
@@ -127,8 +125,8 @@ public class RocketMQRequestReplyRouteIT extends RocketMQTestSupport {
resultEndpoint.assertIsSatisfied();
}
- @AfterEach
- public void tearDown() {
+ @Override
+ public void doPostTearDown() {
replierConsumer.shutdown();
replierProducer.shutdown();
}
diff --git a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java
index 2a4605d2bb0..ce29e0877ef 100644
--- a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java
+++ b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteIT.java
@@ -27,7 +27,6 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
@@ -50,13 +49,6 @@ public class RocketMQRouteIT extends RocketMQTestSupport {
rocketMQService.createTopic("START_TOPIC");
}
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
diff --git a/components/camel-rss/src/test/java/org/apache/camel/dataformat/rss/RssDataFormatTest.java b/components/camel-rss/src/test/java/org/apache/camel/dataformat/rss/RssDataFormatTest.java
index 86ae71f0449..11dc10d224d 100644
--- a/components/camel-rss/src/test/java/org/apache/camel/dataformat/rss/RssDataFormatTest.java
+++ b/components/camel-rss/src/test/java/org/apache/camel/dataformat/rss/RssDataFormatTest.java
@@ -21,7 +21,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.rss.RssUtils;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class RssDataFormatTest extends CamelTestSupport {
@@ -46,11 +45,9 @@ public class RssDataFormatTest extends CamelTestSupport {
}
@Override
- @BeforeEach
- public void setUp() throws Exception {
+ public void doPreSetup() throws Exception {
feed = RssUtils.createFeed("file:src/test/data/rss20.xml");
feedXml = RssConverter.feedToXml(feed);
- super.setUp();
}
@Override
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XPathSplitChoicePerformanceTest.java b/components/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XPathSplitChoicePerformanceTest.java
index 0a092daa62d..6da7cb15f93 100644
--- a/components/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XPathSplitChoicePerformanceTest.java
+++ b/components/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XPathSplitChoicePerformanceTest.java
@@ -30,7 +30,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.camel.test.junit5.TestSupport;
import org.apache.camel.util.StopWatch;
import org.apache.camel.util.TimeUtils;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -57,10 +56,8 @@ public class XPathSplitChoicePerformanceTest extends CamelTestSupport {
private final StopWatch watch = new StopWatch();
@Override
- @BeforeEach
- public void setUp() throws Exception {
... 4583 lines suppressed ...
(camel) 06/13: CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-mongodb)
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 00751d016fe46fe6ca93ac1a340cc3a3feca74b6
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Jun 12 08:59:07 2024 +0200
CAMEL-20838: do not use overrides when JUnit's annotations suffice (camel-mongodb)
---
.../mongodb/gridfs/integration/AbstractMongoDbITSupport.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java b/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java
index 38f9efad13a..1855ba1029a 100644
--- a/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java
+++ b/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/integration/AbstractMongoDbITSupport.java
@@ -24,6 +24,7 @@ import org.apache.camel.CamelContext;
import org.apache.camel.test.infra.mongodb.services.MongoDBService;
import org.apache.camel.test.infra.mongodb.services.MongoDBServiceFactory;
import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.extension.RegisterExtension;
public abstract class AbstractMongoDbITSupport extends CamelTestSupport {
@@ -39,8 +40,8 @@ public abstract class AbstractMongoDbITSupport extends CamelTestSupport {
return this.getClass().getSimpleName();
}
- @Override
- public void doPostTearDown() {
+ @AfterEach
+ public void tearDownMongo() {
gridFSBucket.find().forEach(gridFSFile -> gridFSBucket.delete(gridFSFile.getId()));
mongo.close();
}