From c155d5d41851d3c16c5a3a88bd44df6a4b361e11 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 27 Mar 2024 16:54:25 -0400 Subject: [PATCH] Add `EmptyLineSeparator` Checkstyle rule * Support "blank lines around" via `spring-framework.xml` IDEA config * Fix all the Checkstyle violations --- .../AbstractSubscribableAmqpChannel.java | 10 +- .../PointToPointSubscribableAmqpChannel.java | 4 +- .../amqp/channel/PollableAmqpChannel.java | 4 +- .../channel/PublishSubscribeAmqpChannel.java | 3 +- .../AbstractAmqpInboundAdapterParser.java | 5 +- .../amqp/config/AmqpChannelFactoryBean.java | 3 +- .../amqp/config/AmqpInboundGatewayParser.java | 3 +- .../integration/amqp/dsl/Amqp.java | 3 +- .../dsl/AmqpBaseOutboundEndpointSpec.java | 3 +- .../AmqpInboundChannelAdapterSMLCSpec.java | 3 +- .../inbound/AmqpInboundChannelAdapter.java | 3 +- .../amqp/inbound/AmqpInboundGateway.java | 3 +- .../amqp/support/AmqpHeaderMapper.java | 3 +- .../DispatcherHasNoSubscribersTests.java | 3 +- .../amqp/config/AmqpChannelParserTests.java | 3 +- .../config/AmqpInboundGatewayParserTests.java | 3 +- ...AmqpOutboundChannelAdapterParserTests.java | 3 +- .../AmqpOutboundGatewayParserTests.java | 3 +- .../OutboundGatewayIntegrationTests.java | 3 +- .../integration/amqp/dsl/AmqpTests.java | 3 +- .../amqp/inbound/InboundEndpointTests.java | 4 +- .../support/DefaultAmqpHeaderMapperTests.java | 2 - .../integration/camel/dsl/Camel.java | 3 +- .../camel/support/CamelHeaderMapper.java | 3 +- .../xml/CassandraOutboundGatewayParser.java | 3 +- .../cassandra/IntegrationTestConfig.java | 3 +- .../cassandra/test/domain/Book.java | 3 +- .../IntegrationMessageHeaderAccessor.java | 3 +- .../integration/IntegrationPatternType.java | 3 +- .../AbstractCorrelatingMessageHandler.java | 3 +- .../aggregator/CorrelatingMessageBarrier.java | 5 +- ...pressionEvaluatingCorrelationStrategy.java | 3 +- ...essionEvaluatingMessageGroupProcessor.java | 3 +- .../HeaderAttributeCorrelationStrategy.java | 3 +- .../MethodInvokingReleaseStrategy.java | 4 +- .../aggregator/ReleaseStrategy.java | 3 +- .../ResequencingMessageHandler.java | 4 +- .../annotation/CorrelationStrategy.java | 3 +- .../annotation/IntegrationComponentScan.java | 4 +- ...thodAnnotationPublisherMetadataSource.java | 4 +- ...hodNameMappingPublisherMetadataSource.java | 4 +- .../aop/PublisherAnnotationAdvisor.java | 6 +- .../aop/PublisherMetadataSource.java | 3 +- .../aop/SimplePublisherMetadataSource.java | 3 +- .../integration/aot/CoreRuntimeHints.java | 3 +- ...atewayProxyInitializationAotProcessor.java | 3 +- .../integration/channel/ChannelPurger.java | 4 +- .../integration/channel/DirectChannel.java | 1 - .../integration/channel/ExecutorChannel.java | 1 - .../MessagePublishingErrorHandler.java | 3 +- .../channel/PublishSubscribeChannel.java | 3 +- .../GlobalChannelInterceptorWrapper.java | 4 +- .../MessageSelectingInterceptor.java | 4 +- ...eadStatePropagationChannelInterceptor.java | 3 +- .../channel/interceptor/WireTap.java | 1 - .../integration/codec/Codec.java | 3 +- .../codec/kryo/KryoClassListRegistrar.java | 3 +- .../integration/codec/kryo/KryoRegistrar.java | 3 +- ...AbstractMethodAnnotationPostProcessor.java | 3 +- .../config/AggregatorFactoryBean.java | 3 +- .../config/ConsumerEndpointFactoryBean.java | 3 +- ...ltConfiguringBeanFactoryPostProcessor.java | 1 - .../config/EnableIntegrationManagement.java | 3 +- .../config/ExpressionFactoryBean.java | 5 +- .../integration/config/FilterFactoryBean.java | 3 +- ...criberChannelBeanFactoryPostProcessor.java | 3 +- .../IntegrationConfigurationReport.java | 3 +- .../IntegrationManagementConfigurer.java | 3 +- .../config/IntegrationRegistrar.java | 3 +- .../config/ServiceActivatorFactoryBean.java | 3 +- ...ourcePollingChannelAdapterFactoryBean.java | 3 +- .../config/xml/AggregatorParser.java | 3 +- .../config/xml/AnnotationConfigParser.java | 3 +- .../integration/config/xml/ChainParser.java | 3 +- .../config/xml/ChannelInterceptorParser.java | 4 +- .../integration/config/xml/GatewayParser.java | 4 +- .../xml/IntegrationManagementParser.java | 3 +- .../config/xml/RecipientListRouterParser.java | 3 +- .../config/xml/SpelFunctionParser.java | 3 +- .../context/IntegrationContextUtils.java | 3 +- .../context/IntegrationProperties.java | 4 +- .../core/AsyncMessagingTemplate.java | 3 +- .../AggregateMessageDeliveryException.java | 3 +- .../dispatcher/BroadcastingDispatcher.java | 2 - .../dispatcher/UnicastingDispatcher.java | 1 - .../integration/dsl/AggregatorSpec.java | 3 +- .../dsl/BaseIntegrationFlowDefinition.java | 5 +- .../integration/dsl/Channels.java | 3 +- .../integration/dsl/EnricherSpec.java | 3 +- .../integration/dsl/HeaderEnricherSpec.java | 3 +- .../integration/dsl/MessageHandlerSpec.java | 3 +- .../integration/dsl/QueueChannelSpec.java | 3 +- .../dsl/RecipientListRouterSpec.java | 3 +- .../integration/dsl/Transformers.java | 4 +- .../IntegrationFlowBeanPostProcessor.java | 1 - .../FixedSubscriberChannelPrototype.java | 3 +- .../dsl/support/MessageChannelReference.java | 3 +- .../endpoint/EventDrivenConsumer.java | 3 +- .../ExpressionEvaluatingMessageSource.java | 3 +- .../endpoint/MethodInvokingMessageSource.java | 3 +- .../integration/endpoint/PollingConsumer.java | 3 +- .../endpoint/ReactiveStreamsConsumer.java | 2 - .../endpoint/SourcePollingChannelAdapter.java | 4 +- .../integration/events/IntegrationEvent.java | 3 +- .../expression/DynamicExpression.java | 4 +- .../expression/ExpressionEvalMap.java | 9 +- ...oadableResourceBundleExpressionSource.java | 8 +- .../AbstractMessageProcessingSelector.java | 4 +- .../integration/filter/MessageFilter.java | 4 +- .../AnnotationGatewayProxyFactoryBean.java | 3 +- .../GatewayMethodInboundMessageMapper.java | 4 +- .../gateway/GatewayProxyFactoryBean.java | 3 +- .../gateway/MessagingGatewaySupport.java | 3 +- .../integration/graph/IntegrationNode.java | 3 +- .../AbstractReplyProducingMessageHandler.java | 3 +- .../integration/handler/BridgeHandler.java | 3 +- .../handler/DelayHandlerManagement.java | 3 +- .../ExpressionCommandMessageProcessor.java | 5 +- .../ExpressionEvaluatingMessageHandler.java | 3 +- .../ExpressionEvaluatingMessageProcessor.java | 3 +- .../handler/PostProcessingMessageHandler.java | 3 +- .../handler/ServiceActivatingHandler.java | 4 +- .../advice/CacheRequestHandlerAdvice.java | 3 +- .../advice/ErrorMessageSendingRecoverer.java | 3 +- .../advice/HandleMessageAdviceAdapter.java | 3 +- .../RateLimiterRequestHandlerAdvice.java | 3 +- .../support/MessagingMethodInvokerHelper.java | 3 +- .../integration/history/MessageHistory.java | 3 - .../history/MessageHistoryConfigurer.java | 4 +- .../integration/leader/Candidate.java | 3 +- .../metadata/ConcurrentMetadataStore.java | 3 +- .../metadata/ListenableMetadataStore.java | 3 +- .../MetadataStoreListenerAdapter.java | 3 +- .../metadata/SimpleMetadataStore.java | 3 +- .../ResourceRetrievingMessageSource.java | 5 +- .../router/AbstractMappingMessageRouter.java | 3 +- .../AbstractMessageProcessingRouter.java | 4 +- .../router/RecipientListRouter.java | 3 +- ...ionEvaluatingRoutingSlipRouteStrategy.java | 4 +- .../scattergather/ScatterGatherHandler.java | 3 +- .../scheduling/PollSkipAdvice.java | 5 +- .../scheduling/PollerMetadata.java | 4 +- .../selector/PayloadTypeSelector.java | 4 +- .../AbstractMessageProcessingSplitter.java | 3 +- .../splitter/AbstractMessageSplitter.java | 2 - .../splitter/DefaultMessageSplitter.java | 3 +- .../AbstractBatchingMessageGroupStore.java | 3 +- .../store/AbstractKeyValueMessageStore.java | 3 +- .../store/BasicMessageGroupStore.java | 3 +- .../store/PersistentMessageGroup.java | 3 +- .../integration/store/SimpleMessageStore.java | 3 +- .../integration/support/IdGenerators.java | 3 +- .../support/MutableMessageBuilder.java | 3 +- .../support/MutableMessageHeaders.java | 3 +- .../support/PropertiesBuilder.java | 3 +- .../AllowListDeserializingConverter.java | 3 +- .../converter/MapMessageConverter.java | 3 +- .../ObjectStringMessageConverter.java | 3 +- .../converter/SimpleMessageConverter.java | 8 +- .../GenericMessageJacksonDeserializer.java | 3 +- .../json/Jackson2JsonMessageParser.java | 1 - .../support/locks/DefaultLockRegistry.java | 3 +- ...ultMessageSenderObservationConvention.java | 4 +- ...oughTransactionSynchronizationFactory.java | 3 +- .../transaction/PseudoTransactionManager.java | 3 +- ...TransactionSynchronizationFactoryBean.java | 4 +- .../transformer/ClaimCheckInTransformer.java | 3 +- .../transformer/ClaimCheckOutTransformer.java | 3 +- .../transformer/ContentEnricher.java | 3 +- .../transformer/HeaderEnricher.java | 3 +- .../integration/transformer/HeaderFilter.java | 4 +- .../ObjectToStringTransformer.java | 3 +- .../PayloadDeserializingTransformer.java | 3 +- .../util/AnnotatedMethodFilter.java | 4 +- .../util/BeanFactoryTypeConverter.java | 4 +- .../integration/util/ClassUtils.java | 3 +- .../util/DynamicPeriodicTrigger.java | 3 +- .../util/ErrorHandlingTaskExecutor.java | 3 +- .../integration/util/FixedMethodFilter.java | 4 +- .../integration/util/StackTraceUtils.java | 3 +- .../integration/util/UniqueMethodFilter.java | 3 +- .../integration/util/UpperBound.java | 5 +- ...atingMessageGroupProcessorHeaderTests.java | 5 +- .../aggregator/AggregatorTests.java | 5 +- .../BarrierMessageHandlerTests.java | 3 +- .../aggregator/ConcurrentAggregatorTests.java | 8 +- .../CorrelatingMessageBarrierTests.java | 5 +- ...elatingMessageHandlerIntegrationTests.java | 4 +- .../CorrelatingMessageHandlerTests.java | 4 +- ...ionEvaluatingCorrelationStrategyTests.java | 6 +- ...nEvaluatingMessageGroupProcessorTests.java | 5 +- .../FluxAggregatorMessageHandlerTests.java | 1 - ...hodInvokingMessageGroupProcessorTests.java | 6 +- .../MethodInvokingReleaseStrategyTests.java | 62 +++++++---- ...aultMessageAggregatorIntegrationTests.java | 1 - ...vokingAggregatorReturningMessageTests.java | 4 +- .../scenarios/AggregationResendTests.java | 3 +- .../AggregatorReplyChannelTests.java | 4 +- ...regatorWithCustomReleaseStrategyTests.java | 3 +- .../AnnotationConfigRegistrationTests.java | 2 - ...MessagePublishingAnnotationUsageTests.java | 3 - .../MessagePublishingInterceptorTests.java | 3 - ...essagePublishingInterceptorUsageTests.java | 2 - .../aop/PublisherExpressionTests.java | 3 - .../ApplicationContextMessageBusTests.java | 1 - .../bus/DirectChannelSubscriptionTests.java | 7 +- .../channel/DatatypeChannelTests.java | 7 +- .../channel/DirectChannelTests.java | 4 +- .../DispatchingChannelErrorHandlingTests.java | 4 +- .../channel/ExecutorChannelTests.java | 3 +- .../IntegrationReactiveUtilsTests.java | 3 +- ...dDispatcherConfigurationScenarioTests.java | 3 +- .../integration/channel/P2pChannelTests.java | 3 +- .../channel/PartitionedChannelTests.java | 1 - .../channel/PriorityChannelTests.java | 5 +- .../channel/TestChannelResolver.java | 3 +- .../interceptor/ChannelInterceptorTests.java | 7 +- .../GlobalChannelInterceptorTests.java | 4 +- .../interceptor/GlobalWireTapTests.java | 5 +- .../MessageSelectingInterceptorTests.java | 5 +- ...atePropagationChannelInterceptorTests.java | 6 +- .../ReactiveStreamsConsumerTests.java | 4 +- .../registry/HeaderChannelRegistryTests.java | 3 +- .../codec/kryo/CompositeCodecTests.java | 3 +- .../codec/kryo/FileKryoRegistrarTests.java | 3 +- ...AggregatorWithMessageStoreParserTests.java | 4 +- .../integration/config/ChainParserTests.java | 3 +- .../integration/config/FilterParserTests.java | 4 +- .../config/MaxValueReleaseStrategy.java | 3 +- ...esequencerWithMessageStoreParserTests.java | 3 +- .../RouterFactoryBeanDelegationTests.java | 3 +- .../config/SelectorChainParserTests.java | 3 +- ...ActivatorAnnotationPostProcessorTests.java | 4 +- ...PollingChannelAdapterFactoryBeanTests.java | 1 - .../config/StubMessageSelector.java | 3 +- .../integration/config/StubTaskScheduler.java | 3 +- .../integration/config/TestAfterAdvice.java | 4 +- .../config/TestAggregatorBean.java | 3 +- .../integration/config/TestAroundAdvice.java | 4 +- .../integration/config/TestBean.java | 4 +- .../integration/config/TestBeforeAdvice.java | 4 +- .../config/TestChannelInterceptor.java | 3 +- .../integration/config/TestConsumer.java | 3 +- .../integration/config/TestErrorHandler.java | 3 +- .../integration/config/TestHandler.java | 4 +- .../config/TestReleaseStrategy.java | 3 +- .../BridgeFromIntegrationTests.java | 5 +- .../FilterAnnotationPostProcessorTests.java | 6 +- ...ationPostProcessorAopIntegrationTests.java | 6 +- ...MessagingAnnotationPostProcessorTests.java | 8 +- ...ingAnnotationsWithBeanAnnotationTests.java | 1 - .../RouterAnnotationPostProcessorTests.java | 4 +- .../SplitterAnnotationPostProcessorTests.java | 4 +- .../annotation/SubscriberOrderTests.java | 6 +- .../config/xml/BridgeParserTests.java | 3 +- .../config/xml/ChainElementsFailureTests.java | 6 +- .../config/xml/ChannelAutoCreationTests.java | 3 +- .../config/xml/ClaimCheckParserTests.java | 3 +- .../config/xml/ConstructorAutowireTests.java | 7 +- .../config/xml/ContextHierarchyTests.java | 4 +- .../config/xml/ControlBusChainTests.java | 3 +- .../xml/ControlBusExplicitPollerTests.java | 3 +- .../ControlBusRecipientListRouterTests.java | 3 +- .../config/xml/ConverterParserTests.java | 6 +- ...serWithExistingConversionServiceTests.java | 5 +- ...figuringBeanFactoryPostProcessorTests.java | 2 - ...aultOutboundChannelAdapterParserTests.java | 3 +- .../config/xml/DelayerUsageTests.java | 3 +- ...xSubscribersDefaultConfigurationTests.java | 3 +- ...axSubscribersDontOverrideDefaultTests.java | 3 +- .../config/xml/EnricherParserTests3.java | 5 +- .../config/xml/EnricherParserTests4.java | 6 +- .../config/xml/EnricherParserTests5.java | 8 +- ...icherParserTestsWithoutRequestChannel.java | 3 +- ...rserWithRequestPayloadExpressionTests.java | 5 +- .../config/xml/GatewayParserTests.java | 1 - .../HeaderEnricherMethodInvokingTests.java | 4 +- .../xml/HeaderEnricherOverwriteTests.java | 4 +- .../config/xml/HeaderEnricherParserTests.java | 3 +- .../config/xml/HeaderEnricherTests.java | 3 +- .../InboundChannelAdapterExpressionTests.java | 3 +- ...dChannelAdapterWithDefaultPollerTests.java | 3 +- .../config/xml/InnerBeanConfigTests.java | 6 +- .../xml/LoggingChannelAdapterParserTests.java | 3 +- .../MapToObjectTransformerParserTests.java | 12 +- .../MethodInvokingSelectorParserTests.java | 3 +- .../config/xml/NestedChainParserTests.java | 4 +- .../ObjectToMapTransformerParserTests.java | 3 +- .../ObjectToStringTransformerParserTests.java | 3 +- .../config/xml/OrderedHandlersTests.java | 5 +- .../config/xml/PNamespaceTests.java | 6 +- ...adDeserializingTransformerParserTests.java | 6 +- ...loadSerializingTransformerParserTests.java | 6 +- .../xml/PublishingInterceptorParserTests.java | 5 +- .../xml/ServiceActivatorParserTests.java | 5 +- .../config/xml/TestAdviceBean.java | 4 +- .../configuration/EnableIntegrationTests.java | 6 +- .../core/AsyncMessagingTemplateTests.java | 4 +- .../integration/core/MessageHistoryTests.java | 1 - .../core/MessageIdGenerationTests.java | 3 +- .../core/TimeBasedUUIDGenerator.java | 4 +- ...ggregateMessageDeliveryExceptionTests.java | 3 +- .../BroadcastingDispatcherTests.java | 3 - .../dispatcher/FailOverDispatcherTests.java | 1 - .../RoundRobinDispatcherConcurrentTests.java | 3 +- .../dispatcher/RoundRobinDispatcherTests.java | 3 +- ...actionalPollerWithMixedAopConfigTests.java | 6 +- .../dsl/LambdaMessageProcessorTests.java | 5 +- .../correlation/CorrelationHandlerTests.java | 3 - .../dsl/flows/IntegrationFlowTests.java | 7 -- .../dsl/flowservices/FlowServiceTests.java | 4 +- .../dsl/gateway/GatewayDslTests.java | 3 +- .../dsl/manualflow/ManualFlowTests.java | 9 +- .../reactivestreams/ReactiveStreamsTests.java | 1 - .../integration/dsl/routers/RouterTests.java | 9 +- .../dsl/transformers/TransformerTests.java | 5 +- .../endpoint/CorrelationIdTests.java | 3 +- ...aluatingMessageSourceIntegrationTests.java | 1 - ...xpressionEvaluatingMessageSourceTests.java | 3 +- .../endpoint/PollerAdviceTests.java | 8 +- .../PollingConsumerEndpointTests.java | 7 +- .../endpoint/PollingLifecycleTests.java | 3 +- .../ProducerAndConsumerAutoStartupTests.java | 5 +- ...PseudoTransactionalMessageSourceTests.java | 3 +- .../ServiceActivatorEndpointTests.java | 5 +- ...ServiceActivatorMethodResolutionTests.java | 8 +- .../expression/DynamicExpressionTests.java | 5 +- .../expression/ExpressionUtilsTests.java | 3 +- ...namicExpressionFilterIntegrationTests.java | 3 +- ...FilterAnnotationMethodResolutionTests.java | 4 +- .../filter/MethodInvokingSelectorTests.java | 3 +- .../filter/SpelFilterIntegrationTests.java | 4 +- .../gateway/AsyncGatewayTests.java | 3 +- .../gateway/GatewayInterfaceTests.java | 4 +- .../GatewayInvokingMessageHandlerTests.java | 7 +- ...hodInboundMessageMapperToMessageTests.java | 3 +- .../gateway/GatewayProxyFactoryBeanTests.java | 10 +- .../GatewayProxyMessageMappingTests.java | 4 +- .../gateway/GatewayRequiresReplyTests.java | 4 +- .../gateway/GatewayWithHeaderAnnotations.java | 5 +- .../GatewayWithPayloadExpressionTests.java | 6 +- .../gateway/HeaderEnrichedGatewayTests.java | 4 +- .../gateway/InnerGatewayWithChainTests.java | 4 +- .../MultiMethodGatewayConfigTests.java | 4 +- .../gateway/NestedGatewayTests.java | 10 +- .../gateway/TestChannelInterceptor.java | 3 +- ...CustomConverterMessageProcessingTests.java | 7 +- .../handler/DelayHandlerTests.java | 5 +- ...essionEvaluatingMessageProcessorTests.java | 17 +-- .../HeaderAnnotationTransformerTests.java | 3 +- .../handler/MessageHandlerChainTests.java | 3 +- ...vokingMessageProcessorAnnotationTests.java | 5 +- .../MethodInvokingMessageProcessorTests.java | 6 +- .../integration/handler/MockHandlerTests.java | 4 +- .../SendTimeoutConfigurationTests.java | 4 +- .../ServiceActivatorOnMockitoMockTests.java | 4 +- .../advice/AdvisedMessageHandlerTests.java | 1 - ...AbstractJsonInboundMessageMapperTests.java | 3 +- ...actJsonSymmetricalMessageMappingTests.java | 3 +- .../json/JsonOutboundMessageMapperTests.java | 2 - .../integration/json/JsonPathTests.java | 3 +- .../json/JsonToObjectTransformerTests.java | 1 + .../ObjectToJsonTransformerParserTests.java | 3 +- .../integration/json/TestAddress.java | 3 +- .../integration/json/TestBean.java | 3 +- .../integration/json/TestChildBean.java | 4 +- .../integration/json/TestPerson.java | 4 +- .../mapping/HeaderMapperTests.java | 8 +- ...pressionEvaluatingMessageHandlerTests.java | 3 +- .../message/MessageHeadersTests.java | 3 +- .../MethodInvokingMessageHandlerTests.java | 5 +- .../MethodInvokingMessageSourceTests.java | 4 +- .../message/PayloadAndHeaderMappingTests.java | 6 +- ...ourceInboundChannelAdapterParserTests.java | 4 +- .../router/MethodInvokingRouterTests.java | 6 +- .../router/RecipientListRouterTests.java | 4 +- .../router/RouterConcurrencyTests.java | 3 +- .../integration/router/RouterTests.java | 3 +- ...namicExpressionRouterIntegrationTests.java | 4 +- ...HeaderValueRouterConvertibleTypeTests.java | 3 +- .../config/HeaderValueRouterParserTests.java | 4 +- .../integration/router/config/Numbers.java | 3 +- .../config/PayloadTypeRouterParserTests.java | 4 +- .../router/config/RouterParserTests.java | 6 +- .../router/config/RouterWithMappingTests.java | 4 +- .../config/SpelRouterIntegrationTests.java | 4 +- .../config/SplitterAggregatorTests.java | 3 +- .../routingslip/RoutingSlipTests.java | 3 +- .../selector/MessageSelectorChainTests.java | 5 +- .../splitter/DefaultSplitterTests.java | 3 +- ...micExpressionSplitterIntegrationTests.java | 4 +- .../splitter/MethodInvokingSplitterTests.java | 18 +-- .../SpelSplitterIntegrationTests.java | 3 +- .../splitter/StreamingSplitterTests.java | 3 +- .../store/MessageStoreReaperTests.java | 3 +- .../integration/store/MessageStoreTests.java | 3 +- .../store/SimpleMessageStoreTests.java | 5 +- .../support/MutableMessageTests.java | 3 +- .../support/SingleScenarioTests.java | 4 +- .../SmartLifecycleRoleControllerTests.java | 3 +- .../converter/MapMessageConverterTests.java | 3 +- .../ObjectStringMessageConverterTests.java | 4 +- .../LockRegistryLeaderInitiatorTests.java | 3 +- .../IntegrationObservabilityZipkinTests.java | 4 +- .../MutableMessageBuilderFactoryTests.java | 3 +- .../TransactionInterceptorBuilderTests.java | 3 +- .../transformer/AvroTestClass1.java | 4 +- .../transformer/AvroTestClass2.java | 4 +- .../transformer/ContentEnricherTests.java | 5 +- ...ressionHeaderEnricherIntegrationTests.java | 3 +- ...ExpressionTransformerIntegrationTests.java | 4 +- .../MapToObjectTransformerTests.java | 3 +- .../MessageHistoryParameterTests.java | 3 +- .../MethodInvokingTransformerTests.java | 3 +- .../ObjectToStringTransformerTests.java | 3 +- .../PayloadSerializingTransformerTests.java | 4 +- .../transformer/PayloadTransformerTests.java | 4 +- .../SpelTransformerIntegrationTests.java | 5 +- .../TestDefaultAnnotationConfiguration.java | 1 + .../util/TestTransactionManager.java | 3 +- .../debezium/dsl/DebeziumDslTests.java | 14 ++- .../it/DebeziumTestConfiguration.java | 10 +- ...licationEventListeningMessageProducer.java | 3 +- .../event/dsl/IntegrationFlowEventsTests.java | 4 +- ...ionEventListeningMessageProducerTests.java | 3 +- ...ionEventPublishingMessageHandlerTests.java | 4 +- .../feed/dsl/FeedEntryMessageSourceSpec.java | 3 +- .../feed/inbound/FeedEntryMessageSource.java | 3 +- .../FeedInboundChannelAdapterParserTests.java | 5 +- .../file/FileReadingMessageSource.java | 4 +- .../file/FileWritingMessageHandler.java | 4 +- .../file/HeadDirectoryScanner.java | 4 +- .../file/config/FileSplitterParser.java | 3 +- .../dsl/FileInboundChannelAdapterSpec.java | 3 +- .../integration/file/dsl/TailAdapterSpec.java | 3 +- .../AbstractLastModifiedFileListFilter.java | 4 +- .../AbstractRegexPatternFileListFilter.java | 4 +- .../AbstractSimplePatternFileListFilter.java | 4 +- .../file/filters/AcceptAllFileListFilter.java | 3 +- .../filters/AcceptOnceFileListFilter.java | 4 +- ...temPersistentAcceptOnceFileListFilter.java | 3 +- .../filters/RegexPatternFileListFilter.java | 3 +- .../filters/SimplePatternFileListFilter.java | 4 +- .../file/locking/FileChannelCache.java | 3 +- ...tractRemoteFileStreamingMessageSource.java | 3 +- .../remote/ClientCallbackWithoutResult.java | 3 +- .../file/remote/RemoteFileTemplate.java | 4 +- .../remote/aop/StandardRotationPolicy.java | 1 - .../AbstractRemoteFileOutboundGateway.java | 6 +- .../FileTransferringMessageHandler.java | 3 +- .../remote/session/CachingSessionFactory.java | 4 +- .../remote/session/SharedSessionCapable.java | 3 +- .../AbstractInboundFileSynchronizer.java | 5 +- ...InboundFileSynchronizingMessageSource.java | 3 +- ...SDelegatingFileTailingMessageProducer.java | 3 +- .../transformer/FileToStringTransformer.java | 3 +- .../FileOutboundGatewayIntegrationTests.java | 3 +- ...eReadingMessageSourceIntegrationTests.java | 3 +- ...ourcePersistentFilterIntegrationTests.java | 3 +- .../file/FileWritingMessageHandlerTests.java | 1 - .../WatchServiceDirectoryScannerTests.java | 3 +- .../AutoCreateDirectoryIntegrationTests.java | 5 +- .../file/config/ChainElementsTests.java | 3 +- .../config/DefaultConfigurationTests.java | 2 - ...dChannelAdapterWithPatternParserTests.java | 4 +- ...AdapterWithPreventDuplicatesFlagTests.java | 4 +- .../FileListFilterFactoryBeanTests.java | 4 +- .../file/config/FileMessageHistoryTests.java | 3 +- ...daptersWithClasspathInPropertiesTests.java | 3 +- ...FileOutboundChannelAdapterParserTests.java | 3 +- .../InboundAdapterWithLockersTests.java | 4 +- .../integration/file/dsl/FileTests.java | 3 +- .../filters/CompositeFileListFilterTests.java | 3 +- ...rsistentAcceptOnceFileListFilterTests.java | 9 +- .../RemoteFileOutboundGatewayTests.java | 6 +- .../AbstractFilePayloadTransformerTests.java | 3 +- .../integration/ftp/dsl/Ftp.java | 3 +- ...FtpPersistentAcceptOnceFileListFilter.java | 3 +- .../FtpRegexPatternFileListFilter.java | 3 +- .../FtpSimplePatternFileListFilter.java | 3 +- ...InboundFileSynchronizingMessageSource.java | 3 +- .../session/AbstractFtpSessionFactory.java | 3 +- .../session/DefaultFtpsSessionFactory.java | 3 +- .../integration/ftp/session/FtpFileInfo.java | 3 +- .../integration/ftp/session/FtpSession.java | 3 +- .../integration/ftp/FtpTestSupport.java | 4 +- .../FtpInboundOutboundSanitySample.java | 3 +- .../config/FtpOutboundGatewayParserTests.java | 3 +- ...amingInboundChannelAdapterParserTests.java | 3 +- ...oundRemoteFileSystemSynchronizerTests.java | 5 +- .../ftp/outbound/FtpOutboundTests.java | 3 +- .../ftp/session/SessionFactoryTests.java | 5 +- .../groovy/GroovyCommandMessageProcessor.java | 3 +- ...GroovyScriptExecutingMessageProcessor.java | 3 +- ...indingGroovyObjectCustomizerDecorator.java | 3 +- ...vyIntegrationConfigurationInitializer.java | 3 +- .../groovy/config/GroovyScriptParser.java | 3 +- ...yScriptExecutingMessageProcessorTests.java | 57 +++++----- ...ovyScriptPayloadMessageProcessorTests.java | 12 +- .../integration/groovy/RepeatProcessor.java | 105 ------------------ .../groovy/ScriptsFactoryTests.java | 3 +- .../groovy/config/GroovyControlBusTests.java | 4 +- .../config/GroovyHeaderEnricherTests.java | 3 +- .../config/GroovyServiceActivatorTests.java | 5 +- .../groovy/config/GroovyTransformerTests.java | 3 +- ...ributedSQLInboundChannelAdapterParser.java | 3 +- .../hazelcast/leader/LeaderInitiator.java | 7 +- .../HazelcastCacheWritingMessageHandler.java | 3 +- .../IdempotentReceiverIntegrationTests.java | 4 +- .../leader/LeaderInitiatorTests.java | 4 +- .../HazelcastOutboundChannelAdapterTests.java | 3 +- .../config/HttpInboundEndpointParser.java | 4 +- ...ultipartAwareFormHttpMessageConverter.java | 3 +- .../SerializingHttpMessageConverter.java | 4 +- .../http/dsl/BaseHttpMessageHandlerSpec.java | 3 +- .../HttpRequestHandlingEndpointSupport.java | 4 +- .../HttpRequestHandlingMessagingGateway.java | 4 +- .../FileCopyingMultipartFileReader.java | 5 +- .../multipart/MultipartHttpInputMessage.java | 4 +- .../multipart/SimpleMultipartFileReader.java | 3 +- .../http/multipart/UploadedMultipartFile.java | 4 +- .../IntegrationWebExchangeBindException.java | 3 +- .../integration/http/StubMultipartFile.java | 3 +- .../http/config/ChainElementsTests.java | 3 +- .../config/DefaultConfigurationTests.java | 1 - .../HttpInboundChannelAdapterParserTests.java | 4 +- .../config/HttpInboundGatewayParserTests.java | 3 +- .../HttpOutboundGatewayParserTests.java | 3 +- .../integration/http/dsl/HttpDslTests.java | 1 - ...pRequestHandlingMessagingGatewayTests.java | 5 +- ...gMessagingGatewayWithPathMappingTests.java | 3 +- ...Int2312RequestMappingIntegrationTests.java | 3 +- .../http/outbound/CookieTests.java | 3 +- ...tpRequestExecutingMessageHandlerTests.java | 3 +- ...tpHeaderMapperFromMessageInboundTests.java | 4 +- ...ternetProtocolReceivingChannelAdapter.java | 3 +- ...InternetProtocolSendingMessageHandler.java | 8 +- .../TcpConnectionFactoryFactoryBean.java | 3 +- .../AbstractClientConnectionFactory.java | 3 +- .../AbstractServerConnectionFactory.java | 5 +- .../CachingClientConnectionFactory.java | 68 ++++++------ .../ip/tcp/connection/ConnectionFactory.java | 3 +- .../DefaultTcpNetConnectionSupport.java | 3 +- .../DefaultTcpNioConnectionSupport.java | 3 +- .../connection/TcpConnectionCloseEvent.java | 3 +- .../TcpConnectionExceptionEvent.java | 3 +- .../TcpConnectionFailedCorrelationEvent.java | 3 +- .../connection/TcpConnectionFailedEvent.java | 3 +- .../TcpConnectionInterceptorFactory.java | 4 +- .../TcpConnectionInterceptorSupport.java | 3 +- .../connection/TcpConnectionOpenEvent.java | 3 +- .../connection/TcpNetConnectionSupport.java | 3 +- .../TcpNioClientConnectionFactory.java | 3 +- .../connection/TcpNioConnectionSupport.java | 3 +- .../ByteArrayLengthHeaderSerializer.java | 3 +- .../udp/MulticastSendingMessageHandler.java | 4 +- .../integration/ip/util/TestingUtilities.java | 3 +- .../TcpConnectionFactoryFactoryBeanTest.java | 3 +- .../ip/dsl/IpIntegrationTests.java | 17 +-- .../integration/ip/tcp/AutoStartTests.java | 3 +- .../ip/tcp/ConnectionToConnectionTests.java | 3 +- .../ip/tcp/FactoryStopStartTests.java | 4 +- .../ip/tcp/TcpConfigOutboundGatewayTests.java | 3 +- .../ip/tcp/TcpInboundGatewayTests.java | 1 - .../ip/tcp/TcpOutboundGatewayTests.java | 4 +- .../tcp/TcpReceivingChannelAdapterTests.java | 1 + .../ip/tcp/TcpSendingMessageHandlerTests.java | 1 - .../ip/tcp/TcpSendingNoSocketTests.java | 3 +- .../connection/ConnectionTimeoutTests.java | 4 +- .../HelloWorldInterceptorFactory.java | 3 +- .../connection/TcpNioConnectionReadTests.java | 3 +- .../tcp/connection/TcpNioConnectionTests.java | 3 +- .../ip/tcp/connection/TcpSenderTests.java | 7 +- .../tcp/serializer/DeserializationTests.java | 68 ++++-------- .../LengthHeaderSerializationTests.java | 3 +- .../serializer/MapJsonSerializerTests.java | 3 +- .../integration/ip/udp/MultiClientTests.java | 3 +- .../integration/ip/udp/SyslogdTests.java | 3 +- .../ip/udp/UdpMulticastEndToEndTests.java | 4 +- .../ip/udp/UdpUnicastEndToEndTests.java | 4 +- .../integration/jdbc/StoredProcExecutor.java | 4 +- .../jdbc/StoredProcMessageHandler.java | 3 +- .../jdbc/config/StoredProcParserUtils.java | 3 +- .../jdbc/store/JdbcChannelMessageStore.java | 1 - ...utboundChannelAdapterWithinChainTests.java | 3 +- ...dGatewayWithNamespaceIntegrationTests.java | 3 +- ...ewayWithSpringContextIntegrationTests.java | 3 +- ...AdapterWithNamespace2IntegrationTests.java | 5 +- ...resChannelMessageTableSubscriberTests.java | 4 +- .../jdbc/config/InnerPollerParserTests.java | 3 +- .../config/JdbcMessageStoreParserTests.java | 3 +- .../JdbcOutboundGatewayParserTests.java | 3 - .../jdbc/config/JdbcTypesEnumTests.java | 3 +- .../StoredProcMessageHandlerParserTests.java | 3 +- .../StoredProcOutboundGatewayParserTests.java | 4 +- ...dProcPollingChannelAdapterParserTests.java | 4 +- .../jdbc/lock/JdbcLockRegistryTests.java | 4 +- .../jdbc/metadata/JdbcMetadataStoreTests.java | 3 +- ...lJdbcMessageStoreMultipleChannelTests.java | 5 +- .../store/JdbcMessageStoreChannelTests.java | 3 +- .../jdbc/store/JdbcMessageStoreTests.java | 1 - .../DerbyTxTimeoutMessageStoreTests.java | 3 +- .../OracleTxTimeoutMessageStoreTests.java | 3 +- .../PostgresTxTimeoutMessageStoreTests.java | 3 +- .../jdbc/storedproc/ClobSqlReturnType.java | 3 +- .../jdbc/storedproc/CreateUser.java | 4 +- .../jdbc/storedproc/PrimeMapper.java | 4 +- .../integration/jdbc/storedproc/User.java | 3 +- .../jdbc/storedproc/UserMapper.java | 4 +- .../integration/jms/AbstractJmsChannel.java | 4 +- .../ChannelPublishingJmsMessageListener.java | 1 + .../jms/DefaultJmsHeaderMapper.java | 3 +- .../jms/DynamicJmsTemplateProperties.java | 3 +- .../jms/JmsDestinationPollingSource.java | 3 +- .../integration/jms/JmsOutboundGateway.java | 6 +- .../jms/JmsSendingMessageHandler.java | 4 +- .../jms/SubscribableJmsChannel.java | 5 +- .../jms/config/JmsChannelFactoryBean.java | 4 +- .../jms/config/JmsChannelParser.java | 3 +- .../JmsMessageDrivenEndpointParser.java | 7 +- .../jms/dsl/JmsInboundGatewaySpec.java | 3 +- .../jms/dsl/JmsOutboundGatewaySpec.java | 3 +- .../integration/jms/util/JmsAdapterUtils.java | 3 +- ...nnelPublishingJmsMessageListenerTests.java | 3 +- .../jms/DefaultJmsHeaderMapperTests.java | 4 +- .../integration/jms/StubConnection.java | 3 +- .../integration/jms/StubConsumer.java | 4 +- .../integration/jms/StubProducer.java | 4 +- .../integration/jms/StubSession.java | 3 +- .../integration/jms/StubTextMessage.java | 3 +- .../jms/config/DefaultConfigurationTests.java | 3 +- .../ExceptionHandlingSiConsumerTests.java | 6 +- .../config/GlobalChannelInterceptorTests.java | 3 +- .../jms/config/InboundOneWayErrorTests.java | 4 +- .../jms/config/JmsChannelParserTests.java | 5 +- .../config/JmsDynamicDestinationTests.java | 3 +- .../config/JmsMessageDrivenEndpointTests.java | 3 +- .../jms/config/JmsMessageHistoryTests.java | 6 +- .../JmsOutboundChannelAdapterParserTests.java | 3 +- .../config/JmsOutboundGatewayParserTests.java | 3 +- .../jms/config/JmsPriorityTests.java | 3 +- ...sWithMarshallingMessageConverterTests.java | 5 +- .../jms/request_reply/MiscellaneousTests.java | 3 +- ...eplyScenariosWithCachedConsumersTests.java | 3 +- ...nariosWithCorrelationKeyProvidedTests.java | 4 +- .../jmx/AttributePollingMessageSource.java | 3 +- .../jmx/DefaultNotificationMapper.java | 4 +- .../integration/jmx/MBeanObjectConverter.java | 3 +- .../NotificationListeningMessageProducer.java | 3 +- .../NotificationPublishingMessageHandler.java | 4 +- .../jmx/OperationInvokingMessageHandler.java | 3 +- .../jmx/config/MBeanExporterParser.java | 3 +- .../MBeanTreePollingChannelAdapterParser.java | 3 +- .../AttributePollingMessageSourceTests.java | 4 +- ...ficationListeningMessageProducerTests.java | 4 +- ...ficationPublishingMessageHandlerTests.java | 3 +- .../OperationInvokingMessageHandlerTests.java | 3 +- .../jmx/config/DynamicRouterTests.java | 3 +- .../jmx/config/MBeanExporterNameTests.java | 4 +- .../MBeanRegistrationCustomNamingTests.java | 4 +- .../jmx/config/MBeanRegistrationTests.java | 4 +- ...nTreePollingChannelAdapterParserTests.java | 3 +- ...tionInvokingChannelAdapterParserTests.java | 3 +- ...OperationInvokingOutboundGatewayTests.java | 5 +- .../jmx/config/PollingAdapterMBeanTests.java | 4 +- .../jmx/config/PriorityChannelTests.java | 4 +- .../jmx/config/RouterMBeanTests.java | 4 +- .../jmx/config/RouterMBeanVanillaTests.java | 4 +- .../jmx/config/SimpleDynamicRouter.java | 4 +- ...hainWithMessageProducingHandlersTests.java | 7 +- .../monitor/RemoteMBeanServerTests.java | 4 +- .../ScatterGatherHandlerIntegrationTests.java | 4 +- .../mbeanexporterhelper/INT_2626Tests.java | 3 +- .../jpa/config/xml/JpaNamespaceHandler.java | 3 +- .../jpa/core/AbstractJpaOperations.java | 6 +- .../jpa/core/DefaultJpaOperations.java | 3 +- .../integration/jpa/core/JpaOperations.java | 4 +- .../integration/jpa/support/JpaUtils.java | 4 +- .../BeanPropertyParameterSource.java | 4 +- ...ssionEvaluatingParameterSourceFactory.java | 3 +- ...ressionEvaluatingParameterSourceUtils.java | 3 +- .../PositionSupportingParameterSource.java | 3 +- .../JpaInboundChannelAdapterParserTests.java | 3 +- .../xml/JpaMessageHandlerParserTests.java | 5 +- .../xml/JpaOutboundGatewayParserTests.java | 3 +- .../jpa/core/HibernateJpaOperationsTests.java | 1 - .../integration/jpa/dsl/JpaTests.java | 2 - .../JpaOutboundGatewayIntegrationTests.java | 3 +- .../jpa/outbound/JpaOutboundGatewayTests.java | 4 +- .../integration/jpa/test/JpaTestUtils.java | 3 +- .../jpa/test/entity/StudentDomain.java | 5 +- .../channel/SubscribableKafkaChannel.java | 4 +- .../config/xml/KafkaInboundGatewayParser.java | 3 +- .../integration/kafka/dsl/KafkaDslTests.java | 4 +- .../inbound/MessageDrivenAdapterTests.java | 3 +- .../kafka/inbound/MessageSourceTests.java | 5 +- .../KafkaProducerMessageHandlerTests.java | 12 +- .../integration/mail/ImapMailReceiver.java | 3 +- .../mail/MailReceivingMessageSource.java | 3 +- .../mail/MailSendingMessageHandler.java | 3 +- .../integration/mail/MailTransportUtils.java | 3 +- .../integration/mail/Pop3MailReceiver.java | 3 +- .../config/ImapIdleChannelAdapterParser.java | 3 +- .../integration/mail/dsl/Mail.java | 3 +- .../mail/ImapMailReceiverTests.java | 8 +- .../mail/MailReceivingMessageSourceTests.java | 3 +- ...MailSendingMessageHandlerContextTests.java | 3 +- .../mail/MailSendingMessageHandlerTests.java | 4 +- .../integration/mail/MailTestsHelper.java | 3 +- .../integration/mail/StubJavaMailSender.java | 4 +- .../config/DefaultConfigurationTests.java | 1 - .../InboundChannelAdapterParserTests.java | 11 +- .../MailToStringTransformerParserTests.java | 3 +- .../config/PollingMailSourceParserTests.java | 3 +- .../config/MongoDbNamespaceHandler.java | 3 +- .../MongoDbOutboundChannelAdapterParser.java | 3 +- .../mongodb/config/MongoParserUtils.java | 3 +- .../ConfigurableMongoDbMessageStore.java | 4 +- .../mongodb/store/MessageDocument.java | 3 +- .../mongodb/store/MongoDbMessageStore.java | 6 - .../MongoDbStoringMessageHandlerTests.java | 3 +- ...AbstractMongoDbMessageGroupStoreTests.java | 3 +- .../AbstractMongoDbMessageStoreTests.java | 4 +- ...igurableMongoDbMessageGroupStoreTests.java | 1 - .../ConfigurableMongoDbMessageStoreTests.java | 3 +- ...MqttMessageDrivenChannelAdapterParser.java | 3 +- .../mqtt/event/MqttMessageDeliveredEvent.java | 3 +- .../mqtt/event/MqttMessageDeliveryEvent.java | 3 +- .../MqttPahoMessageDrivenChannelAdapter.java | 4 +- ...Mqttv5PahoMessageDrivenChannelAdapter.java | 5 +- .../outbound/Mqttv5PahoMessageHandler.java | 3 +- .../support/DefaultPahoMessageConverter.java | 4 +- .../mqtt/ClientManagerBackToBackTests.java | 3 +- .../integration/mqtt/Mqttv5AdapterTests.java | 3 +- ...ttv5BackToBackAutomaticReconnectTests.java | 5 +- .../mqtt/Mqttv5BackToBackTests.java | 1 - .../r2dbc/inbound/R2dbcMessageSource.java | 3 +- .../r2dbc/outbound/R2dbcMessageHandler.java | 7 +- .../config/R2dbcDatabaseConfiguration.java | 3 +- .../inbound/R2dbcMessageSourceTests.java | 5 +- .../outbound/R2dbcMessageHandlerTests.java | 4 +- .../redis/config/RedisNamespaceHandler.java | 3 +- .../inbound/RedisInboundChannelAdapter.java | 4 +- .../inbound/RedisQueueInboundGateway.java | 3 +- .../RedisQueueMessageDrivenEndpoint.java | 3 +- .../RedisStoreWritingMessageHandler.java | 4 +- .../RedisChannelPriorityMessageStore.java | 4 +- .../redis/store/RedisMessageStore.java | 3 +- .../redis/util/RedisLockRegistry.java | 2 - .../integration/redis/RedisContainerTest.java | 3 +- .../SubscribableRedisChannelTests.java | 3 +- ...RedisInboundChannelAdapterParserTests.java | 3 +- ...edisOutboundChannelAdapterParserTests.java | 3 +- ...QueueInboundChannelAdapterParserTests.java | 7 +- .../RedisQueueInboundGatewayParserTests.java | 5 +- .../RedisInboundChannelAdapterTests.java | 3 +- .../RedisQueueMessageDrivenEndpointTests.java | 3 +- ...InboundChannelAdapterIntegrationTests.java | 6 +- ...RedisLockRegistryLeaderInitiatorTests.java | 3 +- .../metadata/RedisMetadataStoreTests.java | 3 +- ...eactiveRedisStreamMessageHandlerTests.java | 5 +- .../RedisPublishingMessageHandlerTests.java | 4 +- ...RedisQueueOutboundChannelAdapterTests.java | 3 +- .../RedisStoreWritingMessageHandlerTests.java | 5 +- .../store/RedisMessageGroupStoreTests.java | 3 +- .../redis/store/RedisMessageStoreTests.java | 3 +- .../integration/redis/util/Person.java | 4 +- .../redis/util/RedisLockRegistryTests.java | 3 - .../rsocket/ServerRSocketMessageHandler.java | 3 +- .../outbound/RSocketOutboundGateway.java | 3 +- .../rsocket/dsl/RSocketDslTests.java | 3 +- ...RSocketInboundGatewayIntegrationTests.java | 3 +- ...SocketOutboundGatewayIntegrationTests.java | 5 +- ...stractScriptExecutingMessageProcessor.java | 3 +- .../DefaultScriptVariableGenerator.java | 4 +- .../RefreshableResourceScriptSource.java | 3 +- .../ScriptExecutingMessageSource.java | 3 +- .../scripting/ScriptingException.java | 4 +- .../DslScriptExecutingMessageProcessor.java | 3 +- .../integration/scripting/dsl/ScriptSpec.java | 3 +- .../jsr223/PythonScriptExecutor.java | 5 +- .../ScriptExecutingMessageProcessor.java | 4 +- .../config/jsr223/Jsr223FilterTests.java | 3 +- .../config/jsr223/Jsr223RefreshTests.java | 5 +- .../config/jsr223/Jsr223RouterTests.java | 3 +- .../config/jsr223/Jsr223SplitterTests.java | 3 +- .../config/jsr223/Jsr223TransformerTests.java | 3 +- .../scripting/dsl/ScriptsTests.java | 3 +- .../jsr223/PythonVariableParserTests.java | 4 +- .../SftpOutboundChannelAdapterParser.java | 3 +- .../sftp/dsl/SftpOutboundGatewaySpec.java | 3 +- .../SftpRegexPatternFileListFilter.java | 3 +- .../SftpSimplePatternFileListFilter.java | 3 +- .../sftp/session/SftpFileInfo.java | 3 +- ...boundChannelAdapterParserCachingTests.java | 3 +- .../SftpOutboundGatewayParserTests.java | 3 +- ...amingInboundChannelAdapterParserTests.java | 3 +- .../integration/sftp/dsl/SftpTests.java | 4 +- .../SftpStreamingMessageSourceTests.java | 4 +- .../sftp/session/SftpTestSessionFactory.java | 3 +- .../integration/smb/dsl/Smb.java | 3 +- ...SmbPersistentAcceptOnceFileListFilter.java | 3 +- .../SmbSimplePatternFileListFilter.java | 3 +- .../smb/session/SmbRemoteFileTemplate.java | 3 +- .../integration/smb/session/SmbShare.java | 3 +- .../SmbInboundChannelAdapterParserTests.java | 3 +- .../stomp/AbstractStompSessionManager.java | 3 +- .../inbound/StompInboundChannelAdapter.java | 73 ++++++------ .../stomp/support/StompHeaderMapper.java | 3 +- .../client/StompServerIntegrationTests.java | 1 - ...annelAdapterWebSocketIntegrationTests.java | 10 +- ...ssageHandlerWebSocketIntegrationTests.java | 3 +- .../ByteStreamReadingMessageSource.java | 4 +- .../ByteStreamWritingMessageHandler.java | 3 +- .../CharacterStreamReadingMessageSource.java | 3 +- .../CharacterStreamWritingMessageHandler.java | 5 +- .../ByteStreamWritingMessageHandlerTests.java | 4 +- ...acterStreamWritingMessageHandlerTests.java | 6 +- ...nsoleInboundChannelAdapterParserTests.java | 3 +- ...soleOutboundChannelAdapterParserTests.java | 4 +- .../config/DefaultConfigurationTests.java | 1 - .../integration/syslog/MessageConverter.java | 3 +- .../syslog/RFC5424SyslogParser.java | 3 +- .../SyslogInboundChannelAdapterParser.java | 3 +- .../TcpSyslogReceivingChannelAdapter.java | 3 +- .../test/rule/Log4j2LevelAdjuster.java | 3 +- .../test/support/RequestResponseScenario.java | 3 +- .../test/util/OnlyOnceTrigger.java | 1 - .../integration/test/util/TestUtils.java | 1 - .../test/mock/MockMessageHandlerTests.java | 6 +- .../inbound/WebFluxInboundEndpoint.java | 3 +- ...tegrationRequestMappingHandlerMapping.java | 3 +- ...WebFluxRequestExecutingMessageHandler.java | 3 +- .../WebFluxOutboundGatewayParserTests.java | 4 +- .../webflux/dsl/WebFluxDslTests.java | 4 +- .../inbound/WebFluxInboundEndpointTests.java | 4 +- .../WebFluxObservationPropagationTests.java | 3 +- ...uxRequestExecutingMessageHandlerTests.java | 4 +- .../websocket/ServerWebSocketContainer.java | 3 +- .../WebSocketInboundChannelAdapter.java | 3 +- .../WebSocketOutboundMessageHandler.java | 3 +- .../ClientWebSocketContainerTests.java | 3 +- .../client/StompIntegrationTests.java | 4 +- .../websocket/dsl/WebSocketDslTests.java | 3 +- .../WebSocketInboundChannelAdapterTests.java | 3 +- .../WebSocketOutboundMessageHandlerTests.java | 3 +- .../ws/AbstractWebServiceOutboundGateway.java | 3 +- .../MarshallingWebServiceInboundGateway.java | 3 +- .../MarshallingWebServiceOutboundGateway.java | 3 +- .../ws/SimpleWebServiceInboundGateway.java | 3 +- .../ws/SimpleWebServiceOutboundGateway.java | 3 +- .../WebServiceInboundGatewayParser.java | 3 +- .../dsl/MarshallingWsInboundGatewaySpec.java | 3 +- .../ws/dsl/SimpleWsOutboundGatewaySpec.java | 4 +- .../ws/DefaultSoapHeaderMapperTests.java | 3 +- ...MarshallingWebServiceIntegrationTests.java | 3 +- .../SimpleWebServiceInboundGatewayTests.java | 3 +- .../SimpleWebServiceOutboundGatewayTests.java | 3 +- ...bServiceInboundGatewayJavaConfigTests.java | 3 +- .../ws/config/DefaultConfigurationTests.java | 1 - .../config/StubMarshallerAndUnmarshaller.java | 3 +- .../ws/config/StubUnmarshaller.java | 3 +- .../WebServiceInboundGatewayParserTests.java | 3 +- .../WebServiceOutboundGatewayParserTests.java | 3 +- ...gregatedXmlMessageValidationException.java | 3 +- .../xml/DefaultXmlPayloadConverter.java | 3 +- .../xml/config/XPathFilterParser.java | 3 +- .../xml/config/XPathRouterParser.java | 3 +- .../xml/result/DomResultFactory.java | 4 +- .../integration/xml/router/XPathRouter.java | 3 +- .../AbstractXPathMessageSelector.java | 4 +- .../BooleanTestXPathMessageSelector.java | 3 +- .../RegexTestXPathMessageSelector.java | 4 +- .../StringValueTestXPathMessageSelector.java | 4 +- .../XmlValidatingMessageSelector.java | 5 +- .../xml/source/DomSourceFactory.java | 4 +- .../xml/source/StringSourceFactory.java | 4 +- .../transformer/MarshallingTransformer.java | 5 +- .../ResultToDocumentTransformer.java | 4 +- .../ResultToStringTransformer.java | 4 +- .../SourceCreatingTransformer.java | 4 +- .../xml/transformer/XPathTransformer.java | 4 +- .../transformer/XsltPayloadTransformer.java | 3 +- .../xml/xpath/XPathEvaluationType.java | 3 +- .../integration/xml/xpath/XPathUtils.java | 3 +- .../xml/DefaultXmlPayloadConverterTests.java | 3 +- .../xml/config/ChainElementsTests.java | 3 +- .../xml/config/DefaultConfigurationTests.java | 2 - .../xml/config/TestXmlApplicationContext.java | 3 +- .../UnmarshallingTransformerParserTests.java | 3 +- .../XPathHeaderEnricherParserTests.java | 4 +- .../xml/config/XPathRouterParserTests.java | 5 +- .../config/XPathTransformerParserTests.java | 5 +- .../xml/source/StringSourceTests.java | 4 +- .../splitter/XPathMessageSplitterTests.java | 4 +- .../transformer/CustomTestResultFactory.java | 5 +- .../MarshallingTransformerTests.java | 3 +- .../ResultToStringTransformerTests.java | 3 +- .../UnmarshallingTransformerTests.java | 3 +- .../transformer/XPathTransformerTests.java | 6 +- .../XsltPayloadTransformerTests.java | 5 +- .../xml/transformer/XsltTransformerTests.java | 3 +- .../JaxbMarshallingIntegrationTests.java | 3 +- .../integration/xml/util/XmlTestUtil.java | 3 +- .../integration/xml/xpath/XPathTests.java | 5 +- ...tractXmppOutboundChannelAdapterParser.java | 3 +- ...atMessageOutboundChannelAdapterParser.java | 3 +- .../PresenceOutboundChannelAdapterParser.java | 3 +- .../config/XmppConnectionFactoryBean.java | 4 +- .../AbstractXmppConnectionAwareEndpoint.java | 3 +- ...ractXmppConnectionAwareMessageHandler.java | 3 +- .../inbound/ChatMessageListeningEndpoint.java | 3 +- .../inbound/PresenceListeningEndpoint.java | 6 +- .../xmpp/support/XmppHeaderMapper.java | 3 +- .../xmpp/ignore/ConsoleChatTests.java | 3 +- .../xmpp/ignore/InboundPresenceTests.java | 3 +- .../ChatMessageListeningEndpointTests.java | 3 +- ...ChatMessageSendingMessageHandlerTests.java | 4 +- .../integration/zeromq/dsl/ZeroMq.java | 3 +- .../zeromq/dsl/ZeroMqMessageHandlerSpec.java | 3 +- .../zeromq/outbound/ZeroMqMessageHandler.java | 3 +- .../zeromq/channel/ZeroMqChannelTests.java | 3 +- .../outbound/ZeroMqMessageHandlerTests.java | 3 +- .../zip/config/xml/ZipNamespaceHandler.java | 6 +- .../integration/zip/UnZip2FileTests.java | 4 +- .../transformer/UnZipTransformerTests.java | 4 +- .../config/CuratorFrameworkFactoryBean.java | 3 +- .../metadata/ZookeeperMetadataStore.java | 3 +- .../zookeeper/lock/ZkLockRegistryTests.java | 4 +- .../metadata/ZookeeperMetadataStoreTests.java | 4 +- src/checkstyle/checkstyle.xml | 6 +- src/idea/spring-framework.xml | 6 + 932 files changed, 1341 insertions(+), 2485 deletions(-) delete mode 100644 spring-integration-groovy/src/test/java/org/springframework/integration/groovy/RepeatProcessor.java diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java index ef9658a8b6..1b39e15018 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -181,12 +181,12 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel this.container.setQueueNames(queue); MessageConverter converter = (getAmqpTemplate() instanceof RabbitTemplate rabbitTemplate) - ? rabbitTemplate.getMessageConverter() - : new SimpleMessageConverter(); + ? rabbitTemplate.getMessageConverter() + : new SimpleMessageConverter(); MessageListener listener = new DispatchingMessageListener(converter, this.dispatcher, this, this.isPubSub, - getMessageBuilderFactory(), getInboundHeaderMapper()); + getMessageBuilderFactory(), getInboundHeaderMapper()); this.container.setMessageListener(listener); if (!this.container.isActive()) { this.container.afterPropertiesSet(); @@ -261,7 +261,6 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel protected abstract String obtainQueueName(String channelName); - private static final class DispatchingMessageListener implements MessageListener { private final Log logger = LogFactory.getLog(DispatchingMessageListener.class); @@ -292,7 +291,6 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel this.inboundHeaderMapper = inboundHeaderMapper; } - @Override public void onMessage(org.springframework.amqp.core.Message message) { Message messageToSend = null; diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java index 85f2689308..e71da20b02 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class PointToPointSubscribableAmqpChannel extends AbstractSubscribableAmq super(channelName, container, amqpTemplate); } - /** * Construct an instance with the supplied name, container and template; default header * mappers will be used if the message is mapped. @@ -73,7 +72,6 @@ public class PointToPointSubscribableAmqpChannel extends AbstractSubscribableAmq super(channelName, container, amqpTemplate, outboundMapper, inboundMapper); } - /** * Provide a Queue name to be used. If this is not provided, * the Queue's name will be the same as the channel name. diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java index c34afa1981..dc52a0724c 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,7 +93,6 @@ public class PollableAmqpChannel extends AbstractAmqpChannel this.channelName = channelName; } - /** * Provide an explicitly configured queue name. If this is not provided, then a Queue will be created * implicitly with the channelName as its name. The implicit creation will require that either an AmqpAdmin @@ -286,7 +285,6 @@ public class PollableAmqpChannel extends AbstractAmqpChannel return counterFacade; } - @Override public void setInterceptors(List interceptors) { super.setInterceptors(interceptors); diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java index 0fa40f4cc3..cd7f42c932 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,6 @@ public class PublishSubscribeAmqpChannel extends AbstractSubscribableAmqpChannel super(channelName, container, amqpTemplate, true, outboundMapper, inboundMapper); } - /** * Configure the FanoutExchange instance. If this is not provided, then a * FanoutExchange will be declared implicitly, and its name will be the same diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java index 113d6caf0a..32833e8012 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,16 +72,13 @@ abstract class AbstractAmqpInboundAdapterParser extends AbstractSingleBeanDefini "transaction-manager" }; - private final String adapterClassName; - AbstractAmqpInboundAdapterParser(String adapterClassName) { Assert.hasText(adapterClassName, "adapterClassName is required"); this.adapterClassName = adapterClassName; } - @Override protected final String getBeanClassName(Element element) { return this.adapterClassName; diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java index f150c4fd5a..af82aef69c 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -148,7 +148,6 @@ public class AmqpChannelFactoryBean extends AbstractFactoryBean, E ext return delayExpression(new FunctionExpression<>(delayFunction)); } - /** * Set the SpEL expression to calculate the {@code x-delay} header when using the * RabbitMQ delayed message exchange plugin. diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpInboundChannelAdapterSMLCSpec.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpInboundChannelAdapterSMLCSpec.java index 17ca1e10e4..4a40dff96e 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpInboundChannelAdapterSMLCSpec.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpInboundChannelAdapterSMLCSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,4 +55,5 @@ public class AmqpInboundChannelAdapterSMLCSpec this.target.setBatchMode(batchMode); return this; } + } diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java index 005afcf1cb..70a9d27551 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,7 +141,6 @@ public class AmqpInboundChannelAdapter extends MessageProducerSupport implements : null; } - public void setMessageConverter(MessageConverter messageConverter) { Assert.notNull(messageConverter, "messageConverter must not be null"); this.messageConverter = messageConverter; diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java index 9d72502764..df5edf28d8 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,7 +132,6 @@ public class AmqpInboundGateway extends MessagingGatewaySupport { : null; } - /** * Specify the {@link MessageConverter} to convert request and reply to/from {@link Message}. * If the {@link #amqpTemplate} is explicitly set, this {@link MessageConverter} diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/AmqpHeaderMapper.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/AmqpHeaderMapper.java index 4113ef0f48..130add0596 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/AmqpHeaderMapper.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/AmqpHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,4 +28,5 @@ import org.springframework.integration.mapping.RequestReplyHeaderMapper; * @since 2.1 */ public interface AmqpHeaderMapper extends RequestReplyHeaderMapper { + } diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/channel/DispatcherHasNoSubscribersTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/channel/DispatcherHasNoSubscribersTests.java index faa72a9460..c0eafc6d64 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/channel/DispatcherHasNoSubscribersTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/channel/DispatcherHasNoSubscribersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,6 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - /** * @author Gary Russell * @author Artem Bilan diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java index 82882451fa..a84fe2bed0 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,6 +116,7 @@ public class AmqpChannelParserTests { } private static class TestInterceptor implements ChannelInterceptor { + } } diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundGatewayParserTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundGatewayParserTests.java index d1c1c6a42c..737bf2b3b4 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundGatewayParserTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -152,6 +152,7 @@ public class AmqpInboundGatewayParserTests { } private static class TestConverter extends SimpleMessageConverter { + } } diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundChannelAdapterParserTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundChannelAdapterParserTests.java index df16f2bca3..315d8a21d5 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundChannelAdapterParserTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -339,7 +339,6 @@ public class AmqpOutboundChannelAdapterParserTests { handler.stop(); } - public static class FooAdvice extends AbstractRequestHandlerAdvice { @Override diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundGatewayParserTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundGatewayParserTests.java index 14117efdd0..1c9c42b4e0 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundGatewayParserTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -291,7 +291,6 @@ public class AmqpOutboundGatewayParserTests { Mockito.any(org.springframework.amqp.core.Message.class), isNull()); ReflectionUtils.setField(amqpTemplateField, endpoint, amqpTemplate); - MessageChannel requestChannel = this.context.getBean("toRabbit4", MessageChannel.class); Message message = MessageBuilder.withPayload("hello").setHeader("foo", "foo").build(); requestChannel.send(message); diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/OutboundGatewayIntegrationTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/OutboundGatewayIntegrationTests.java index 600fe314aa..fb6aa7d184 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/OutboundGatewayIntegrationTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/OutboundGatewayIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,6 @@ public class OutboundGatewayIntegrationTests { assertThat(receive.getPayload()).isEqualTo(payload.toUpperCase()); } - public static class EchoBean { String echo(String o) { diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/dsl/AmqpTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/dsl/AmqpTests.java index 719323c03d..56dafa6168 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/dsl/AmqpTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/dsl/AmqpTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -206,7 +206,6 @@ public class AmqpTests { @Autowired private AtomicReference raw; - @Test public void testInboundMessagingExceptionFlow() { this.amqpTemplate.convertAndSend("si.dsl.exception.test", "foo"); diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/inbound/InboundEndpointTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/inbound/InboundEndpointTests.java index 478b1f7f94..5cbb987910 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/inbound/InboundEndpointTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/inbound/InboundEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2023 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -220,7 +220,6 @@ public class InboundEndpointTests { gateway.setReplyHeadersMappedLast(true); gateway.afterPropertiesSet(); - Object payload = new Foo("bar1"); MessageProperties amqpMessageProperties = new MessageProperties(); @@ -785,6 +784,7 @@ public class InboundEndpointTests { } public record Foo(String bar) { + } } diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java index 78e178f5e9..d3abce3fb6 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java @@ -165,7 +165,6 @@ public class DefaultAmqpHeaderMapperTests { assertThat(amqpProperties.getContentType()).isEqualTo("text/html"); } - @Test public void toHeaders() { DefaultAmqpHeaderMapper headerMapper = DefaultAmqpHeaderMapper.inboundMapper(); @@ -230,7 +229,6 @@ public class DefaultAmqpHeaderMapperTests { assertThat(headerMap.get(AmqpHeaders.CORRELATION_ID)).isEqualTo(testCorrelationId); } - @Test public void testToHeadersConsumerMetadata() { DefaultAmqpHeaderMapper headerMapper = DefaultAmqpHeaderMapper.inboundMapper(); diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java index b48d13b623..2529265bcd 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/dsl/Camel.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,6 @@ public final class Camel { .exchangePattern(exchangePattern); } - private Camel() { } diff --git a/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/CamelHeaderMapper.java b/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/CamelHeaderMapper.java index 3bceb8da1f..079c76e9e3 100644 --- a/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/CamelHeaderMapper.java +++ b/spring-integration-camel/src/main/java/org/springframework/integration/camel/support/CamelHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ import org.springframework.util.PatternMatchUtils; */ public class CamelHeaderMapper implements HeaderMapper { - private static final LogAccessor LOGGER = new LogAccessor(CamelHeaderMapper.class); private String[] inboundHeaderNames = {"*"}; diff --git a/spring-integration-cassandra/src/main/java/org/springframework/integration/cassandra/config/xml/CassandraOutboundGatewayParser.java b/spring-integration-cassandra/src/main/java/org/springframework/integration/cassandra/config/xml/CassandraOutboundGatewayParser.java index 5be89011d2..3c60d10b34 100644 --- a/spring-integration-cassandra/src/main/java/org/springframework/integration/cassandra/config/xml/CassandraOutboundGatewayParser.java +++ b/spring-integration-cassandra/src/main/java/org/springframework/integration/cassandra/config/xml/CassandraOutboundGatewayParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import org.springframework.integration.config.xml.IntegrationNamespaceUtils; */ public class CassandraOutboundGatewayParser extends AbstractConsumerEndpointParser { - @Override protected String getInputChannelAttributeName() { return "request-channel"; diff --git a/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/IntegrationTestConfig.java b/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/IntegrationTestConfig.java index bceafdabe3..0456b8f774 100644 --- a/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/IntegrationTestConfig.java +++ b/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/IntegrationTestConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.cassandra; - import java.util.Collections; import java.util.List; import java.util.UUID; diff --git a/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/test/domain/Book.java b/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/test/domain/Book.java index e1194f6349..a7aae90ee8 100644 --- a/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/test/domain/Book.java +++ b/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/test/domain/Book.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import org.springframework.data.cassandra.core.mapping.Indexed; import org.springframework.data.cassandra.core.mapping.PrimaryKey; import org.springframework.data.cassandra.core.mapping.Table; - /** * Test POJO * diff --git a/spring-integration-core/src/main/java/org/springframework/integration/IntegrationMessageHeaderAccessor.java b/spring-integration-core/src/main/java/org/springframework/integration/IntegrationMessageHeaderAccessor.java index 597f839627..f7226d0f1d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/IntegrationMessageHeaderAccessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/IntegrationMessageHeaderAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2023 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,6 @@ public class IntegrationMessageHeaderAccessor extends MessageHeaderAccessor { */ public static final String REACTOR_CONTEXT = "reactorContext"; - private static final BiFunction TYPE_VERIFY_MESSAGE_FUNCTION = (name, trailer) -> "The '" + name + trailer; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/IntegrationPatternType.java b/spring-integration-core/src/main/java/org/springframework/integration/IntegrationPatternType.java index c60ee22dfa..e4f953d802 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/IntegrationPatternType.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/IntegrationPatternType.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,6 @@ public enum IntegrationPatternType { // NOSONAR Initialization circularity is us recipient_list_router(IntegrationPatternCategory.message_routing); - private final IntegrationPatternCategory patternCategory; IntegrationPatternType(IntegrationPatternCategory patternCategory) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java index f8c174bbf9..911101139b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -257,7 +257,6 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP this.discardChannelName = discardChannelName; } - public void setSendPartialResultOnExpiry(boolean sendPartialResultOnExpiry) { this.sendPartialResultOnExpiry = sendPartialResultOnExpiry; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java index 0ef7c08029..5c074928c3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,6 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements private ReleaseStrategy releaseStrategy; - public CorrelatingMessageBarrier() { this(new SimpleMessageStore(0)); } @@ -71,7 +70,6 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements this.store = store; } - /** * Set the CorrelationStrategy to be used to determine the correlation key for incoming messages. * @param correlationStrategy The correlation strategy. @@ -103,7 +101,6 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements return existingLock == null ? correlationKey : existingLock; } - @SuppressWarnings("unchecked") @Override public Message receive() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java index 62c4066f88..55c5487cb6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ public class ExpressionEvaluatingCorrelationStrategy implements CorrelationStrat private final ExpressionEvaluatingMessageProcessor processor; - public ExpressionEvaluatingCorrelationStrategy(String expressionString) { Assert.hasText(expressionString, "expressionString must not be empty"); Expression expression = EXPRESSION_PARSER.parseExpression(expressionString); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java index 709bea3929..e4f27b4653 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ public class ExpressionEvaluatingMessageGroupProcessor extends AbstractAggregati private final ExpressionEvaluatingMessageListProcessor processor; - public ExpressionEvaluatingMessageGroupProcessor(String expression) { this.processor = new ExpressionEvaluatingMessageListProcessor(expression); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/HeaderAttributeCorrelationStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/HeaderAttributeCorrelationStrategy.java index 2f7bf88aff..777c23bbac 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/HeaderAttributeCorrelationStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/HeaderAttributeCorrelationStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ public class HeaderAttributeCorrelationStrategy implements CorrelationStrategy { private final String attributeName; - public HeaderAttributeCorrelationStrategy(String attributeName) { Assert.hasText(attributeName, "the 'attributeName' must not be empty"); this.attributeName = attributeName; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategy.java index 76a6425c96..b52864bd31 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ public class MethodInvokingReleaseStrategy implements ReleaseStrategy, BeanFacto private final MethodInvokingMessageListProcessor adapter; - public MethodInvokingReleaseStrategy(Object object, Method method) { this.adapter = new MethodInvokingMessageListProcessor(object, method, Boolean.class); } @@ -44,7 +43,6 @@ public class MethodInvokingReleaseStrategy implements ReleaseStrategy, BeanFacto this.adapter = new MethodInvokingMessageListProcessor(object, methodName, Boolean.class); } - public void setConversionService(ConversionService conversionService) { this.adapter.setConversionService(conversionService); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ReleaseStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ReleaseStrategy.java index a0b5def616..ec3bdec47a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ReleaseStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ReleaseStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.springframework.integration.aggregator; import org.springframework.integration.store.MessageGroup; - /** * Strategy for determining when a group of messages reaches a state of * completion (i.e. can trip a barrier). diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java index 7b132b1160..6d98670286 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,13 +43,11 @@ public class ResequencingMessageHandler extends AbstractCorrelatingMessageHandle this.setExpireGroupsUponTimeout(false); } - public ResequencingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store) { super(processor, store); this.setExpireGroupsUponTimeout(false); } - public ResequencingMessageHandler(MessageGroupProcessor processor) { super(processor); this.setExpireGroupsUponTimeout(false); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/CorrelationStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/CorrelationStrategy.java index c904082da7..fbc845db0f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/CorrelationStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/CorrelationStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,4 +32,5 @@ import java.lang.annotation.Target; @Target(ElementType.METHOD) @Documented public @interface CorrelationStrategy { + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/IntegrationComponentScan.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/IntegrationComponentScan.java index a41316d980..4ca8bc3c07 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/IntegrationComponentScan.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/IntegrationComponentScan.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,7 +74,6 @@ public @interface IntegrationComponentScan { */ Class[] basePackageClasses() default {}; - /** * Indicates whether automatic detection of classes annotated with * {@code @MessagingGateway} should be enabled. @@ -106,7 +105,6 @@ public @interface IntegrationComponentScan { */ Filter[] excludeFilters() default {}; - /** * The {@link BeanNameGenerator} class to be used for naming detected Spring Integration components. *

The default value of the {@link BeanNameGenerator} interface itself indicates diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java index 297096ad73..fc7408b36e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,6 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat private volatile String channelAttributeName = "channel"; - public MethodAnnotationPublisherMetadataSource() { this(Collections.singleton(Publisher.class)); } @@ -74,7 +73,6 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat this.annotationTypes = annotationTypes; } - public void setChannelAttributeName(String channelAttributeName) { Assert.hasText(channelAttributeName, "channelAttributeName must not be empty"); this.channelAttributeName = channelAttributeName; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodNameMappingPublisherMetadataSource.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodNameMappingPublisherMetadataSource.java index a15dfbff7d..568820f01a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodNameMappingPublisherMetadataSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodNameMappingPublisherMetadataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class MethodNameMappingPublisherMetadataSource implements PublisherMetada private volatile Map channelMap = Collections.emptyMap(); - public MethodNameMappingPublisherMetadataSource(Map payloadExpressionMap) { Assert.notEmpty(payloadExpressionMap, "payloadExpressionMap must not be empty"); this.payloadExpressionMap = @@ -49,7 +48,6 @@ public class MethodNameMappingPublisherMetadataSource implements PublisherMetada e -> EXPRESSION_PARSER.parseExpression(e.getValue()))); } - public void setHeaderExpressionMap(Map> headerExpressionMap) { this.headerExpressionMap = headerExpressionMap diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationAdvisor.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationAdvisor.java index 408aba3f33..3e8732a741 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationAdvisor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,6 @@ public class PublisherAnnotationAdvisor extends AbstractPointcutAdvisor implemen this.pointcut = buildPointcut(publisherAnnotationTypes); } - /** * A channel bean name to be used as default for publishing. * @param defaultChannelName the default channel name. @@ -107,14 +106,12 @@ public class PublisherAnnotationAdvisor extends AbstractPointcutAdvisor implemen return result; } - private static final class MetaAnnotationMatchingPointcut implements Pointcut { private final ClassFilter classFilter; private final MethodMatcher methodMatcher; - /** * Create a new MetaAnnotationMatchingPointcut for the given annotation type. * @param classAnnotationType the annotation type to look for at the class level @@ -155,7 +152,6 @@ public class PublisherAnnotationAdvisor extends AbstractPointcutAdvisor implemen } } - @Override public ClassFilter getClassFilter() { return this.classFilter; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java index 422337e071..644e4096f8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,6 @@ interface PublisherMetadataSource { Expression RETURN_VALUE_EXPRESSION = EXPRESSION_PARSER.parseExpression("#" + PublisherMetadataSource.RETURN_VALUE_VARIABLE_NAME); - /** * Returns the channel name to which Messages should be published * for this particular method invocation. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/SimplePublisherMetadataSource.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/SimplePublisherMetadataSource.java index 0813371f85..e3b5c07683 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/SimplePublisherMetadataSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/SimplePublisherMetadataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ public class SimplePublisherMetadataSource implements PublisherMetadataSource { private volatile Map headerExpressions; - public void setChannelName(String channelName) { this.channelName = channelName; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aot/CoreRuntimeHints.java b/spring-integration-core/src/main/java/org/springframework/integration/aot/CoreRuntimeHints.java index 45c6937759..9c8af58daf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aot/CoreRuntimeHints.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aot/CoreRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,6 @@ class CoreRuntimeHints implements RuntimeHintsRegistrar { Pausable.class) .forEach(type -> reflectionHints.registerType(type, MemberCategory.INVOKE_PUBLIC_METHODS)); - if (ClassUtils.isPresent("com.jayway.jsonpath.JsonPath", classLoader)) { reflectionHints.registerType(JsonPathUtils.class, MemberCategory.INVOKE_PUBLIC_METHODS); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aot/GatewayProxyInitializationAotProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aot/GatewayProxyInitializationAotProcessor.java index 02c7b618f2..1b99fe52b3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aot/GatewayProxyInitializationAotProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aot/GatewayProxyInitializationAotProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import org.springframework.beans.factory.support.RegisteredBean; import org.springframework.integration.annotation.MessagingGateway; import org.springframework.integration.gateway.GatewayProxyFactoryBean; - /** * A {@link BeanFactoryInitializationAotProcessor} for registering proxy interfaces * of the {@link GatewayProxyFactoryBean} beans or {@link MessagingGateway} interfaces. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java index 0af391e692..01aa48ceb9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelPurger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class ChannelPurger { private final MessageSelector selector; - public ChannelPurger(QueueChannel... channels) { this(null, channels); } @@ -63,7 +62,6 @@ public class ChannelPurger { this.channels = Arrays.copyOf(channels, channels.length); } - public final List> purge() { List> purgedMessages = new ArrayList<>(); for (QueueChannel channel : this.channels) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java index 7707b1ff11..9a5f135fa6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java @@ -58,7 +58,6 @@ public class DirectChannel extends AbstractSubscribableChannel { this.dispatcher.setLoadBalancingStrategy(loadBalancingStrategy); } - /** * Specify whether the channel's dispatcher should have failover enabled. * By default, it will. Set this value to 'false' to disable it. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java index 0c674e36fd..7db4206d62 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java @@ -82,7 +82,6 @@ public class ExecutorChannel extends AbstractExecutorChannel { this.dispatcher = unicastingDispatcher; } - /** * Specify whether the channel's dispatcher should have failover enabled. * By default, it will. Set this value to 'false' to disable it. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java index 26134bee0d..e575f25b30 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class MessagePublishingErrorHandler extends ErrorMessagePublisher impleme setChannelResolver(channelResolver); } - public void setDefaultErrorChannel(@Nullable MessageChannel defaultErrorChannel) { setChannel(defaultErrorChannel); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java index 5a547dd828..7ea0ecd5a5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,6 @@ public class PublishSubscribeChannel extends AbstractExecutorChannel implements this.dispatcher = new BroadcastingDispatcher(executor, requireSubscribers); } - @Override public String getComponentType() { return "publish-subscribe-channel"; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorWrapper.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorWrapper.java index 42f3c28cd7..abf237f69e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorWrapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ public class GlobalChannelInterceptorWrapper implements Ordered { private volatile int order = 0; - public GlobalChannelInterceptorWrapper(ChannelInterceptor channelInterceptor) { Assert.notNull(channelInterceptor, "channelInterceptor must not be null"); this.channelInterceptor = channelInterceptor; @@ -47,7 +46,6 @@ public class GlobalChannelInterceptorWrapper implements Ordered { } } - public ChannelInterceptor getChannelInterceptor() { return this.channelInterceptor; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java index 12e9200685..ca21ea096d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,12 +37,10 @@ public class MessageSelectingInterceptor implements ChannelInterceptor { private final List selectors; - public MessageSelectingInterceptor(MessageSelector... selectors) { this.selectors = Arrays.asList(selectors); } - @Override public Message preSend(Message message, MessageChannel channel) { for (MessageSelector selector : this.selectors) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java index 19408c2124..4904d4f0d5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,6 @@ public abstract class ThreadStatePropagationChannelInterceptor implements Exe protected abstract void populatePropagatedContext(@Nullable S state, Message message, MessageChannel channel); - private static final class MessageWithThreadState implements Message, MessageDecorator { private final Message message; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java index 4b6005a913..1871f69403 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/WireTap.java @@ -64,7 +64,6 @@ public class WireTap implements ChannelInterceptor, ManageableLifecycle, VetoCap private volatile boolean running = true; - /** * Create a new wire tap with no {@link MessageSelector}. * @param channel the MessageChannel to which intercepted messages will be sent diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/Codec.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/Codec.java index 44a4a3bb36..b2f9fb5c4c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/Codec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/Codec.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2021 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import java.io.OutputStream; * @since 4.2 */ public interface Codec { + /** * Encode (encode) an object to an OutputStream. * @param object the object to encode diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoClassListRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoClassListRegistrar.java index 3974be77d0..a79261504b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoClassListRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoClassListRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,6 @@ public class KryoClassListRegistrar extends AbstractKryoRegistrar { this.initialValue = initialValue; } - @Override public List getRegistrations() { List registrations = new ArrayList<>(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoRegistrar.java index 09fd70572e..6e70e9eae1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/KryoRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,4 +50,5 @@ public interface KryoRegistrar { * @return the list of {@link Registration} provided */ List getRegistrations(); + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractMethodAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractMethodAnnotationPostProcessor.java index ee4cdda7a0..2e1211815e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractMethodAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractMethodAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -702,7 +702,6 @@ public abstract class AbstractMethodAnnotationPostProcessor { private ExpressionParser parser = DEFAULT_PARSER; - public ExpressionFactoryBean(String expressionString) { Assert.hasText(expressionString, "'expressionString' must not be empty or null"); this.expressionString = expressionString; } - public void setParserConfiguration(SpelParserConfiguration parserConfiguration) { Assert.notNull(parserConfiguration, "'parserConfiguration' must not be null"); this.parser = new SpelExpressionParser(parserConfiguration); } - @Override public Class getObjectType() { return Expression.class; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java index c517610e9b..19e17e38eb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,7 +106,6 @@ public class FilterFactoryBean extends AbstractStandardMessageHandlerFactoryBean } } - @Override protected void postProcessReplyProducer(AbstractMessageProducingHandler handler) { super.postProcessReplyProducer(handler); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/FixedSubscriberChannelBeanFactoryPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/FixedSubscriberChannelBeanFactoryPostProcessor.java index 3e61d020f1..30c6e63590 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/FixedSubscriberChannelBeanFactoryPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/FixedSubscriberChannelBeanFactoryPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public final class FixedSubscriberChannelBeanFactoryPostProcessor implements Bea this.candidateFixedChannelHandlerMap = candidateHandlers; } - @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { if (beanFactory instanceof BeanDefinitionRegistry) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigurationReport.java b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigurationReport.java index 95f7ed8d8b..efbb6a3475 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigurationReport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigurationReport.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.config; - import java.io.PrintWriter; import java.io.StringWriter; import java.util.Properties; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfigurer.java b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfigurer.java index f14b8290ce..af0264a24a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfigurer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationManagementConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHandler; import org.springframework.util.Assert; - /** * Configures beans that implement {@link IntegrationManagement}. * Configures logging, {@link MetricsCaptor} and {@link ObservationRegistry} for all (or selected) components. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationRegistrar.java index e915a2c431..dccd1fb462 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -114,7 +114,6 @@ public class IntegrationRegistrar implements ImportBeanDefinitionRegistrar { .getBeanDefinition()); } - String beanName = Introspector.decapitalize(MessagingAnnotationBeanPostProcessor.class.getName()); if (!registry.containsBeanDefinition(beanName)) { registry.registerBeanDefinition(beanName, diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/ServiceActivatorFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/ServiceActivatorFactoryBean.java index c35e700648..1d30b664dd 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/ServiceActivatorFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/ServiceActivatorFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,6 @@ public class ServiceActivatorFactoryBean extends AbstractStandardMessageHandlerF return handler; } - /** * Always returns true - any {@link AbstractMessageProducingHandler} can * be used directly. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBean.java index 365be7cbca..ece0dd82b5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,6 @@ public class SourcePollingChannelAdapterFactoryBean implements FactoryBean source) { this.source = source; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java index 75b3bb9553..0db8446565 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,4 +94,5 @@ public class AggregatorParser extends AbstractCorrelatingMessageHandlerParser { return builder; } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AnnotationConfigParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AnnotationConfigParser.java index a414111d38..184df62677 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AnnotationConfigParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AnnotationConfigParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,6 @@ public class AnnotationConfigParser implements BeanDefinitionParser { } } - @Override public Set getDeclaredMethods() { throw new UnsupportedOperationException("The class doesn't support this operation"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java index d19f82760f..2a38669727 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -131,7 +131,6 @@ public class ChainParser extends AbstractConsumerEndpointParser { boolean hasId = StringUtils.hasText(id); String handlerComponentName = chainHandlerId + "$child" + (hasId ? "." + id : "#" + order); - if ("bean".equals(element.getLocalName())) { holder = parserContext.getDelegate().parseBeanDefinitionElement(element, parentDefinition); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChannelInterceptorParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChannelInterceptorParser.java index 712d58d977..0ff93aeb17 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChannelInterceptorParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChannelInterceptorParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,13 +42,11 @@ public class ChannelInterceptorParser { private final Map parsers; - public ChannelInterceptorParser() { this.parsers = new HashMap(); this.parsers.put("wire-tap", new WireTapParser()); } - @SuppressWarnings({"unchecked", "rawtypes"}) public ManagedList parseInterceptors(Element element, ParserContext parserContext) { ManagedList interceptors = new ManagedList(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GatewayParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GatewayParser.java index 943fbeeb03..7d4eba22c8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GatewayParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/GatewayParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,6 @@ public class GatewayParser implements BeanDefinitionParser { gatewayAttributes.put("defaultRequestTimeout", element.getAttribute(isNested ? "request-timeout" : "default-request-timeout")); - headers(element, gatewayAttributes); methods(element, parserContext, gatewayAttributes); @@ -185,7 +184,6 @@ public class GatewayParser implements BeanDefinitionParser { } } - private static BeanDefinitionHolder buildBeanDefinition(Map gatewayAttributes, // NOSONAR complexity ParserContext parserContext) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationManagementParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationManagementParser.java index f9aa727433..6412ab422b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationManagementParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationManagementParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import org.springframework.integration.config.IntegrationManagementConfigurer; */ public class IntegrationManagementParser extends AbstractBeanDefinitionParser { - @Override protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) throws BeanDefinitionStoreException { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/RecipientListRouterParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/RecipientListRouterParser.java index 1d83953d0a..f0fa484d6f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/RecipientListRouterParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/RecipientListRouterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import org.springframework.integration.router.RecipientListRouter.Recipient; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; - /** * Parser for the <recipient-list-router/> element. * diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/SpelFunctionParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/SpelFunctionParser.java index 8c5887bbf6..02a8bd8eaf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/SpelFunctionParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/SpelFunctionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,4 +41,5 @@ public class SpelFunctionParser extends AbstractSingleBeanDefinitionParser { .addConstructorArgValue(element.getAttribute("method")); } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java index aba92e2ca2..51af94d311 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,6 @@ public abstract class IntegrationContextUtils { public static final String INTEGRATION_GRAPH_SERVER_BEAN_NAME = "integrationGraphServer"; - public static final String SPEL_PROPERTY_ACCESSOR_REGISTRAR_BEAN_NAME = "spelPropertyAccessorRegistrar"; public static final String ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME = diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java index 6af3f6de76..d31bd8c930 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,6 @@ public final class IntegrationProperties { public static final String CHANNELS_MAX_BROADCAST_SUBSCRIBERS = INTEGRATION_PROPERTIES_PREFIX + "channels.maxBroadcastSubscribers"; - /** * Specifies the value for {@link org.springframework.integration.channel.PublishSubscribeChannel#requireSubscribers} * on a global default {@link IntegrationContextUtils#ERROR_CHANNEL_BEAN_NAME}. @@ -90,7 +89,6 @@ public final class IntegrationProperties { public static final String ERROR_CHANNEL_IGNORE_FAILURES = INTEGRATION_PROPERTIES_PREFIX + "channels.error.ignoreFailures"; - /** * Specifies the value of {@link org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler#poolSize} * for the {@code taskScheduler} bean initialized by the Integration infrastructure. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/core/AsyncMessagingTemplate.java b/spring-integration-core/src/main/java/org/springframework/integration/core/AsyncMessagingTemplate.java index fe821bccc3..8c17c2aba6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/core/AsyncMessagingTemplate.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/core/AsyncMessagingTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class AsyncMessagingTemplate extends MessagingTemplate implements AsyncMe private volatile AsyncTaskExecutor executor = new SimpleAsyncTaskExecutor(); - public void setExecutor(Executor executor) { Assert.notNull(executor, "executor must not be null"); this.executor = (executor instanceof AsyncTaskExecutor) ? diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java index 09187307b2..84f0bddd72 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ public class AggregateMessageDeliveryException extends MessageDeliveryException private final List aggregatedExceptions; - public AggregateMessageDeliveryException(Message undeliveredMessage, String description, List aggregatedExceptions) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java index 9f025a2e86..c1993b5b96 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java @@ -77,7 +77,6 @@ public class BroadcastingDispatcher extends AbstractDispatcher implements BeanFa private volatile boolean messageBuilderFactorySet; - public BroadcastingDispatcher() { this(null, false); } @@ -206,7 +205,6 @@ public class BroadcastingDispatcher extends AbstractDispatcher implements BeanFa return dispatched >= this.minSubscribers; } - private Runnable createMessageHandlingTask(final MessageHandler handler, final Message message) { MessageHandlingRunnable task = new MessageHandlingRunnable() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java index 699aed5498..2a877a6c20 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java @@ -73,7 +73,6 @@ public class UnicastingDispatcher extends AbstractDispatcher { this.executor = executor; } - /** * Specify whether this dispatcher should failover when a single * {@link MessageHandler} throws an Exception. The default value is diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java index dd9dc221f2..390ac8fd6e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,7 +120,6 @@ public class AggregatorSpec extends CorrelationHandlerSpec getComponentsToRegister() { if (this.headersFunction != null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java index cdc4058ba2..95e92c368f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java @@ -697,7 +697,7 @@ public abstract class BaseIntegrationFlowDefinition B transform(@Nullable Class

expectedType, GenericTransformer genericTransformer, + private B transform(@Nullable Class

expectedType, GenericTransformer genericTransformer, @Nullable Consumer> endpointConfigurer) { Assert.notNull(genericTransformer, "'genericTransformer' must not be null"); @@ -1320,7 +1320,8 @@ public abstract class BaseIntegrationFlowDefinition { }); + return splitWith((splitterSpec) -> { + }); } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/Channels.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/Channels.java index d26b62d624..39f4a1cbfc 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/Channels.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/Channels.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -138,7 +138,6 @@ public final class Channels { return MessageChannels.executor(id, executor); } - public FluxMessageChannelSpec flux() { return MessageChannels.flux(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/EnricherSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/EnricherSpec.java index 7199b07835..c3a62f3ed8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/EnricherSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/EnricherSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -313,7 +313,6 @@ public class EnricherSpec extends ConsumerEndpointSpec doGet() { if (!this.propertyExpressions.isEmpty()) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java index b336052465..376fd80736 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -749,7 +749,6 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec, H extends MessageHandler> extends IntegrationComponentSpec { + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java index 675d4bfcd3..09dc99540b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,6 @@ public class QueueChannelSpec extends MessageChannelSpec Flux> transformWithFunction(Publisher> publisher, Function>, ? extends Publisher> fluxFunction) { @@ -334,7 +333,6 @@ public abstract class Transformers { .contextWrite(ctx -> ctx.put(RequestMessageHolder.class, new RequestMessageHolder())); } - @SuppressWarnings("serial") private static final class RequestMessageHolder extends AtomicReference> { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java index 60354c96c3..b746627c83 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java @@ -454,7 +454,6 @@ public class IntegrationFlowBeanPostProcessor ((BeanDefinitionRegistry) this.beanFactory).registerBeanDefinition(beanName, beanDefinition); - this.beanFactory.getBean(beanName); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java index 1206d8da3b..629aa49839 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class FixedSubscriberChannelPrototype implements MessageChannel { return this.name; } - @Override public boolean send(Message message) { throw new UnsupportedOperationException(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/MessageChannelReference.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/MessageChannelReference.java index 02c3cef45a..87e2b0bc58 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/MessageChannelReference.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/MessageChannelReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public record MessageChannelReference(String name) implements MessageChannel { Assert.notNull(name, "'name' must not be null"); } - @Override public boolean send(Message message) { throw new UnsupportedOperationException(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/EventDrivenConsumer.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/EventDrivenConsumer.java index a282e9a917..251d9af4be 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/EventDrivenConsumer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/EventDrivenConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ public class EventDrivenConsumer extends AbstractEndpoint implements Integration private final MessageHandler handler; - public EventDrivenConsumer(SubscribableChannel inputChannel, MessageHandler handler) { Assert.notNull(inputChannel, "inputChannel must not be null"); Assert.notNull(handler, "handler must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSource.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSource.java index b58db128ad..c8aa1d4310 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ public class ExpressionEvaluatingMessageSource extends AbstractMessageSource< private final Class expectedType; - public ExpressionEvaluatingMessageSource(Expression expression, Class expectedType) { Assert.notNull(expression, "expression must not be null"); this.expression = expression; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MethodInvokingMessageSource.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MethodInvokingMessageSource.java index f54ee39aab..32d3c95abc 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MethodInvokingMessageSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MethodInvokingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class MethodInvokingMessageSource extends AbstractMessageSource i private final Lock initializationMonitor = new ReentrantLock(); - public void setObject(Object object) { Assert.notNull(object, "'object' must not be null"); this.object = object; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java index a5688d9a02..a9cb5c39ac 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,6 @@ public class PollingConsumer extends AbstractPollingEndpoint implements Integrat } } - public void setReceiveTimeout(long receiveTimeout) { this.receiveTimeout = receiveTimeout; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java index fc5a3ade22..8be92d75db 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java @@ -47,7 +47,6 @@ import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.ErrorHandler; - /** * An {@link AbstractEndpoint} implementation for Reactive Streams subscription into an * input channel and reactive consumption of messages from that channel. @@ -259,7 +258,6 @@ public class ReactiveStreamsConsumer extends AbstractEndpoint implements Integra return this.subscription == null; } - @Override public void start() { if (this.messageHandler instanceof Lifecycle) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java index b76b69e76c..1d2f270f58 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,7 +157,6 @@ public class SourcePollingChannelAdapter extends AbstractPollingEndpoint } } - @Override protected void doStop() { super.doStop(); @@ -166,7 +165,6 @@ public class SourcePollingChannelAdapter extends AbstractPollingEndpoint } } - @Override protected void onInit() { Assert.notNull(this.source, "source must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/events/IntegrationEvent.java b/spring-integration-core/src/main/java/org/springframework/integration/events/IntegrationEvent.java index a47fea9f4d..379c843261 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/events/IntegrationEvent.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/events/IntegrationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.integration.events; import org.springframework.context.ApplicationEvent; import org.springframework.lang.Nullable; - /** * Base class for all {@link ApplicationEvent}s generated by the framework. * Contains an optional cause field; a separate Exception event hierarchy diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/DynamicExpression.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/DynamicExpression.java index e5ce07e5bf..f19c1e273e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/DynamicExpression.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/DynamicExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ public class DynamicExpression implements Expression { private final ExpressionSource expressionSource; - public DynamicExpression(String key, ExpressionSource expressionSource) { Assert.notNull(key, "key must not be null"); Assert.notNull(expressionSource, "expressionSource must not be null"); @@ -46,7 +45,6 @@ public class DynamicExpression implements Expression { this.expressionSource = expressionSource; } - public Object getValue() throws EvaluationException { return this.resolveExpression().getValue(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java index 425c09faf6..ddd2f3395c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -181,13 +181,11 @@ public final class ExpressionEvalMap extends AbstractMap { throw new UnsupportedOperationException(); } - public static ExpressionEvalMapBuilder from(Map expressions) { Assert.notNull(expressions, "'expressions' must not be null."); return new ExpressionEvalMapBuilder(expressions); } - /** * Implementations of this interface can be provided to build 'on demand {@link #get(Object)} logic' * for {@link ExpressionEvalMap}. @@ -200,7 +198,6 @@ public final class ExpressionEvalMap extends AbstractMap { } - /** * The {@link EvaluationCallback} implementation which evaluates an expression using * the provided {@code context}, {@code root} and {@code returnType} variables. @@ -242,7 +239,6 @@ public final class ExpressionEvalMap extends AbstractMap { } - /** * The builder class to instantiate {@link ExpressionEvalMap}. */ @@ -299,7 +295,6 @@ public final class ExpressionEvalMap extends AbstractMap { } - private class ExpressionEvalMapFinalBuilderImpl implements ExpressionEvalMapFinalBuilder { ExpressionEvalMapFinalBuilderImpl() { @@ -321,7 +316,6 @@ public final class ExpressionEvalMap extends AbstractMap { } - private class ExpressionEvalMapComponentsBuilderImpl extends ExpressionEvalMapFinalBuilderImpl implements ExpressionEvalMapComponentsBuilder { @@ -354,7 +348,6 @@ public final class ExpressionEvalMap extends AbstractMap { } - public interface ExpressionEvalMapComponentsBuilder extends ExpressionEvalMapFinalBuilder { ExpressionEvalMapComponentsBuilder usingEvaluationContext(EvaluationContext context); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java index 37d3d7fb33..27b4d1fe6a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,6 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc private static final String XML_SUFFIX = ".xml"; - /** * Cache to hold filename lists per Locale. */ @@ -115,7 +114,6 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc private ResourceLoader resourceLoader = new DefaultResourceLoader(); - /** * Set a single basename, following the basic ResourceBundle convention of * not specifying file extension or language codes, but referring to a Spring @@ -248,7 +246,6 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc this.resourceLoader = (resourceLoader != null ? resourceLoader : new DefaultResourceLoader()); } - /** * Resolves the given key in the retrieved bundle files to an Expression. */ @@ -401,7 +398,6 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc return result; } - /** * Get a PropertiesHolder for the given filename, either from the * cache or freshly loaded. @@ -553,7 +549,6 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc } } - /** * Clear the resource bundle cache. * Subsequent resolve calls will lead to reloading of the properties files. @@ -582,7 +577,6 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc return getClass().getName() + ": basenames=[" + StringUtils.arrayToCommaDelimitedString(this.basenames) + "]"; } - /** * PropertiesHolder for caching. * Stores the last-modified timestamp of the source file for efficient diff --git a/spring-integration-core/src/main/java/org/springframework/integration/filter/AbstractMessageProcessingSelector.java b/spring-integration-core/src/main/java/org/springframework/integration/filter/AbstractMessageProcessingSelector.java index 39bc7f17cf..e9d9302431 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/filter/AbstractMessageProcessingSelector.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/filter/AbstractMessageProcessingSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,13 +40,11 @@ public abstract class AbstractMessageProcessingSelector private final MessageProcessor messageProcessor; - public AbstractMessageProcessingSelector(MessageProcessor messageProcessor) { Assert.notNull(messageProcessor, "messageProcessor must not be null"); this.messageProcessor = messageProcessor; } - public void setConversionService(ConversionService conversionService) { if (this.messageProcessor instanceof AbstractMessageProcessor) { ((AbstractMessageProcessor) this.messageProcessor).setConversionService(conversionService); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java b/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java index 697ecf293e..5ee20ce47f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,6 @@ public class MessageFilter extends AbstractReplyProducingPostProcessingMessageHa this.selector = selector; } - /** * Specify whether this filter should throw a * {@link MessageRejectedException} when its selector does not accept a @@ -121,7 +120,6 @@ public class MessageFilter extends AbstractReplyProducingPostProcessingMessageHa return this.discardChannel; } - @Override public String getComponentType() { return "filter"; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java index 4251fc8710..46dcea704c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,6 @@ public class AnnotationGatewayProxyFactoryBean extends GatewayProxyFactoryBea String defaultRequestTimeout = resolveAttribute("defaultRequestTimeout"); String defaultReplyTimeout = resolveAttribute("defaultReplyTimeout"); - JavaUtils.INSTANCE .acceptIfCondition(getDefaultRequestChannel() == null && getDefaultRequestChannelName() == null, resolveAttribute("defaultRequestChannel"), diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java index c522c6281b..51c9948cfb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -158,7 +158,6 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper argumentValue, Map headers) { for (Entry entry : argumentValue.entrySet()) { Object key = entry.getKey(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java index 5c9f17e39f..9d5e0610d7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,6 @@ import org.springframework.util.ObjectUtils; import org.springframework.util.ReflectionUtils; import org.springframework.util.StringUtils; - /** * Generates a proxy for the provided service interface to enable interaction * with messaging components without application code being aware of them allowing diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java index 151a5cf616..345990bbc7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -155,7 +155,6 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint private volatile boolean initialized; - /** * Construct an instance that will return null if no reply is received. */ diff --git a/spring-integration-core/src/main/java/org/springframework/integration/graph/IntegrationNode.java b/spring-integration-core/src/main/java/org/springframework/integration/graph/IntegrationNode.java index 8f6b8cf203..11e0e02b03 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/graph/IntegrationNode.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/graph/IntegrationNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -159,4 +159,5 @@ public abstract class IntegrationNode { public boolean isObserved() { return this.observed; } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java index 3a2086e614..0bf1c9f91c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -175,7 +175,6 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa @Nullable protected abstract Object handleRequestMessage(Message requestMessage); - /** * An implementation of this interface is used to wrap the * {@link AbstractReplyProducingMessageHandler#handleRequestMessage(Message)} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/BridgeHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/BridgeHandler.java index 92df472ccd..10ef7b0617 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/BridgeHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/BridgeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,4 +55,5 @@ public class BridgeHandler extends AbstractReplyProducingMessageHandler { protected boolean shouldCopyRequestHeaders() { return false; } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandlerManagement.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandlerManagement.java index d4d2d2e408..dfbb532a6d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandlerManagement.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandlerManagement.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,4 +31,5 @@ public interface DelayHandlerManagement { @ManagedOperation void reschedulePersistedMessages(); + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionCommandMessageProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionCommandMessageProcessor.java index 87e111ee71..7a9b71f0b3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionCommandMessageProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionCommandMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,17 +100,14 @@ public class ExpressionCommandMessageProcessor extends AbstractMessageProcessor< throw new IllegalArgumentException("Message payload must be an Expression instance or an expression String."); } - private static final class ExpressionCommandMethodResolver extends ReflectiveMethodResolver { private final MethodFilter methodFilter; - ExpressionCommandMethodResolver(MethodFilter methodFilter) { this.methodFilter = methodFilter; } - @Override public MethodExecutor resolve(EvaluationContext context, Object targetObject, String name, List argumentTypes) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java index 365e79a9ca..90e6be1fcb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ public class ExpressionEvaluatingMessageHandler extends AbstractMessageHandler { private String componentType; - public ExpressionEvaluatingMessageHandler(Expression expression) { Assert.notNull(expression, "'expression' must not be null"); this.processor = new ExpressionEvaluatingMessageProcessor<>(expression, Void.class); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java index 613eb761c5..880445f3e1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ public class ExpressionEvaluatingMessageProcessor extends AbstractMessageProc private final Class expectedType; - /** * Create an {@link ExpressionEvaluatingMessageProcessor} for the given expression. * @param expression The expression. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java index 1a01865e74..92e321f18f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.springframework.integration.handler; import org.springframework.messaging.Message; - /** * Implementations of this interface are subclasses of * {@link AbstractMessageHandler} that perform post processing after the diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java index 3e144fdd87..7a28c310fa 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ public class ServiceActivatingHandler extends AbstractReplyProducingMessageHandl private final MessageProcessor processor; - public ServiceActivatingHandler(final Object object) { this(new MethodInvokingMessageProcessor<>(object, ServiceActivator.class)); } @@ -52,7 +51,6 @@ public class ServiceActivatingHandler extends AbstractReplyProducingMessageHandl this.processor = processor; } - @Override public String getComponentType() { return "service-activator"; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/CacheRequestHandlerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/CacheRequestHandlerAdvice.java index b469020020..84a204d59f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/CacheRequestHandlerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/CacheRequestHandlerAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,7 +184,6 @@ public class CacheRequestHandlerAdvice extends AbstractRequestHandlerAdvice this.keyExpression = keyExpression; } - @Override public void afterSingletonsInstantiated() { this.delegate.afterSingletonsInstantiated(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java index 68b2c72de1..a1ee875e21 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,7 +100,6 @@ public class ErrorMessageSendingRecoverer extends ErrorMessagePublisher implemen private static final long serialVersionUID = 1L; - RetryExceptionNotAvailableException(String description) { super(description); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/HandleMessageAdviceAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/HandleMessageAdviceAdapter.java index 1235ef6b61..d4d4352153 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/HandleMessageAdviceAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/HandleMessageAdviceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public class HandleMessageAdviceAdapter implements HandleMessageAdvice { this.delegate = delegate; } - @Override public Object invoke(MethodInvocation invocation) throws Throwable { return this.delegate.invoke(invocation); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RateLimiterRequestHandlerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RateLimiterRequestHandlerAdvice.java index 12f11e8f2c..260c2026fa 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RateLimiterRequestHandlerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RateLimiterRequestHandlerAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -135,7 +135,6 @@ public class RateLimiterRequestHandlerAdvice extends AbstractRequestHandlerAdvic } } - /** * A {@link MessagingException} wrapper for the {@link RequestNotPermitted} * with the {@code requestMessage} and {@code target} context. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/support/MessagingMethodInvokerHelper.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/support/MessagingMethodInvokerHelper.java index 10ea3db87c..eb92dd547a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/support/MessagingMethodInvokerHelper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/support/MessagingMethodInvokerHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -638,7 +638,6 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator im return new IllegalStateException("Cannot process message", evaluationException); } - /* * If there's a single method, it is SpEL only, the content is JSON, * the payload is a String or byte[], the parameter doesn't match the payload, diff --git a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java index 2dfb4bba94..0814e3af67 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java @@ -73,7 +73,6 @@ public final class MessageHistory implements List, Serializable, Clo private static final MessageBuilderFactory MESSAGE_BUILDER_FACTORY = new DefaultMessageBuilderFactory(); - private final List components; @Nullable @@ -153,7 +152,6 @@ public final class MessageHistory implements List, Serializable, Clo this.components = components; } - @Override public int size() { return this.components.size(); @@ -303,7 +301,6 @@ public final class MessageHistory implements List, Serializable, Clo throw UNSUPPORTED_OPERATION_EXCEPTION_IMMUTABLE; } - private static Properties extractMetadata(NamedComponent component) { Entry entry = new Entry(); String name = component.getComponentName(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java index 18e3a96af8..b59c2fe340 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,6 @@ public class MessageHistoryConfigurer implements ManageableSmartLifecycle, BeanF private volatile boolean running; - /** * The patterns for which components will be tracked; default '*' (all trackable * components). Cannot be changed if {@link #isRunning()}; invoke {@link #stop()} first. @@ -103,7 +102,6 @@ public class MessageHistoryConfigurer implements ManageableSmartLifecycle, BeanF return StringUtils.arrayToCommaDelimitedString(this.componentNamePatterns); } - /** * The patterns for which components will be tracked; default '*' (all trackable * components). Cannot be changed if {@link #isRunning()}; invoke {@link #stop()} first. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/leader/Candidate.java b/spring-integration-core/src/main/java/org/springframework/integration/leader/Candidate.java index aadb3c1466..bf3d4a5fd0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/leader/Candidate.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/leader/Candidate.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,4 +70,5 @@ public interface Candidate { * @param ctx leadership context */ void onRevoked(Context ctx); + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/metadata/ConcurrentMetadataStore.java b/spring-integration-core/src/main/java/org/springframework/integration/metadata/ConcurrentMetadataStore.java index e8bfc3a3d5..eb11c980a1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/metadata/ConcurrentMetadataStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/metadata/ConcurrentMetadataStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.metadata; - /** * Supports atomic updates to values in the store. * diff --git a/spring-integration-core/src/main/java/org/springframework/integration/metadata/ListenableMetadataStore.java b/spring-integration-core/src/main/java/org/springframework/integration/metadata/ListenableMetadataStore.java index a3a9d8eea1..3400ad314c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/metadata/ListenableMetadataStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/metadata/ListenableMetadataStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,4 +38,5 @@ public interface ListenableMetadataStore extends ConcurrentMetadataStore { * @param callback the callback to be unregistered */ void removeListener(MetadataStoreListener callback); + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStoreListenerAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStoreListenerAdapter.java index 1359db1359..26b75c8441 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStoreListenerAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStoreListenerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,4 +37,5 @@ public abstract class MetadataStoreListenerAdapter implements MetadataStoreListe public void onUpdate(String key, String newValue) { } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/metadata/SimpleMetadataStore.java b/spring-integration-core/src/main/java/org/springframework/integration/metadata/SimpleMetadataStore.java index d39306a7eb..166711b357 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/metadata/SimpleMetadataStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/metadata/SimpleMetadataStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.util.concurrent.ConcurrentMap; import org.springframework.util.Assert; - /** * Simple implementation of {@link MetadataStore} that uses a {@link ConcurrentMap} for the data store. * The metadata may not be persisted across application restarts, if the provided {@link ConcurrentMap} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/resource/ResourceRetrievingMessageSource.java b/spring-integration-core/src/main/java/org/springframework/integration/resource/ResourceRetrievingMessageSource.java index add8be0fb8..5a501eb647 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/resource/ResourceRetrievingMessageSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/resource/ResourceRetrievingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,13 +53,11 @@ public class ResourceRetrievingMessageSource extends AbstractMessageSource filter; - public ResourceRetrievingMessageSource(String pattern) { Assert.hasText(pattern, "pattern must not be empty"); this.pattern = pattern; } - public void setPatternResolver(ResourcePatternResolver patternResolver) { this.patternResolver = patternResolver; } @@ -78,7 +76,6 @@ public class ResourceRetrievingMessageSource extends AbstractMessageSource channelMappings = new LinkedHashMap<>(); - /** * Provide mappings from channel keys to channel names. * Channel names will be resolved by the diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java index c285aa2f9c..90313b77ae 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,13 +40,11 @@ class AbstractMessageProcessingRouter extends AbstractMappingMessageRouter private final MessageProcessor messageProcessor; - AbstractMessageProcessingRouter(MessageProcessor messageProcessor) { Assert.notNull(messageProcessor, "messageProcessor must not be null"); this.messageProcessor = messageProcessor; } - @Override public final void onInit() { super.onInit(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java index f15458ea3d..1566655fa2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -259,7 +259,6 @@ public class RecipientListRouter extends AbstractMessageRouter implements Recipi return result; } - @Override protected void onInit() { super.onInit(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java index fe709ced7b..7936a27eaf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,6 @@ public class ExpressionEvaluatingRoutingSlipRouteStrategy private final Object reply; - RequestAndReply(Message request, Object reply) { this.request = request; this.reply = reply; @@ -128,4 +127,5 @@ public class ExpressionEvaluatingRoutingSlipRouteStrategy } } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java index 35d17eec84..535ba54567 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,6 @@ public class ScatterGatherHandler extends AbstractReplyProducingMessageHandler i private AbstractEndpoint gatherEndpoint; - public ScatterGatherHandler(MessageHandler scatterer, MessageHandler gatherer) { this(new FixedSubscriberChannel(scatterer), gatherer); Assert.notNull(scatterer, "'scatterer' must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollSkipAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollSkipAdvice.java index 94f9247025..8933d0e5b6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollSkipAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollSkipAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,12 +42,10 @@ public class PollSkipAdvice implements MethodInterceptor { this(new DefaultPollSkipStrategy()); } - public PollSkipAdvice(PollSkipStrategy strategy) { this.pollSkipStrategy = strategy; } - @Override public Object invoke(MethodInvocation invocation) throws Throwable { if ("call".equals(invocation.getMethod().getName()) && this.pollSkipStrategy.skipPoll()) { @@ -63,7 +61,6 @@ public class PollSkipAdvice implements MethodInterceptor { } } - private static final class DefaultPollSkipStrategy implements PollSkipStrategy { DefaultPollSkipStrategy() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java index b4fd2da445..8ef87bb7a5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,6 @@ public class PollerMetadata { private TransactionSynchronizationFactory transactionSynchronizationFactory; - public void setTransactionSynchronizationFactory( TransactionSynchronizationFactory transactionSynchronizationFactory) { Assert.notNull(transactionSynchronizationFactory, "'transactionSynchronizationFactory' must not be null"); @@ -147,7 +146,6 @@ public class PollerMetadata { this.sendTimeout = sendTimeout; } - /** * Return the default {@link PollerMetadata} bean if available. * @param beanFactory BeanFactory for lookup, must not be null. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java b/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java index 65c5283516..1c38ac81e9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ public class PayloadTypeSelector implements MessageSelector { private final List> acceptedTypes = new ArrayList>(); - /** * Create a selector for the provided types. At least one is required. * @@ -47,7 +46,6 @@ public class PayloadTypeSelector implements MessageSelector { } } - @Override public boolean accept(Message message) { Assert.notNull(message, "'message' must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageProcessingSplitter.java b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageProcessingSplitter.java index 846ba9ac35..cc902bc0a0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageProcessingSplitter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageProcessingSplitter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ abstract class AbstractMessageProcessingSplitter extends AbstractMessageSplitter private final MessageProcessor> processor; - protected AbstractMessageProcessingSplitter(MessageProcessor> expressionEvaluatingMessageProcessor) { Assert.notNull(expressionEvaluatingMessageProcessor, "messageProcessor must not be null"); this.processor = expressionEvaluatingMessageProcessor; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java index b6717c293b..60867c8e35 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java @@ -130,7 +130,6 @@ public abstract class AbstractMessageSplitter extends AbstractReplyProducingMess boolean reactive = getOutputChannel() instanceof ReactiveStreamsSubscribableChannel; setAsync(reactive); - if (reactive) { return prepareFluxResult(message, result); } @@ -353,7 +352,6 @@ public abstract class AbstractMessageSplitter extends AbstractReplyProducingMess */ protected abstract Object splitMessage(Message message); - private static final class JacksonNodeHelper { private static boolean isNode(Object object) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java b/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java index d26eb03bf8..fb73b6d467 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ public class DefaultMessageSplitter extends AbstractMessageSplitter { private volatile String delimiters; - /** * Set delimiters to use for tokenizing String values. The default is * null indicating that no tokenization should occur. If diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java index f4d61dc6bf..9badbb5d62 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.store; - import org.springframework.util.Assert; /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java index b3f94111b1..425b05c665 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -234,7 +234,6 @@ public abstract class AbstractKeyValueMessageStore extends AbstractMessageGroupS metadata.setLastModified(System.currentTimeMillis()); } - // store MessageGroupMetadata built from enriched MG doStore(this.groupPrefix + groupId, metadata); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/BasicMessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/BasicMessageGroupStore.java index 35b87b4e83..a0302c5930 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/BasicMessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/BasicMessageGroupStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,4 +66,5 @@ public interface BasicMessageGroupStore { * @param groupId The id of the group to remove. */ void removeMessageGroup(Object groupId); + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/PersistentMessageGroup.java b/spring-integration-core/src/main/java/org/springframework/integration/store/PersistentMessageGroup.java index 68e245a4f1..17c2171cdf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/PersistentMessageGroup.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/PersistentMessageGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -205,7 +205,6 @@ class PersistentMessageGroup implements MessageGroup { this.original.clear(); } - private final class PersistentCollection extends AbstractCollection> { private final Lock innerLock = new ReentrantLock(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java index fd53e3bb79..5f6cd4be70 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,6 @@ public class SimpleMessageStore extends AbstractMessageGroupStore this(individualCapacity, groupCapacity, 0, lockRegistry); } - /** * Creates a SimpleMessageStore with a maximum size limited by the given capacity, * the timeout in millisecond to wait for the empty slot in the store and LockRegistry diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java b/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java index db33e9ad49..2ddcf47e8d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2021 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.util.concurrent.atomic.AtomicLong; import org.springframework.util.IdGenerator; - /** * Alternative {@link IdGenerator} implementations. * diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageBuilder.java b/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageBuilder.java index 33313f9ba9..924c2e2c56 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageBuilder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ import org.springframework.util.Assert; import org.springframework.util.PatternMatchUtils; import org.springframework.util.StringUtils; - /** * Specialized message builder that can be used within a component to avoid the overhead * of having to build multiple messages for mutations within that component. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageHeaders.java b/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageHeaders.java index 1730050712..45b14f0530 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageHeaders.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/MutableMessageHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import java.util.UUID; import org.springframework.lang.Nullable; import org.springframework.messaging.MessageHeaders; - /** * A MessageHeaders that permits direct access to and modification of the * header map. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/PropertiesBuilder.java b/spring-integration-core/src/main/java/org/springframework/integration/support/PropertiesBuilder.java index 8b85a81042..e0eec9f8bb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/PropertiesBuilder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/PropertiesBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.springframework.integration.support; import java.util.Properties; - /** * A {@code Builder} pattern implementation for the {@link Properties}. * diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/AllowListDeserializingConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/AllowListDeserializingConverter.java index fa44f84ca1..b16325fd5e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/AllowListDeserializingConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/AllowListDeserializingConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class AllowListDeserializingConverter implements Converter allowedPatterns = new LinkedHashSet<>(); - /** * Create a {@link AllowListDeserializingConverter} with default * {@link ObjectInputStream} configuration, using the "latest user-defined diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java index 09812e8507..6ba1d3f79c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,6 @@ public class MapMessageConverter implements MessageConverter, BeanFactoryAware { private boolean messageBuilderFactorySet; - @Override public final void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/ObjectStringMessageConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/ObjectStringMessageConverter.java index d6ae3b6c35..c6715e1812 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/ObjectStringMessageConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/ObjectStringMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class ObjectStringMessageConverter extends StringMessageConverter { super(); } - @Override protected Object convertFromInternal(Message message, Class targetClass, @Nullable Object conversionHint) { Object payload = message.getPayload(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/SimpleMessageConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/SimpleMessageConverter.java index a478e8c373..2bf5fdc76e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/SimpleMessageConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/SimpleMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,8 @@ public class SimpleMessageConverter implements MessageConverter, BeanFactoryAwar private BeanFactory beanFactory; - public SimpleMessageConverter() { } + public SimpleMessageConverter() { + } public SimpleMessageConverter(InboundMessageMapper inboundMessageMapper) { setInboundMessageMapper(inboundMessageMapper); @@ -75,7 +76,6 @@ public class SimpleMessageConverter implements MessageConverter, BeanFactoryAwar setOutboundMessageMapper(outboundMessageMapper); } - public final void setInboundMessageMapper(@Nullable InboundMessageMapper inboundMessageMapper) { if (inboundMessageMapper != null) { this.inboundMessageMapper = inboundMessageMapper; @@ -125,7 +125,6 @@ public class SimpleMessageConverter implements MessageConverter, BeanFactoryAwar } } - private class DefaultInboundMessageMapper implements InboundMessageMapper { DefaultInboundMessageMapper() { @@ -147,7 +146,6 @@ public class SimpleMessageConverter implements MessageConverter, BeanFactoryAwar } - private static class DefaultOutboundMessageMapper implements OutboundMessageMapper { DefaultOutboundMessageMapper() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/json/GenericMessageJacksonDeserializer.java b/spring-integration-core/src/main/java/org/springframework/integration/support/json/GenericMessageJacksonDeserializer.java index 93fdc9f8c8..b7a6649548 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/json/GenericMessageJacksonDeserializer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/json/GenericMessageJacksonDeserializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,4 +45,5 @@ public class GenericMessageJacksonDeserializer extends MessageJacksonDeserialize DeserializationContext ctxt) throws IOException { return new GenericMessage(payload, headers); } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/json/Jackson2JsonMessageParser.java b/spring-integration-core/src/main/java/org/springframework/integration/support/json/Jackson2JsonMessageParser.java index 79fb9aff0e..af824b9291 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/json/Jackson2JsonMessageParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/json/Jackson2JsonMessageParser.java @@ -16,7 +16,6 @@ package org.springframework.integration.support.json; - import java.io.IOException; import java.io.UncheckedIOException; import java.util.LinkedHashMap; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java b/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java index 201b6db37a..ee64b89ffb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,4 +81,5 @@ public final class DefaultLockRegistry implements LockRegistry { Integer lockIndex = lockKey.hashCode() & this.mask; return this.lockTable[lockIndex]; } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/observation/DefaultMessageSenderObservationConvention.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/observation/DefaultMessageSenderObservationConvention.java index 8aca73980e..7e1350d7bf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/observation/DefaultMessageSenderObservationConvention.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/observation/DefaultMessageSenderObservationConvention.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ public class DefaultMessageSenderObservationConvention implements MessageSenderO public static final DefaultMessageSenderObservationConvention INSTANCE = new DefaultMessageSenderObservationConvention(); - @Override public KeyValues getLowCardinalityKeyValues(MessageSenderContext context) { return KeyValues @@ -43,4 +42,5 @@ public class DefaultMessageSenderObservationConvention implements MessageSenderO // See IntegrationObservation.ProducerTags.COMPONENT_TYPE - to avoid class tangle .and("spring.integration.type", "producer"); } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/PassThroughTransactionSynchronizationFactory.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/PassThroughTransactionSynchronizationFactory.java index 4e7ef82aff..465372d7e2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/PassThroughTransactionSynchronizationFactory.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/PassThroughTransactionSynchronizationFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import org.springframework.util.Assert; */ public class PassThroughTransactionSynchronizationFactory implements TransactionSynchronizationFactory { - @Override public TransactionSynchronization create(Object key) { Assert.notNull(key, "'key' must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/PseudoTransactionManager.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/PseudoTransactionManager.java index 05d277df12..df46968cc2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/PseudoTransactionManager.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/PseudoTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,4 +58,5 @@ public class PseudoTransactionManager extends AbstractPlatformTransactionManager protected void doRollback(DefaultTransactionStatus status) throws TransactionException { //noop } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java index f8fed5d65d..4fc130c69f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,7 +90,6 @@ public class TransactionSynchronizationFactoryBean implements FactoryBeantoString() method. Unless the diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadDeserializingTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadDeserializingTransformer.java index 650fd68dfb..755f014cc0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadDeserializingTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadDeserializingTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import org.springframework.core.serializer.Deserializer; import org.springframework.integration.support.converter.AllowListDeserializingConverter; import org.springframework.util.Assert; - /** * Transformer that deserializes the inbound byte array payload to an object by delegating * to a Converter<byte[], Object>. Default delegate is a diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/AnnotatedMethodFilter.java b/spring-integration-core/src/main/java/org/springframework/integration/util/AnnotatedMethodFilter.java index 726764c750..376af61967 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/AnnotatedMethodFilter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/AnnotatedMethodFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,14 +45,12 @@ public class AnnotatedMethodFilter implements MethodFilter { private final boolean requiresReply; - public AnnotatedMethodFilter(Class annotationType, String methodName, boolean requiresReply) { this.annotationType = annotationType; this.methodName = methodName; this.requiresReply = requiresReply; } - public List filter(List methods) { List annotatedCandidates = new ArrayList<>(); List fallbackCandidates = new ArrayList<>(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java index ce6e8b8325..40d96a7dc7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware private volatile boolean haveCalledDelegateGetDefaultEditor; - public BeanFactoryTypeConverter() { this.conversionService = DefaultConversionService.getSharedInstance(); } @@ -56,7 +55,6 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware this.conversionService = conversionService; } - public void setConversionService(ConversionService conversionService) { this.conversionService = conversionService; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/ClassUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/util/ClassUtils.java index 947c565fd8..9bb02a5a57 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/ClassUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/ClassUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public abstract class ClassUtils { */ private static final Map, Class> PRIMITIVE_WRAPPER_TYPE_MAP = new HashMap<>(8); - /** * The {@link Function#apply(Object)} method object. */ diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java b/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java index b152c10440..aadd0842a7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import org.springframework.scheduling.Trigger; import org.springframework.scheduling.TriggerContext; import org.springframework.util.Assert; - /** * This is a dynamically changeable {@link Trigger}. It is based on the * {@link org.springframework.scheduling.support.PeriodicTrigger} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java b/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java index 7d7ad196d3..25ad1ead93 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ public class ErrorHandlingTaskExecutor implements TaskExecutor { private final ErrorHandler errorHandler; - public ErrorHandlingTaskExecutor(Executor executor, ErrorHandler errorHandler) { Assert.notNull(executor, "executor must not be null"); Assert.notNull(errorHandler, "errorHandler must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/FixedMethodFilter.java b/spring-integration-core/src/main/java/org/springframework/integration/util/FixedMethodFilter.java index a31277af0f..1dd5b3d7bf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/FixedMethodFilter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/FixedMethodFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,13 +38,11 @@ public class FixedMethodFilter implements MethodFilter { private final Method method; - public FixedMethodFilter(Method method) { Assert.notNull(method, "method must not be null"); this.method = method; } - public List filter(List methods) { if (methods != null && methods.contains(this.method)) { List filteredList = new ArrayList(1); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/StackTraceUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/util/StackTraceUtils.java index 9f3f31d6cf..99fbaaa8db 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/StackTraceUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/StackTraceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,4 +48,5 @@ public final class StackTraceUtils { } throw new IllegalArgumentException("Neither " + firstClass + " nor " + secondClass + " class found"); } + } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/UniqueMethodFilter.java b/spring-integration-core/src/main/java/org/springframework/integration/util/UniqueMethodFilter.java index 91d8fe915d..c8f0da4ff7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/UniqueMethodFilter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/UniqueMethodFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ public class UniqueMethodFilter implements MethodFilter { private final List uniqueMethods = new ArrayList(); - public UniqueMethodFilter(Class targetClass) { Method[] allMethods = ReflectionUtils.getAllDeclaredMethods(targetClass); for (Method method : allMethods) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java b/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java index 160edb6da6..5a3b1e5632 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ public final class UpperBound { private final Semaphore semaphore; - /** * Create an UpperBound with the given capacity. If the given capacity is less than 1 * an infinite UpperBound is created. @@ -52,7 +51,6 @@ public final class UpperBound { return this.semaphore.availablePermits(); } - /** * Acquires a permit from the underlying semaphore if this UpperBound is bounded and returns * true if it succeeds within the given timeout. If the timeout is less than 0, it will block @@ -105,4 +103,5 @@ public final class UpperBound { return super.toString() + "[Permits = " + (this.semaphore != null ? this.semaphore.availablePermits() : "UNLIMITED") + "]"; } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatingMessageGroupProcessorHeaderTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatingMessageGroupProcessorHeaderTests.java index 5c27c7b24f..37cc914ac5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatingMessageGroupProcessorHeaderTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatingMessageGroupProcessorHeaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ public class AggregatingMessageGroupProcessorHeaderTests { this.methodInvokingProcessor.setBeanFactory(mock(BeanFactory.class)); } - @Test public void singleMessageUsingDefaultProcessor() { singleMessage(this.defaultProcessor); @@ -157,7 +156,6 @@ public class AggregatingMessageGroupProcessorHeaderTests { assertThat(resultMessage.getHeaders().get("k2")).isNull(); } - private void singleMessage(MessageGroupProcessor processor) { Map headers = new HashMap<>(); headers.put("k1", "value1"); @@ -279,7 +277,6 @@ public class AggregatingMessageGroupProcessorHeaderTests { .build(); } - private static class TestAggregatorBean { TestAggregatorBean() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java index a6c3870c0a..12369cd16a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,6 @@ public class AggregatorTests { handler.setMessageStore(store); - Message message = new GenericMessage("foo"); StopWatch stopwatch = new StopWatch(); stopwatch.start(); @@ -154,7 +153,6 @@ public class AggregatorTests { handler.setMessageStore(store); - StopWatch stopwatch = new StopWatch(); stopwatch.start(); for (int i = 0; i < 120000; i++) { @@ -550,7 +548,6 @@ public class AggregatorTests { assertThat((reply.getPayload())).isEqualTo(105); } - private static Message createMessage(Object payload, Object correlationId, int sequenceSize, int sequenceNumber, MessageChannel replyChannel, String predefinedId) { MessageBuilder builder = MessageBuilder.withPayload(payload).setCorrelationId(correlationId) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/BarrierMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/BarrierMessageHandlerTests.java index 933dc7d9d7..563ea7307b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/BarrierMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/BarrierMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; - /** * @author Gary Russell * @author Artem Bilan diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java index 0e338b9825..efb2dc71d9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class ConcurrentAggregatorTests { private final MessageGroupStore store = new SimpleMessageStore(); - @BeforeEach public void configureAggregator() { this.taskExecutor = new SimpleAsyncTaskExecutor(); @@ -61,7 +60,6 @@ public class ConcurrentAggregatorTests { this.aggregator.setReleaseStrategy(new SimpleSequenceSizeReleaseStrategy()); } - @Test public void testCompleteGroupWithinTimeout() throws InterruptedException { QueueChannel replyChannel = new QueueChannel(); @@ -246,7 +244,6 @@ public class ConcurrentAggregatorTests { assertThat(reply.getPayload()).isEqualTo(105); } - private static Message createMessage(Object payload, Object correlationId, int sequenceSize, int sequenceNumber, MessageChannel replyChannel, String predefinedId) { @@ -262,7 +259,6 @@ public class ConcurrentAggregatorTests { return builder.build(); } - private static class AggregatorTestTask implements Runnable { private final MessageHandler aggregator; @@ -299,7 +295,6 @@ public class ConcurrentAggregatorTests { } - private class MultiplyingProcessor implements MessageGroupProcessor { MultiplyingProcessor() { @@ -317,7 +312,6 @@ public class ConcurrentAggregatorTests { } - @SuppressWarnings("unused") private class NullReturningMessageProcessor implements MessageGroupProcessor { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageBarrierTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageBarrierTests.java index f20df2d967..65cfe971fd 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageBarrierTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageBarrierTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -128,7 +128,6 @@ public class CorrelatingMessageBarrierTests { return MessageBuilder.withPayload((Object) "payload").build(); } - /** * ReleaseStrategy that emulates the use case described in INT-1068 */ @@ -169,5 +168,7 @@ public class CorrelatingMessageBarrierTests { semaphore.release(); } } + } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerIntegrationTests.java index b85e9448b1..f510978f76 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ public class CorrelatingMessageHandlerIntegrationTests { defaultHandler.afterPropertiesSet(); } - @Test public void completesSingleMessage() throws Exception { Message message = correlatedMessage(1, 1, 1); @@ -126,7 +125,6 @@ public class CorrelatingMessageHandlerIntegrationTests { verify(outputChannel).send(message2); } - private Message correlatedMessage(Object correlationId, Integer sequenceSize, Integer sequenceNumber) { return MessageBuilder.withPayload("test") .setCorrelationId(correlationId) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerTests.java index e83d9702cb..1e2d11e42f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class CorrelatingMessageHandlerTests { private final MessageGroupStore store = new SimpleMessageStore(); - @BeforeEach public void initializeSubject() { correlationStrategy = mock(CorrelationStrategy.class); @@ -174,7 +173,6 @@ public class CorrelatingMessageHandlerTests { } } - private Message testMessage(String correlationKey, int sequenceNumber, int sequenceSize) { return MessageBuilder.withPayload("test" + sequenceNumber) .setCorrelationId(correlationKey) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategyTests.java index c318bcdb9c..fa8ea3dbc6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class ExpressionEvaluatingCorrelationStrategyTests { private ExpressionEvaluatingCorrelationStrategy strategy; - @Test(expected = IllegalArgumentException.class) public void testCreateInstanceWithEmptyExpressionFails() throws Exception { strategy = new ExpressionEvaluatingCorrelationStrategy(""); @@ -80,8 +79,11 @@ public class ExpressionEvaluatingCorrelationStrategyTests { } public static class CustomCorrelator { + public Object correlate(Object o) { return o; } + } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessorTests.java index d0469b7ddf..0c35d4ea81 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,6 @@ public class ExpressionEvaluatingMessageGroupProcessorTests { private final List> messages = new ArrayList<>(); - @Before public void setup() { messages.clear(); @@ -61,7 +60,6 @@ public class ExpressionEvaluatingMessageGroupProcessorTests { } } - @Test public void testProcessAndSendWithSizeExpressionEvaluated() { when(group.getMessages()).thenReturn(messages); @@ -131,7 +129,6 @@ public class ExpressionEvaluatingMessageGroupProcessorTests { assertThat(resultMessage.getPayload()).isEqualTo(3 + 4 + 5); } - /* * sample static method invoked by SpEL */ diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/FluxAggregatorMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/FluxAggregatorMessageHandlerTests.java index 4907c88f85..c8ec685422 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/FluxAggregatorMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/FluxAggregatorMessageHandlerTests.java @@ -254,7 +254,6 @@ class FluxAggregatorMessageHandlerTests { fluxAggregatorMessageHandler.stop(); } - @Test void testCustomWindow() { QueueChannel resultChannel = new QueueChannel(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java index 11965c191e..10a81b8df6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,6 @@ public class MethodInvokingMessageGroupProcessorTests { this.messagesUpForProcessing.add(MessageBuilder.withPayload(4).build()); } - @Test public void shouldFindAnnotatedAggregatorMethod() { @@ -291,7 +290,6 @@ public class MethodInvokingMessageGroupProcessorTests { assertThat(((AbstractIntegrationMessageBuilder) result).build().getPayload()).isEqualTo(7); } - @Test public void shouldFindSimpleAggregatorMethodWithIterator() { @@ -616,14 +614,12 @@ public class MethodInvokingMessageGroupProcessorTests { assertThat(output.receive(0).getPayload()).isEqualTo("hello proxy"); } - public interface GreetingService { String sayHello(List names); } - public static class GreetingBean implements GreetingService { private String greeting = "hello"; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java index 241c3068c6..4d9579bca2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import java.util.Date; import java.util.LinkedList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.BeanFactory; import org.springframework.core.convert.ConversionFailedException; @@ -32,6 +32,9 @@ import org.springframework.messaging.Message; import org.springframework.messaging.support.GenericMessage; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; +import static org.assertj.core.api.Assertions.assertThatIllegalStateException; import static org.mockito.Mockito.mock; /** @@ -63,12 +66,13 @@ public class MethodInvokingReleaseStrategyTests { @SuppressWarnings("unused") public boolean checkCompletenessOnNonParameterizedListOfMessages(List> messages) { - assertThat(messages.size() > 0).isTrue(); + assertThat(!messages.isEmpty()).isTrue(); return messages.size() > new IntegrationMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "checkCompletenessOnNonParameterizedListOfMessages"); adapter.setBeanFactory(mock(BeanFactory.class)); @@ -82,12 +86,13 @@ public class MethodInvokingReleaseStrategyTests { @SuppressWarnings("unused") public boolean checkCompletenessOnListOfMessagesParametrizedWithWildcard(List> messages) { - assertThat(messages.size() > 0).isTrue(); + assertThat(!messages.isEmpty()).isTrue(); return messages.size() > new IntegrationMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "checkCompletenessOnListOfMessagesParametrizedWithWildcard"); adapter.setBeanFactory(mock(BeanFactory.class)); @@ -101,12 +106,13 @@ public class MethodInvokingReleaseStrategyTests { @SuppressWarnings("unused") public boolean checkCompletenessOnListOfMessagesParametrizedWithString(List> messages) { - assertThat(messages.size() > 0).isTrue(); + assertThat(!messages.isEmpty()).isTrue(); return messages.size() > new IntegrationMessageHeaderAccessor(messages.iterator().next()) .getSequenceSize(); } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "checkCompletenessOnListOfMessagesParametrizedWithString"); adapter.setBeanFactory(mock(BeanFactory.class)); @@ -130,6 +136,7 @@ public class MethodInvokingReleaseStrategyTests { } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "checkCompletenessOnListOfStrings"); adapter.setBeanFactory(mock(BeanFactory.class)); @@ -153,6 +160,7 @@ public class MethodInvokingReleaseStrategyTests { } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "checkCompletenessOnListOfStrings"); adapter.setBeanFactory(mock(BeanFactory.class)); @@ -160,15 +168,18 @@ public class MethodInvokingReleaseStrategyTests { assertThat(adapter.canRelease(messages)).isTrue(); } - @Test(expected = IllegalStateException.class) + @Test public void testAdapterWithWrongMethodName() { class TestReleaseStrategy { } - new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "methodThatDoesNotExist"); + + assertThatIllegalStateException() + .isThrownBy(() -> + new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "methodThatDoesNotExist")); } - @Test(expected = IllegalStateException.class) + @Test public void testInvalidParameterTypeUsingMethodName() { class TestReleaseStrategy { @@ -178,14 +189,15 @@ public class MethodInvokingReleaseStrategyTests { } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "invalidParameterType"); adapter.setBeanFactory(mock(BeanFactory.class)); MessageGroup messages = createListOfMessages(3); - assertThat(adapter.canRelease(messages)).isTrue(); + assertThatIllegalStateException().isThrownBy(() -> adapter.canRelease(messages)); } - @Test(expected = IllegalStateException.class) + @Test public void testTooManyParametersUsingMethodName() { class TestReleaseStrategy { @@ -195,7 +207,9 @@ public class MethodInvokingReleaseStrategyTests { } } - new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "tooManyParameters"); + + assertThatIllegalStateException() + .isThrownBy(() -> new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "tooManyParameters")); } @Test @@ -208,6 +222,7 @@ public class MethodInvokingReleaseStrategyTests { } } + new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "notEnoughParameters"); } @@ -221,6 +236,7 @@ public class MethodInvokingReleaseStrategyTests { } } + new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), TestReleaseStrategy.class.getMethod( "notEnoughParameters")); } @@ -235,6 +251,7 @@ public class MethodInvokingReleaseStrategyTests { } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "listSubclassParameter"); adapter.setBeanFactory(mock(BeanFactory.class)); @@ -242,7 +259,7 @@ public class MethodInvokingReleaseStrategyTests { assertThat(adapter.canRelease(messages)).isTrue(); } - @Test(expected = ConversionFailedException.class) + @Test public void testWrongReturnType() throws SecurityException, NoSuchMethodError { class TestReleaseStrategy { @@ -252,15 +269,17 @@ public class MethodInvokingReleaseStrategyTests { } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), "wrongReturnType"); adapter.setBeanFactory(mock(BeanFactory.class)); MessageGroup messages = createListOfMessages(3); - assertThat(adapter.canRelease(messages)).isTrue(); + assertThatExceptionOfType(ConversionFailedException.class) + .isThrownBy(() -> adapter.canRelease(messages)); } - @Test(expected = IllegalArgumentException.class) - public void testTooManyParametersUsingMethodObject() throws SecurityException, NoSuchMethodException { + @Test + public void testTooManyParametersUsingMethodObject() throws SecurityException { class TestReleaseStrategy { @SuppressWarnings("unused") @@ -269,8 +288,10 @@ public class MethodInvokingReleaseStrategyTests { } } - new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), TestReleaseStrategy.class.getMethod( - "tooManyParameters", List.class, List.class)); + + assertThatIllegalArgumentException().isThrownBy(() -> + new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), + TestReleaseStrategy.class.getMethod("tooManyParameters", List.class, List.class))); } @Test @@ -283,6 +304,7 @@ public class MethodInvokingReleaseStrategyTests { } } + MethodInvokingReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), TestReleaseStrategy.class.getMethod("listSubclassParameter", LinkedList.class)); adapter.setBeanFactory(mock(BeanFactory.class)); @@ -290,7 +312,7 @@ public class MethodInvokingReleaseStrategyTests { assertThat(adapter.canRelease(messages)).isTrue(); } - @Test(expected = IllegalStateException.class) + @Test public void testWrongReturnTypeUsingMethodObject() throws SecurityException, NoSuchMethodException { class TestReleaseStrategy { @@ -305,7 +327,9 @@ public class MethodInvokingReleaseStrategyTests { new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), TestReleaseStrategy.class.getMethod( "wrongReturnType", List.class)); wrongReturnType.setBeanFactory(mock(BeanFactory.class)); - wrongReturnType.canRelease(mock(MessageGroup.class)); + + assertThatIllegalStateException() + .isThrownBy(() -> wrongReturnType.canRelease(mock(MessageGroup.class))); } private static MessageGroup createListOfMessages(int size) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java index a8bc3274e6..dcd3ef5b34 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java @@ -61,7 +61,6 @@ public class DefaultMessageAggregatorIntegrationTests { .containsAll(Arrays.asList(0, 1, 2, 3, 4)); } - private static Message prepareSequenceMessage(int sequenceNumber, int sequenceSize, int correlationId) { return MessageBuilder.withPayload(sequenceNumber) .setSequenceNumber(sequenceNumber) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/MethodInvokingAggregatorReturningMessageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/MethodInvokingAggregatorReturningMessageTests.java index 8add898c44..8d23f207c3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/MethodInvokingAggregatorReturningMessageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/MethodInvokingAggregatorReturningMessageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,6 @@ public class MethodInvokingAggregatorReturningMessageTests { @Autowired PollableChannel defaultOutput; - @Test // INT-1107 public void messageReturningPojoAggregatorResultIsNotWrappedInAnotherMessage() { List payload = Collections.singletonList("test"); @@ -69,7 +68,6 @@ public class MethodInvokingAggregatorReturningMessageTests { assertThat(Message.class.isAssignableFrom(result.getPayload().getClass())).isFalse(); } - @SuppressWarnings("unused") private static class TestAggregator { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregationResendTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregationResendTests.java index 208498ec62..6dbefdeca3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregationResendTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregationResendTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class AggregationResendTests { @Autowired QueueChannel reply; - /** * We expect to get back only one Message from the aggregator. We set an * explicit timeout value of 1 second on the aggregator. What we'll see is diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorReplyChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorReplyChannelTests.java index cbc4de8731..34b2a9d4e3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorReplyChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorReplyChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,14 +51,12 @@ public class AggregatorReplyChannelTests { private final List list = new ArrayList<>(); - @Before public void setupList() { this.list.add("foo"); this.list.add("bar"); } - @Test public void replyChannelHeader() { verifyReply(MessageBuilder.withPayload(list).setReplyChannel(output).build()); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorWithCustomReleaseStrategyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorWithCustomReleaseStrategyTests.java index 1eef6a32a9..1092cc861c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorWithCustomReleaseStrategyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/AggregatorWithCustomReleaseStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat; @DirtiesContext public class AggregatorWithCustomReleaseStrategyTests { - @Autowired private ExecutorService executor; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/AnnotationConfigRegistrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/AnnotationConfigRegistrationTests.java index 9bcdddbc29..989e822ef9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/AnnotationConfigRegistrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/AnnotationConfigRegistrationTests.java @@ -49,7 +49,6 @@ public class AnnotationConfigRegistrationTests { @Autowired private QueueChannel defaultChannel; - @Test // INT-1200 public void verifyInterception() { String name = this.testBean.setName("John", "Doe", 123); @@ -70,7 +69,6 @@ public class AnnotationConfigRegistrationTests { assertThat(message.getPayload()).isEqualTo("HELLO!!!"); } - public static class TestBean { @Publisher(channel = "annotationConfigRegistrationTest") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingAnnotationUsageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingAnnotationUsageTests.java index ec2a517587..8fee5a8624 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingAnnotationUsageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingAnnotationUsageTests.java @@ -16,7 +16,6 @@ package org.springframework.integration.aop; - import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -47,7 +46,6 @@ public class MessagePublishingAnnotationUsageTests { @Autowired private QueueChannel channel; - @Test public void headerWithExplicitName() { String name = this.testBean.defaultPayload("John", "Doe"); @@ -79,7 +77,6 @@ public class MessagePublishingAnnotationUsageTests { assertThat(message.getHeaders().get("lname")).isEqualTo("Doe"); } - public static class TestBean { @Publisher(channel = "messagePublishingAnnotationUsageTestChannel") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java index f15efc2077..0b8f61dfff 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java @@ -102,14 +102,12 @@ public class MessagePublishingInterceptorTests { assertThat(message.getHeaders().get("name")).isEqualTo("oleg"); } - interface TestBean { String test(); } - static class TestBeanImpl implements TestBean { @Override @@ -119,7 +117,6 @@ public class MessagePublishingInterceptorTests { } - private static class TestPublisherMetadataSource implements PublisherMetadataSource { TestPublisherMetadataSource() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorUsageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorUsageTests.java index 444c58ca6a..5d1a13d8f3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorUsageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorUsageTests.java @@ -16,7 +16,6 @@ package org.springframework.integration.aop; - import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -54,7 +53,6 @@ public class MessagePublishingInterceptorUsageTests { assertThat(message.getHeaders().get("foo")).isEqualTo("bar"); } - public static class TestBean { public String setName(String fname, String lname) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java index 0b44559c18..0b1ec5f841 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java @@ -44,7 +44,6 @@ public class PublisherExpressionTests { private final StaticApplicationContext context = new StaticApplicationContext(); - @BeforeEach public void setup() throws Exception { this.context.registerSingleton("testChannel", QueueChannel.class); @@ -78,14 +77,12 @@ public class PublisherExpressionTests { assertThat(message.getHeaders().get("foo")).isEqualTo("123"); } - interface TestBean { String test(String sku); } - static class TestBeanImpl implements TestBean { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java index 8388f97f5a..8e8de36635 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java @@ -237,7 +237,6 @@ public class ApplicationContextMessageBusTests { assertThat(latch.await(1, TimeUnit.SECONDS)).isTrue(); } - private record FailingSource(CountDownLatch latch) implements MessageSource { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java index 803ce4c7ad..31f1a75b77 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,6 @@ public class DirectChannelSubscriptionTests { private final PollableChannel targetChannel = new QueueChannel(); - @BeforeEach public void setupChannels() { new IntegrationRegistrar().registerBeanDefinitions(mock(), this.context.getDefaultListableBeanFactory()); @@ -65,7 +64,6 @@ public class DirectChannelSubscriptionTests { this.context.close(); } - @Test public void sendAndReceiveForRegisteredEndpoint() { ServiceActivatingHandler serviceActivator = new ServiceActivatingHandler(new TestBean(), "handle"); @@ -116,7 +114,6 @@ public class DirectChannelSubscriptionTests { .isThrownBy(() -> this.sourceChannel.send(new GenericMessage<>("foo"))); } - static class TestBean { public Message handle(Message message) { @@ -125,7 +122,6 @@ public class DirectChannelSubscriptionTests { } - @MessageEndpoint public static class TestEndpoint { @@ -136,7 +132,6 @@ public class DirectChannelSubscriptionTests { } - @MessageEndpoint public static class FailingTestEndpoint { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java index 9bffead120..416fe247dc 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,6 +92,7 @@ public class DatatypeChannelTests { QueueChannel channel = createChannel(Integer.class); GenericConversionService conversionService = new DefaultConversionService(); conversionService.addConverter(new Converter() { + @Override public Integer convert(Boolean source) { return source ? 1 : 0; @@ -108,6 +109,7 @@ public class DatatypeChannelTests { public void conversionServiceBeanUsedByDefault() { GenericApplicationContext context = new GenericApplicationContext(); Converter converter = new Converter() { + @Override public Integer convert(Boolean source) { return source ? 1 : 0; @@ -141,6 +143,7 @@ public class DatatypeChannelTests { public void conversionServiceReferenceOverridesDefault() { GenericApplicationContext context = new GenericApplicationContext(); Converter defaultConverter = new Converter() { + @Override public Integer convert(Boolean source) { return source ? 1 : 0; @@ -148,6 +151,7 @@ public class DatatypeChannelTests { }; GenericConversionService customConversionService = new DefaultConversionService(); customConversionService.addConverter(new Converter() { + @Override public Integer convert(Boolean source) { return source ? 99 : -99; @@ -218,7 +222,6 @@ public class DatatypeChannelTests { assertThat(out.getPayload()).isInstanceOf(Baz.class); } - private static QueueChannel createChannel(Class... datatypes) { QueueChannel channel = new QueueChannel(); channel.setBeanName("testChannel"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/DirectChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/DirectChannelTests.java index 2075efe129..278168e46b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/DirectChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/DirectChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -204,14 +204,12 @@ class DirectChannelTests { parentContext.close(); } - private static class ThreadNameExtractingTestTarget implements MessageHandler { private String threadName; private final CountDownLatch latch; - ThreadNameExtractingTestTarget() { this(null); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java index a35ce5dcb7..faeb785415 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,6 @@ public class DispatchingChannelErrorHandlingTests { context.close(); } - private void waitForLatch(long timeout) { try { this.latch.await(timeout, TimeUnit.MILLISECONDS); @@ -128,7 +127,6 @@ public class DispatchingChannelErrorHandlingTests { } } - private class ResultHandler implements MessageHandler { private volatile Message lastMessage; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java index b760e7a0d2..5b380824d3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -229,7 +229,6 @@ public class ExecutorChannelTests { } } - private static class TestHandler implements MessageHandler { private final CountDownLatch latch; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/IntegrationReactiveUtilsTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/IntegrationReactiveUtilsTests.java index 922b561feb..323ace7beb 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/IntegrationReactiveUtilsTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/IntegrationReactiveUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,7 +127,6 @@ class IntegrationReactiveUtilsTests { assertThat(publisherSubscribed.await(10, TimeUnit.SECONDS)).isTrue(); } - @Test void testRetryOnMessagingExceptionOnly() { AtomicInteger retryAttempts = new AtomicInteger(3); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/MixedDispatcherConfigurationScenarioTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/MixedDispatcherConfigurationScenarioTests.java index 3ef7afb118..1b40e2e037 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/MixedDispatcherConfigurationScenarioTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/MixedDispatcherConfigurationScenarioTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,7 +157,6 @@ public class MixedDispatcherConfigurationScenarioTests { throw e; }).when(handlerA).handleMessage(message); - Runnable messageSenderTask = () -> { try { start.await(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/P2pChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/P2pChannelTests.java index 4747582456..41482f2de9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/P2pChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/P2pChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,4 +127,5 @@ public class P2pChannelTests { channel.subscribe(mock(MessageHandler.class)); verify(logger, times(2)).info(Mockito.anyString()); } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/PartitionedChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/PartitionedChannelTests.java index 23e773c6ad..e286b51c28 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/PartitionedChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/PartitionedChannelTests.java @@ -104,7 +104,6 @@ public class PartitionedChannelTests { .isEqualTo(messagesInPartition.get(1).getHeaders().get("partitionKey")); }); - HashSet allocatedPartitions = new HashSet<>(partitionedMessages.keySet()); partitionedMessages.clear(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java index ee4eaba22a..6c5ba5cf6e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/PriorityChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -128,7 +128,6 @@ public class PriorityChannelTests { Message message7 = MessageBuilder.withPayload(7).setHeader("foo", 4).build(); Message message8 = MessageBuilder.withPayload(8).setHeader("foo", 4).build(); - channel.send(message1); channel.send(message2); channel.send(message3); @@ -284,12 +283,10 @@ public class PriorityChannelTests { assertThat(message2.getPayload()).isEqualTo("test-2"); } - private static Message createPriorityMessage(int priority) { return MessageBuilder.withPayload("test:" + priority).setPriority(priority).build(); } - public static class StringPayloadComparator implements Comparator> { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/TestChannelResolver.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/TestChannelResolver.java index de3745292d..7b300bbaec 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/TestChannelResolver.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/TestChannelResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ public class TestChannelResolver implements DestinationResolver private volatile Map channels = new ConcurrentHashMap(); - public MessageChannel resolveDestination(String channelName) { return this.channels.get(channelName); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java index 96df941151..35e1343022 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ChannelInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class ChannelInterceptorTests { private final QueueChannel channel = new QueueChannel(); - @Test public void testPreSendInterceptorReturnsMessage() { PreSendReturnsMessageInterceptor interceptor = new PreSendReturnsMessageInterceptor(); @@ -289,6 +288,7 @@ public class ChannelInterceptorTests { } public static class PreSendReturnsMessageInterceptor implements ChannelInterceptor { + private String foo; private static AtomicInteger counter = new AtomicInteger(); @@ -322,7 +322,6 @@ public class ChannelInterceptorTests { } - private static class PreSendReturnsNullInterceptor implements ChannelInterceptor { private static AtomicInteger counter = new AtomicInteger(); @@ -341,6 +340,7 @@ public class ChannelInterceptorTests { counter.incrementAndGet(); return null; } + } private static class AfterCompletionTestInterceptor implements ChannelInterceptor { @@ -425,7 +425,6 @@ public class ChannelInterceptorTests { } - private static class PreReceiveReturnsFalseInterceptor implements ChannelInterceptor { private static AtomicInteger counter = new AtomicInteger(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorTests.java index aed74f9932..45f7c71140 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public class GlobalChannelInterceptorTests { @Qualifier("inputC") InterceptableChannel inputCChannel; - @Test public void validateGlobalInterceptor() { Map channels = applicationContext.getBeansOfType(InterceptableChannel.class); @@ -193,7 +192,6 @@ public class GlobalChannelInterceptorTests { } - public static class SampleOrderedInterceptor extends SampleInterceptor implements Ordered { private int order; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalWireTapTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalWireTapTests.java index 8f4a3fa811..44174c27b1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalWireTapTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/GlobalWireTapTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat; @DirtiesContext public class GlobalWireTapTests { - @Autowired @Qualifier("channel") DirectChannel channel; @@ -52,7 +51,6 @@ public class GlobalWireTapTests { @Qualifier("random-channel") MessageChannel anotherChannel; - @Autowired @Qualifier("wiretap-single") PollableChannel wiretapSingle; @@ -65,7 +63,6 @@ public class GlobalWireTapTests { @Qualifier("wiretap-all2") PollableChannel wiretapAll2; - @Test public void testWireTapsOnTargetedChannel() { Message message = new GenericMessage("hello"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java index df6d69f09b..9304abf944 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,20 +88,17 @@ public class MessageSelectingInterceptorTests { assertThat(counter.get()).isEqualTo(2); } - private static class TestMessageSelector implements MessageSelector { private final boolean shouldAccept; private final AtomicInteger counter; - TestMessageSelector(boolean shouldAccept, AtomicInteger counter) { this.shouldAccept = shouldAccept; this.counter = counter; } - public boolean accept(Message message) { this.counter.incrementAndGet(); return this.shouldAccept; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptorTests.java index 5d48a0271a..b92d7b07d9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ public class ThreadStatePropagationChannelInterceptorTests { List propagatedContexts = new ArrayList<>(); var interceptor1 = new ThreadStatePropagationChannelInterceptor() { + @Override protected TestContext1 obtainPropagatingContext(Message message, MessageChannel channel) { return ctx1; @@ -60,6 +61,7 @@ public class ThreadStatePropagationChannelInterceptorTests { }; var interceptor2 = new ThreadStatePropagationChannelInterceptor() { + @Override protected TestContext2 obtainPropagatingContext(Message message, MessageChannel channel) { return ctx2; @@ -87,9 +89,11 @@ public class ThreadStatePropagationChannelInterceptorTests { } private record TestContext1() { + } private record TestContext2() { + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/reactive/ReactiveStreamsConsumerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/reactive/ReactiveStreamsConsumerTests.java index d9108cf84a..f688da4790 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/reactive/ReactiveStreamsConsumerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/reactive/ReactiveStreamsConsumerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,6 @@ public class ReactiveStreamsConsumerTests { testChannel.destroy(); } - @Test public void testReactiveStreamsConsumerDirectChannel() throws InterruptedException { DirectChannel testChannel = new DirectChannel(); @@ -218,7 +217,6 @@ public class ReactiveStreamsConsumerTests { reactiveConsumer.stop(); - testChannel.send(testMessage); reactiveConsumer.start(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/registry/HeaderChannelRegistryTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/registry/HeaderChannelRegistryTests.java index bbc89ae923..502bbd79dd 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/registry/HeaderChannelRegistryTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/registry/HeaderChannelRegistryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -249,7 +249,6 @@ public class HeaderChannelRegistryTests { assertThat(map.size()).isEqualTo(0); } - public static class Foo extends AbstractReplyProducingMessageHandler { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java index 616214c2fd..b9475fa0f3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ public class CompositeCodecTests { private Codec codec; - @Before public void setup() { Map, Codec> codecs = new HashMap<>(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/FileKryoRegistrarTests.java b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/FileKryoRegistrarTests.java index aff90ff38b..4ee5832b51 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/FileKryoRegistrarTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/FileKryoRegistrarTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; - /** * @author David Turanski * @since 4.2 diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java index 3932af7347..26e14b4fe7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,6 @@ public class AggregatorWithMessageStoreParserTests { .getPayload()).as("The aggregated message payload is not correct").isEqualTo("123456789"); } - @Test @DirtiesContext public void testExpiry() { @@ -87,7 +86,6 @@ public class AggregatorWithMessageStoreParserTests { .getPayload()).as("The aggregated message payload is not correct").isEqualTo("123456"); } - private static Message createMessage(T payload, Object correlationId, int sequenceSize, int sequenceNumber, MessageChannel outputChannel) { return MessageBuilder.withPayload(payload) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java index 6c442fee9a..50550fd1dd 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -509,7 +509,6 @@ public class ChainParserTests { public static class FooPojo { - private String bar; public String getBar() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/FilterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/FilterParserTests.java index 265ef495d1..c93a19b23a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/FilterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/FilterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,7 +166,6 @@ public class FilterParserTests { throw exception; } - public static class TestSelectorBean { public boolean hasText(String s) { @@ -175,7 +174,6 @@ public class FilterParserTests { } - public static class TestSelectorImpl implements MessageSelector { public boolean accept(Message message) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/MaxValueReleaseStrategy.java b/spring-integration-core/src/test/java/org/springframework/integration/config/MaxValueReleaseStrategy.java index 4c3372b6da..c2d5f82725 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/MaxValueReleaseStrategy.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/MaxValueReleaseStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ public class MaxValueReleaseStrategy { private long maxValue; - public MaxValueReleaseStrategy(long maxValue) { this.maxValue = maxValue; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java index 9458489f88..9702ad7102 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,7 +73,6 @@ public class ResequencerWithMessageStoreParserTests { } - private static Message createMessage(T payload, Object correlationId, int sequenceSize, int sequenceNumber, MessageChannel outputChannel) { return MessageBuilder.withPayload(payload) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/RouterFactoryBeanDelegationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/RouterFactoryBeanDelegationTests.java index beab4095ed..937f36a195 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/RouterFactoryBeanDelegationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/RouterFactoryBeanDelegationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class RouterFactoryBeanDelegationTests { @Qualifier("org.springframework.integration.config.RouterFactoryBean#0") private AbstractMappingMessageRouter router; - @Test public void checkResolutionRequiredConfiguredOnTargetRouter() { @SuppressWarnings("unchecked") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/SelectorChainParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/SelectorChainParserTests.java index dec79d7382..a479cc2241 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/SelectorChainParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/SelectorChainParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,7 +94,6 @@ public class SelectorChainParserTests { assertThat(chain4.accept(new GenericMessage<>("test4"))).isTrue(); } - @SuppressWarnings("unchecked") private List getSelectors(MessageSelectorChain chain) { DirectFieldAccessor accessor = new DirectFieldAccessor(chain); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java index 6dcdf7f542..b0b5c1c96f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,6 @@ public class ServiceActivatorAnnotationPostProcessorTests { } } - public static class AbstractServiceActivatorAnnotationTestBean { private final CountDownLatch latch; @@ -81,7 +80,6 @@ public class ServiceActivatorAnnotationPostProcessorTests { } - @MessageEndpoint public static class SimpleServiceActivatorAnnotationTestBean extends AbstractServiceActivatorAnnotationTestBean { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java index e25dac5fd9..34ca1a7cad 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java @@ -267,7 +267,6 @@ public class SourcePollingChannelAdapterFactoryBeanTests { taskScheduler.destroy(); } - private static class LifecycleMessageSource implements MessageSource, Lifecycle { private volatile boolean running; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/StubMessageSelector.java b/spring-integration-core/src/test/java/org/springframework/integration/config/StubMessageSelector.java index 614f191529..e5dc582481 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/StubMessageSelector.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/StubMessageSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ public class StubMessageSelector implements MessageSelector, BeanNameAware { private String beanName; - public void setBeanName(String beanName) { this.beanName = beanName; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/StubTaskScheduler.java b/spring-integration-core/src/test/java/org/springframework/integration/config/StubTaskScheduler.java index 8caed29947..7fee4e7b7b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/StubTaskScheduler.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/StubTaskScheduler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ import org.springframework.scheduling.Trigger; */ public class StubTaskScheduler implements TaskScheduler { - @Override public ScheduledFuture schedule(Runnable task, Trigger trigger) { return null; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAfterAdvice.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAfterAdvice.java index 71d51d6afe..886ba71a54 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAfterAdvice.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAfterAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,12 +30,10 @@ public class TestAfterAdvice implements AfterReturningAdvice { private volatile long latchCount; - public TestAfterAdvice(CountDownLatch latch) { this.latch = latch; } - public long getLatchCount() { return this.latchCount; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java index f4ad39c40c..c38dc8a00e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ public class TestAggregatorBean { private final ConcurrentMap> aggregatedMessages = new ConcurrentHashMap>(); - @Aggregator public Message createSingleMessageFromGroup(List> messages) { List> sortableList = new ArrayList<>(messages); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAroundAdvice.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAroundAdvice.java index ff734fdcfe..bf6e02772c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAroundAdvice.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAroundAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,12 +32,10 @@ public class TestAroundAdvice implements MethodInterceptor { private volatile long postCount; - public TestAroundAdvice(CountDownLatch latch) { this.latch = latch; } - public long getPreCount() { return this.preCount; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestBean.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestBean.java index 1f9c5f7ed1..ad30f0f3d0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestBean.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ public class TestBean { private String replyMessageText = null; - public TestBean() { this(1); } @@ -38,7 +37,6 @@ public class TestBean { this.latch = new CountDownLatch(countdown); } - public void setReplyMessageText(String replyMessageText) { this.replyMessageText = replyMessageText; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestBeforeAdvice.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestBeforeAdvice.java index bb2b307943..e8b2af2686 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestBeforeAdvice.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestBeforeAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,12 +30,10 @@ public class TestBeforeAdvice implements MethodBeforeAdvice { private volatile long latchCount; - public TestBeforeAdvice(CountDownLatch latch) { this.latch = latch; } - public long getLatchCount() { return this.latchCount; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java index 4acfa9b767..dbdf3b9365 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestChannelInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ public class TestChannelInterceptor implements ChannelInterceptor { private final AtomicInteger receiveCount = new AtomicInteger(); - @Override public Message preSend(Message message, MessageChannel channel) { sendCount.incrementAndGet(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestConsumer.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestConsumer.java index 1091c9c475..c5090d771d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestConsumer.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ public class TestConsumer implements MessageHandler { private volatile Message lastMessage; - public Message getLastMessage() { return this.lastMessage; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestErrorHandler.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestErrorHandler.java index e76458cdd8..ee296d5856 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestErrorHandler.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ public class TestErrorHandler implements ErrorHandler { private volatile Throwable lastError; - public void handleError(Throwable t) { this.lastError = t; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java index 32aec1f207..92ea26de9b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ public class TestHandler { private String replyMessageText = null; - public TestHandler() { this(1); } @@ -42,7 +41,6 @@ public class TestHandler { this.latch = new CountDownLatch(countdown); } - public void setReplyMessageText(String replyMessageText) { this.replyMessageText = replyMessageText; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestReleaseStrategy.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestReleaseStrategy.java index 52dc95032f..33b01671aa 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestReleaseStrategy.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestReleaseStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.config; - import org.springframework.integration.aggregator.ReleaseStrategy; import org.springframework.integration.store.MessageGroup; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/BridgeFromIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/BridgeFromIntegrationTests.java index b35dce4754..0981a39356 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/BridgeFromIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/BridgeFromIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2022 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,6 @@ public class BridgeFromIntegrationTests { assertThat(receive.getPayload()).isEqualTo("hello world"); } - @Configuration @EnableIntegration @ComponentScan( @@ -83,13 +82,11 @@ public class BridgeFromIntegrationTests { return new DirectChannel(); } - @Bean public DirectChannel gatewayChannel() { return new DirectChannel(); } - @Bean public PollableChannel outputChannel() { return new QueueChannel(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java index 98161684b7..c52ec28897 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -189,7 +189,6 @@ public class FilterAnnotationPostProcessorTests { postProcessor.postProcessAfterInitialization(new TestFilterWithVoidReturnType(), "testFilter")); } - private void testValidFilter(Object filter) { context.registerEndpoint("testFilter", filter); context.refresh(); @@ -201,7 +200,6 @@ public class FilterAnnotationPostProcessorTests { context.stop(); } - @MessageEndpoint public static class TestFilterWithBooleanPrimitive { @@ -253,7 +251,6 @@ public class FilterAnnotationPostProcessorTests { } - @MessageEndpoint public static class TestFilterWithStringReturnType { @@ -264,7 +261,6 @@ public class FilterAnnotationPostProcessorTests { } - @MessageEndpoint public static class TestFilterWithVoidReturnType { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorAopIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorAopIntegrationTests.java index 6bb51d681a..ff166b0674 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorAopIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorAopIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class MessagingAnnotationPostProcessorAopIntegrationTests { @Autowired private PollableChannel output; - @Test public void parseConfig() { assertThat(this.input).isNotNull(); @@ -66,7 +65,6 @@ public class MessagingAnnotationPostProcessorAopIntegrationTests { assertThat(((Integer) reply.getPayload()).intValue()).isEqualTo(111); } - @Aspect public static class HandlerAspect { @@ -77,7 +75,6 @@ public class MessagingAnnotationPostProcessorAopIntegrationTests { } - @Aspect public static class ServiceAspect { @@ -88,7 +85,6 @@ public class MessagingAnnotationPostProcessorAopIntegrationTests { } - @MessageEndpoint public static class AnnotatedService { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java index 94123ddcb5..322af14ae2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -301,7 +301,6 @@ public class MessagingAnnotationPostProcessorTests { private final CountDownLatch latch; - OutboundOnlyTestBean(CountDownLatch latch) { this.latch = latch; } @@ -318,12 +317,10 @@ public class MessagingAnnotationPostProcessorTests { } - public static class SimpleAnnotatedEndpointSubclass extends AnnotatedTestService { } - @MessageEndpoint public interface SimpleAnnotatedEndpointInterface { @@ -331,7 +328,6 @@ public class MessagingAnnotationPostProcessorTests { } - public static class SimpleAnnotatedEndpointImplementation implements SimpleAnnotatedEndpointInterface { @Override @@ -342,7 +338,6 @@ public class MessagingAnnotationPostProcessorTests { } - @MessageEndpoint public static class ServiceActivatorAnnotatedBean { @@ -364,7 +359,6 @@ public class MessagingAnnotationPostProcessorTests { } - @MessageEndpoint public static class TransformerAnnotationTestBean { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java index 71ad8049ad..aead19c763 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java @@ -433,7 +433,6 @@ public class MessagingAnnotationsWithBeanAnnotationTests { return () -> new GenericMessage<>("foo"); } - @Bean @Transformer(inputChannel = "functionServiceChannel") public Function functionAsService() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java index 7c7716a5d6..7286b8287d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,6 @@ public class RouterAnnotationPostProcessorTests { private final QueueChannel stringChannel = new QueueChannel(); - @BeforeEach public void init() { new IntegrationRegistrar().registerBeanDefinitions(mock(), this.context.getDefaultListableBeanFactory()); @@ -96,7 +95,6 @@ public class RouterAnnotationPostProcessorTests { context.stop(); } - @MessageEndpoint public static class TestRouter { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java index 56cfd7bfbf..c86f2e0a3b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class SplitterAnnotationPostProcessorTests { private final QueueChannel outputChannel = new QueueChannel(); - @BeforeEach public void init() { new IntegrationRegistrar().registerBeanDefinitions(mock(), this.context.getDefaultListableBeanFactory()); @@ -91,7 +90,6 @@ public class SplitterAnnotationPostProcessorTests { context.stop(); } - @MessageEndpoint public static class TestSplitter implements Lifecycle { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java index 1266d3d9cb..0bb97a6f74 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -143,7 +143,6 @@ public class SubscriberOrderTests { } } - abstract static class AbstractTestBean { @Order(4) @@ -154,7 +153,6 @@ public class SubscriberOrderTests { } - @MessageEndpoint static class TestBean extends AbstractTestBean { @@ -162,12 +160,10 @@ public class SubscriberOrderTests { private final List calls = new ArrayList<>(); - TestBean(int maxCallsPerMethod) { this.maxCallsPerMethod = maxCallsPerMethod; } - void reset() { this.calls.clear(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/BridgeParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/BridgeParserTests.java index 57098dcfc9..8e4c404c0c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/BridgeParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/BridgeParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,6 @@ public class BridgeParserTests extends AbstractJUnit4SpringContextTests { @Autowired private EventDrivenConsumer bridgeWithSendTimeout; - @Test public void pollableChannel() { Message message = new GenericMessage<>("test1"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChainElementsFailureTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChainElementsFailureTests.java index bc1fa3e2b6..474ee88754 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChainElementsFailureTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChainElementsFailureTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ import org.springframework.core.io.InputStreamResource; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; - /** * @author Oleg Zhurakousky * @author Gunnar Hillert @@ -284,8 +283,11 @@ public class ChainElementsFailureTests { } public static class SampleService { + public String echo(String value) { return value; } + } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChannelAutoCreationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChannelAutoCreationTests.java index f46a82cbf2..11763d3f49 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChannelAutoCreationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ChannelAutoCreationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,4 +49,5 @@ public class ChannelAutoCreationTests { new ClassPathXmlApplicationContext("TestDisableChannelAutoCreation-before-context.xml", this.getClass()) .close(); } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ClaimCheckParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ClaimCheckParserTests.java index a2f6c9cdf4..f1d487e626 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ClaimCheckParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ClaimCheckParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,6 @@ public class ClaimCheckParserTests { @Autowired private MessageStore sampleMessageStore; - @Test public void checkMessageStoreReferenceOnCheckIn() { ClaimCheckInTransformer transformer = (ClaimCheckInTransformer) new DirectFieldAccessor( diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConstructorAutowireTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConstructorAutowireTests.java index 569855b79f..690becd8df 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConstructorAutowireTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConstructorAutowireTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,13 +37,13 @@ public class ConstructorAutowireTests { public void testApplicationContextCreation() { } - public static class TestService { + public String getVal() { return "fooble"; } - } + } public static class TestEndpoint { @@ -65,6 +65,7 @@ public class ConstructorAutowireTests { public List aSplitter(List strs) { return strs; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ContextHierarchyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ContextHierarchyTests.java index f089a12dc1..e1759080e6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ContextHierarchyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ContextHierarchyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ public class ContextHierarchyTests { private ApplicationContext childContext; - @Before public void setupContext() { String prefix = "/org/springframework/integration/config/xml/ContextHierarchyTests-"; @@ -43,7 +42,6 @@ public class ContextHierarchyTests { new String[] {prefix + "child.xml"}, parentContext); } - @Test // INT-646 public void inputChannelInParentContext() { Object parentInput = parentContext.getBean("input"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusChainTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusChainTests.java index 002f055a32..b7e94e1a7b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusChainTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusChainTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ public class ControlBusChainTests { assertThat(output.receive(0)).isNull(); } - public static class Service { @ManagedOperation diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusExplicitPollerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusExplicitPollerTests.java index cd57331bef..08c2c19b6c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusExplicitPollerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusExplicitPollerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,6 @@ public class ControlBusExplicitPollerTests { assertThat(output.receive(0)).isNull(); } - public static class Service { @ManagedOperation diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusRecipientListRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusRecipientListRouterTests.java index 997478f166..ebcf3291db 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusRecipientListRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusRecipientListRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -162,4 +162,5 @@ public class ControlBusRecipientListRouterTests { PollableChannel chanel7 = (PollableChannel) context.getBean("channel7"); assertThat(chanel7.receive(0).getPayload().equals(1)).isTrue(); } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java index 95db0925ac..031471320d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Oleg Zhurakousky * @author Artem Bilan @@ -65,7 +64,6 @@ public class ConverterParserTests { @Qualifier("ROUTER_TARGET_CHANNEL") private PollableChannel routerTargetChannel; - @Test public void serviceActivator() { QueueChannel replyChannel = new QueueChannel(); @@ -142,7 +140,6 @@ public class ConverterParserTests { assertThat(((TestBean1) result.getPayload()).text).isEqualTo("router-test"); } - @SuppressWarnings("unused") public static class TestService { @@ -170,7 +167,6 @@ public class ConverterParserTests { } - public static class TestBean2 { private String text; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java index 8ba9421b2d..42f6862e2d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Oleg Zhurakousky * @author Artem Bilan @@ -83,7 +82,6 @@ public class ConverterParserWithExistingConversionServiceTests { parentContext.close(); } - private static class TestBean1 { private final String text; @@ -95,7 +93,6 @@ public class ConverterParserWithExistingConversionServiceTests { } - private static class TestBean2 { private final String text; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests.java index e9e9a4a773..8137ad9dd6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests.java @@ -16,7 +16,6 @@ package org.springframework.integration.config.xml; - import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -49,7 +48,6 @@ public class DefaultConfiguringBeanFactoryPostProcessorTests { @Autowired private ApplicationContext context; - @Test public void errorChannelRegistered() { Object errorChannel = context.getBean(IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultOutboundChannelAdapterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultOutboundChannelAdapterParserTests.java index 7f0b6f1504..fa6667e1a3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultOutboundChannelAdapterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DefaultOutboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,7 +96,6 @@ public class DefaultOutboundChannelAdapterParserTests { assertThat(targetObject.getClass()).isEqualTo(TestConsumer.class); } - static class TestBean { public void out(Object o) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DelayerUsageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DelayerUsageTests.java index e5b7b80d28..aa81d9601f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DelayerUsageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DelayerUsageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,6 @@ public class DelayerUsageTests { @Autowired private PollableChannel outputC; - @Test public void testDelayWithDefaultSchedulerAndTransactionSynchronization() { long start = System.currentTimeMillis(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDefaultConfigurationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDefaultConfigurationTests.java index 646d934808..42de443b62 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDefaultConfigurationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDefaultConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.config.xml; - import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDontOverrideDefaultTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDontOverrideDefaultTests.java index 5e5c0d36be..486cc6d6bc 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDontOverrideDefaultTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/DispatcherMaxSubscribersDontOverrideDefaultTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.config.xml; - import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests3.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests3.java index 58846801b9..63ed99c62b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests3.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests3.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,6 +86,7 @@ public class EnricherParserTests3 { } public class Nested { + private String value; public void setValue(String value) { @@ -95,7 +96,9 @@ public class EnricherParserTests3 { public String getValue() { return value; } + } } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java index 8458c3bbf3..a47ad9d913 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,6 +58,7 @@ public class EnricherParserTests4 { protected Object handleRequestMessage(Message requestMessage) { return null; } + } NullFoo foo = new NullFoo(); @@ -85,7 +86,6 @@ public class EnricherParserTests4 { requests.unsubscribe(foo); } - public static class Target implements Cloneable { private volatile String name; @@ -137,6 +137,7 @@ public class EnricherParserTests4 { copy.setMarried(this.married); return copy; } + } public enum Gender { @@ -152,4 +153,5 @@ public class EnricherParserTests4 { } } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests5.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests5.java index ee7ffa71b8..8a5c1accac 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests5.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests5.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,24 +45,27 @@ public class EnricherParserTests5 { @Autowired private ApplicationContext context; - @Test public void errorChannelTest() { class ErrorThrower extends AbstractReplyProducingMessageHandler { + @Override protected Object handleRequestMessage(Message requestMessage) { throw new RuntimeException(); } + } class DefaultTargetProducer extends AbstractReplyProducingMessageHandler { + @Override protected Object handleRequestMessage(Message requestMessage) { final Target defaultTarget = new Target(); defaultTarget.setName("Default"); return defaultTarget; } + } context.getBean("requestChannel", DirectChannel.class).subscribe(new ErrorThrower()); @@ -79,7 +82,6 @@ public class EnricherParserTests5 { assertThat(enriched.getName()).isEqualTo("Mr. Default"); } - public static class Target { private volatile String name; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTestsWithoutRequestChannel.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTestsWithoutRequestChannel.java index 0558a09d96..596254cd03 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTestsWithoutRequestChannel.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTestsWithoutRequestChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ public class EnricherParserTestsWithoutRequestChannel { @Autowired private ApplicationContext context; - @Test @SuppressWarnings("unchecked") public void configurationCheck() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserWithRequestPayloadExpressionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserWithRequestPayloadExpressionTests.java index 28ce07d694..4b2d450c72 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserWithRequestPayloadExpressionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserWithRequestPayloadExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,6 @@ public class EnricherParserWithRequestPayloadExpressionTests { @Autowired private ApplicationContext context; - @Test @SuppressWarnings("unchecked") public void configurationCheck() { @@ -115,7 +114,6 @@ public class EnricherParserWithRequestPayloadExpressionTests { assertThat(enriched).isSameAs(original); } - private static class Source { private final String sourceName; @@ -131,7 +129,6 @@ public class EnricherParserWithRequestPayloadExpressionTests { } - public static class Target implements Cloneable { private volatile String name; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java index 25e28b1428..98a4f21f90 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java @@ -429,7 +429,6 @@ public class GatewayParserTests { }); } - @SuppressWarnings("unused") private static class TestExecutor extends SimpleAsyncTaskExecutor implements BeanNameAware { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherMethodInvokingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherMethodInvokingTests.java index 0a429e28db..0eca379443 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherMethodInvokingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherMethodInvokingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public class HeaderEnricherMethodInvokingTests { @Autowired private ApplicationContext context; - @Test public void replyChannelExplicitOverwriteTrue() { MessageChannel inputChannel = context.getBean("input", MessageChannel.class); @@ -62,7 +61,6 @@ public class HeaderEnricherMethodInvokingTests { assertThat(result.getHeaders().get("other")).isEqualTo("zzz"); } - public static class TestBean { public String echo(String text) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java index 88f3e69a2d..e713e94b3c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class HeaderEnricherOverwriteTests { @Autowired private ApplicationContext context; - @Test public void replyChannelExplicitOverwriteTrue() { MessageChannel inputChannel = @@ -313,7 +312,6 @@ public class HeaderEnricherOverwriteTests { assertThat(result.getHeaders().get("foo")).isEqualTo("ABC"); } - public static class TestBean { private final String text; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherParserTests.java index 0b0fa1e157..d142b077d6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,6 @@ class HeaderEnricherParserTests { @Autowired private ApplicationContext context; - @Test void sendTimeoutDefault() { Object endpoint = context.getBean("headerEnricherWithDefaults"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java index 1acb273565..ebfad485a1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -278,7 +278,6 @@ public class HeaderEnricherTests { assertThat(routingSlipPath.get(3)).isEqualTo("bazRoutingSlip"); } - public static class TestBean { private final String name; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterExpressionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterExpressionTests.java index fa68c91f3a..7e57810931 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterExpressionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,6 @@ public class InboundChannelAdapterExpressionTests { @Autowired private ApplicationContext context; - @Test public void fixedDelay() { SourcePollingChannelAdapter adapter = diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterWithDefaultPollerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterWithDefaultPollerTests.java index 6be5dd642e..37596617c7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterWithDefaultPollerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InboundChannelAdapterWithDefaultPollerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class InboundChannelAdapterWithDefaultPollerTests { @Autowired private SourcePollingChannelAdapter adapter; - @Test public void verifyDefaultPollerInUse() { Trigger trigger = TestUtils.getPropertyValue(adapter, "trigger", Trigger.class); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerBeanConfigTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerBeanConfigTests.java index 0ddcddc79a..9c5d9216cb 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerBeanConfigTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerBeanConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public class InnerBeanConfigTests { @Autowired private ApplicationContext context; - // INT-1528: the inner bean should not be registered in the context @Test(expected = NoSuchBeanDefinitionException.class) public void checkInnerBean() { @@ -51,11 +50,12 @@ public class InnerBeanConfigTests { context.getBean(TestBean.class); } - public static class TestBean { + public String echo(String value) { return value; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/LoggingChannelAdapterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/LoggingChannelAdapterParserTests.java index 8747bfd277..f30a0c1e36 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/LoggingChannelAdapterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/LoggingChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ public class LoggingChannelAdapterParserTests { @Qualifier("loggerWithExpression.adapter") private EventDrivenConsumer loggerWithExpression; - @Test public void verifyConfig() { LoggingHandler loggingHandler = TestUtils.getPropertyValue(loggerConsumer, "handler", LoggingHandler.class); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MapToObjectTransformerParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MapToObjectTransformerParserTests.java index 00f9522dc1..0ad28fa615 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MapToObjectTransformerParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MapToObjectTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Oleg Zhurakousky * @since 2.0 @@ -44,6 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat; @ContextConfiguration @RunWith(SpringJUnit4ClassRunner.class) public class MapToObjectTransformerParserTests { + @Autowired @Qualifier("input") private MessageChannel input; @@ -106,7 +106,6 @@ public class MapToObjectTransformerParserTests { assertThat(person.getAddress().getStreet()).isEqualTo("1123 Main st"); } - @SuppressWarnings({"unchecked", "rawtypes"}) @Test public void testMapToObjectTransformationWithConversionService() { @@ -134,6 +133,7 @@ public class MapToObjectTransformerParserTests { } public static class Person { + private String fname; private String lname; @@ -173,9 +173,11 @@ public class MapToObjectTransformerParserTests { public void setAddress(Address address) { this.address = address; } + } public static class Address { + private String street; public String getStreet() { @@ -185,9 +187,11 @@ public class MapToObjectTransformerParserTests { public void setStreet(String street) { this.street = street; } + } public static class StringToAddressConverter implements Converter { + public StringToAddressConverter() { } @@ -197,5 +201,7 @@ public class MapToObjectTransformerParserTests { address.setStreet(source); return address; } + } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MethodInvokingSelectorParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MethodInvokingSelectorParserTests.java index 9d0911ab61..3f3c68bd83 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MethodInvokingSelectorParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/MethodInvokingSelectorParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,6 @@ public class MethodInvokingSelectorParserTests { @Autowired private MessageSelectorChain chain; - @SuppressWarnings("unchecked") @Test public void configOK() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/NestedChainParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/NestedChainParserTests.java index fc8bbe3058..7e5a7c1fa1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/NestedChainParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/NestedChainParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,6 @@ public class NestedChainParserTests { assertThat(handler2).isNotSameAs(handler1); } - static class ParentTestBean { private MessageHandlerChain chain; @@ -77,7 +76,6 @@ public class NestedChainParserTests { } - static class ChildTestBean { public String echo(String s) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToMapTransformerParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToMapTransformerParserTests.java index 334fcc2ab8..62403e9964 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToMapTransformerParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToMapTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,6 @@ public class ObjectToMapTransformerParserTests { @Qualifier("nestedOutput") private PollableChannel nestedOutput; - @SuppressWarnings("unchecked") @Test public void testObjectToSpelMapTransformer() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToStringTransformerParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToStringTransformerParserTests.java index 00474a802b..130138a492 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToStringTransformerParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ObjectToStringTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,6 +104,7 @@ public class ObjectToStringTransformerParserTests { public String toString() { return "test"; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/OrderedHandlersTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/OrderedHandlersTests.java index 9fde976703..a8e837b9f8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/OrderedHandlersTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/OrderedHandlersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class OrderedHandlersTests { @Autowired private ApplicationContext context; - @Test public void verifyOrder() { for (int i = 1; i < 14; i++) { @@ -50,7 +49,6 @@ public class OrderedHandlersTests { } } - static class TestBean { public Object handle(Object o) { @@ -60,6 +58,7 @@ public class OrderedHandlersTests { public boolean filter() { return true; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java index 04d517a9c1..1cbe6662e8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,6 @@ public class PNamespaceTests { @Qualifier("sampleChain") EventDrivenConsumer sampleChain; - @Test public void testPNamespaceServiceActivator() { TestBean bean = prepare(serviceActivator); @@ -100,20 +99,17 @@ public class PNamespaceTests { assertThat(aggregator.getName()).isEqualTo("Bill"); } - private TestBean prepare(EventDrivenConsumer edc) { return TestUtils.getPropertyValue(serviceActivator, "handler.processor.delegate.targetObject", TestBean.class); } - public interface InboundGateway { String echo(); } - public static class TestBean { private String fname; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadDeserializingTransformerParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadDeserializingTransformerParserTests.java index b4faec55b8..62937b065d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadDeserializingTransformerParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadDeserializingTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,6 @@ public class PayloadDeserializingTransformerParserTests { @Qualifier("direct.handler") private MessageHandler handler; - @Test public void directChannelWithSerializedStringMessage() throws Exception { byte[] bytes = serialize("foo"); @@ -127,7 +126,6 @@ public class PayloadDeserializingTransformerParserTests { assertThat(result.getPayload()).isEqualTo("TEST"); } - private static byte[] serialize(Object object) throws Exception { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); ObjectOutputStream objectStream = new ObjectOutputStream(byteStream); @@ -135,7 +133,6 @@ public class PayloadDeserializingTransformerParserTests { return byteStream.toByteArray(); } - @SuppressWarnings("serial") private static class TestBean implements Serializable { @@ -147,7 +144,6 @@ public class PayloadDeserializingTransformerParserTests { } - public static class TestDeserializer implements Deserializer { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadSerializingTransformerParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadSerializingTransformerParserTests.java index a22b43032e..340c4aaecc 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadSerializingTransformerParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PayloadSerializingTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public class PayloadSerializingTransformerParserTests { @Autowired private PollableChannel output; - @Test public void directChannelWithStringMessage() throws Exception { directInput.send(new GenericMessage("foo")); @@ -113,14 +112,12 @@ public class PayloadSerializingTransformerParserTests { assertThat(new String((byte[]) result.getPayload(), "UTF-8")).isEqualTo("TEST"); } - private static Object deserialize(byte[] bytes) throws Exception { ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes); ObjectInputStream objectStream = new ObjectInputStream(byteStream); return objectStream.readObject(); } - @SuppressWarnings("serial") private static class TestBean implements Serializable { @@ -132,7 +129,6 @@ public class PayloadSerializingTransformerParserTests { } - public static class TestSerializer implements Serializer { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PublishingInterceptorParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PublishingInterceptorParserTests.java index 14af861863..4b0c361426 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PublishingInterceptorParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PublishingInterceptorParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class PublishingInterceptorParserTests { @Autowired private SubscribableChannel echoChannel; - @Test public void validateDefaultChannelPublishing() { MessageHandler handler = Mockito.mock(MessageHandler.class); @@ -91,7 +90,6 @@ public class PublishingInterceptorParserTests { defaultTestBean.echo("hello"); } - public static class TestBean { public String echo(String str) { @@ -108,7 +106,6 @@ public class PublishingInterceptorParserTests { } - public static class DefaultTestBean { public String echo(String str) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java index f4b111cbd5..528a458a34 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -221,7 +221,6 @@ public class ServiceActivatorParserTests { return template.convertSendAndReceive(payload, Object.class); } - @SuppressWarnings("unused") private static class TestBean { @@ -239,7 +238,6 @@ public class ServiceActivatorParserTests { } - @SuppressWarnings("unused") private static class TestPayload { @@ -253,7 +251,6 @@ public class ServiceActivatorParserTests { } - @SuppressWarnings("unused") private static class TestPerson { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/TestAdviceBean.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/TestAdviceBean.java index 4165f5a4b7..022061042b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/TestAdviceBean.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/TestAdviceBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,12 +27,10 @@ public class TestAdviceBean implements MethodBeforeAdvice { private final int id; - public TestAdviceBean(int id) { this.id = id; } - public int getId() { return this.id; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java index 3c40621079..93c0fbda84 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -732,7 +732,6 @@ public class EnableIntegrationTests { consumeLatch.countDown(); }); - assertThat(consumeLatch.await(0, TimeUnit.SECONDS)).isTrue(); // runs on same thread List integers = ref.get(); @@ -901,7 +900,6 @@ public class EnableIntegrationTests { return new QueueChannel(); } - @Bean @GlobalChannelInterceptor(patterns = "${global.wireTap.pattern}") public WireTap wireTap() { @@ -949,7 +947,6 @@ public class EnableIntegrationTests { return new QueueChannel(); } - @Bean @BridgeFrom(value = "pollableBridgeInput", poller = @Poller) @EndpointId("pollableBridge") @@ -1745,7 +1742,6 @@ public class EnableIntegrationTests { // defaultHeaders = @GatewayHeader(name = "foo", value = "FOO")) // public static class TestGateway2 { } - public static class TestSpelFunction { public static Object bar(Object o) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/core/AsyncMessagingTemplateTests.java b/spring-integration-core/src/test/java/org/springframework/integration/core/AsyncMessagingTemplateTests.java index 217d6db882..f23af0aeb4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/core/AsyncMessagingTemplateTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/core/AsyncMessagingTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -431,7 +431,6 @@ public class AsyncMessagingTemplateTests { await().until(() -> handler.interrupted); } - private static void sendMessageAfterDelay(MessageChannel channel, GenericMessage message, int delay) { Executors.newSingleThreadExecutor() .execute(() -> { @@ -479,7 +478,6 @@ public class AsyncMessagingTemplateTests { } - private static class TestMessagePostProcessor implements MessagePostProcessor { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/core/MessageHistoryTests.java b/spring-integration-core/src/test/java/org/springframework/integration/core/MessageHistoryTests.java index f5de05e838..69108eadda 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/core/MessageHistoryTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/core/MessageHistoryTests.java @@ -128,7 +128,6 @@ public class MessageHistoryTests { assertThat(history2.toString()).isEqualTo("testComponent-1,testComponent-2"); } - private record TestComponent(int id) implements NamedComponent { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/core/MessageIdGenerationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/core/MessageIdGenerationTests.java index a15b3129d0..5ee10182aa 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/core/MessageIdGenerationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/core/MessageIdGenerationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,7 +141,6 @@ public class MessageIdGenerationTests { assertThat(TestUtils.getPropertyValue(new MessageHeaders(null), "idGenerator")).isNull(); } - public static class SampleIdGenerator implements IdGenerator { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java b/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java index f4f41d9343..323b973655 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.net.NetworkInterface; import java.util.UUID; import java.util.logging.Logger; - /** * @author Oleg Zhurakousky * @author Artem Bilan @@ -66,7 +65,6 @@ class TimeBasedUUIDGenerator { } } - time = currentTimeMillis; // low Time diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryExceptionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryExceptionTests.java index 3a4b9c9be2..c9f68ec896 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryExceptionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryExceptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public class AggregateMessageDeliveryExceptionTests { private MessageDeliveryException firstProblem; - private List exceptionsList() { firstProblem = new MessageDeliveryException(message, "first problem"); return Arrays.asList(firstProblem, new MessageDeliveryException(message, "second problem"), diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java index 26406ed4c5..45b28be7cc 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java @@ -64,7 +64,6 @@ public class BroadcastingDispatcherTests { private final MessageHandler targetMock3 = Mockito.mock(); - @BeforeEach public void init() { Mockito.reset(taskExecutorMock, messageMock, taskExecutorMock, targetMock1, targetMock2, targetMock3); @@ -72,7 +71,6 @@ public class BroadcastingDispatcherTests { defaultTaskExecutorMock(); } - @Test public void singleTargetWithoutTaskExecutor() { dispatcher = new BroadcastingDispatcher(); @@ -344,7 +342,6 @@ public class BroadcastingDispatcherTests { }).when(taskExecutorMock).execute(Mockito.any(Runnable.class)); } - private static class MessageStoringTestEndpoint implements MessageHandler { private final List> messageList; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/FailOverDispatcherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/FailOverDispatcherTests.java index 4db091f569..c55102bc8a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/FailOverDispatcherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/FailOverDispatcherTests.java @@ -194,7 +194,6 @@ public class FailOverDispatcherTests { return handler; } - private static class CountingTestEndpoint implements MessageHandler { private final AtomicInteger counter; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherConcurrentTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherConcurrentTests.java index c71ba9bb7d..ce178e44d9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherConcurrentTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherConcurrentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; - /** * @author Iwein Fuld * @author Artem Bilan diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherTests.java index 26aed31ff4..8ad78e5938 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/RoundRobinDispatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,6 @@ public class RoundRobinDispatcherTests { this.dispatcher.setLoadBalancingStrategy(new RoundRobinLoadBalancingStrategy()); } - @Test public void dispatchMessageWithSingleHandler() { this.dispatcher.addHandler(this.handler); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/TransactionalPollerWithMixedAopConfigTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/TransactionalPollerWithMixedAopConfigTests.java index 91866e1738..d0d6cffdca 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/TransactionalPollerWithMixedAopConfigTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/TransactionalPollerWithMixedAopConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,13 +45,17 @@ public class TransactionalPollerWithMixedAopConfigTests { } public static class SampleService { + public void foo(String payload) { } + } public static class Foo { + public Foo(String value) { } + } // public static class SampleAdvice implements MethodInterceptor{ diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/LambdaMessageProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/LambdaMessageProcessorTests.java index 84700eb808..df1027b244 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/LambdaMessageProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/LambdaMessageProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - /** * @author Gary Russell * @author Artem Bilan @@ -104,7 +103,6 @@ public class LambdaMessageProcessorTests { assertThat(result).isEqualTo(Boolean.TRUE); } - @Test public void testCustomConverter() { LambdaMessageProcessor lmp = new LambdaMessageProcessor(Function.identity(), TestPojo.class); @@ -124,7 +122,6 @@ public class LambdaMessageProcessorTests { return message; } - @Configuration @EnableIntegration public static class TestConfiguration { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/correlation/CorrelationHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/correlation/CorrelationHandlerTests.java index 534c448bd5..4796f3296a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/correlation/CorrelationHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/correlation/CorrelationHandlerTests.java @@ -73,7 +73,6 @@ public class CorrelationHandlerTests { @Qualifier("splitResequenceFlow.input") private MessageChannel splitInput; - @Autowired private MessageChannel splitAggregateInput; @@ -146,7 +145,6 @@ public class CorrelationHandlerTests { assertThat(receive.getHeaders().get("foo")).isEqualTo("bar"); } - @Test public void testBarrier() { Message releasing = MessageBuilder.withPayload("bar").setHeader(BARRIER, "foo").build(); @@ -250,7 +248,6 @@ public class CorrelationHandlerTests { .headerFilter(headerFilterSpec -> headerFilterSpec.headersToRemove("foo").patternMatch(false)); } - @Bean public IntegrationFlow splitAggregateFlow() { return IntegrationFlow.from("splitAggregateInput", true) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/flows/IntegrationFlowTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/flows/IntegrationFlowTests.java index a86b101150..0e57f95fe7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/flows/IntegrationFlowTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/flows/IntegrationFlowTests.java @@ -470,7 +470,6 @@ public class IntegrationFlowTests { this.flowWithLocalNullChannelInput.send(new GenericMessage<>("foo")); } - @Autowired private EventDrivenConsumer flow1WithPrototypeHandlerConsumer; @@ -543,13 +542,11 @@ public class IntegrationFlowTests { assertThat(controlBus.isRunning()).isTrue(); } - @AfterEach public void cleanUpList() { outputStringList.clear(); } - @MessagingGateway public interface ControlBusGateway { @@ -592,7 +589,6 @@ public class IntegrationFlowTests { return threadPoolTaskScheduler; } - @Bean public QueueChannelSpec suppliedChannel() { return MessageChannels.queue(10); @@ -664,7 +660,6 @@ public class IntegrationFlowTests { @Qualifier("successChannel") private PollableChannel successChannel; - @Bean public Advice expressionAdvice() { ExpressionEvaluatingRequestHandlerAdvice advice = new ExpressionEvaluatingRequestHandlerAdvice(); @@ -924,7 +919,6 @@ public class IntegrationFlowTests { .get(); } - @Bean public TaskScheduler dedicatedTaskScheduler() { ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); @@ -1046,7 +1040,6 @@ public class IntegrationFlowTests { } - private static class InvalidLastMessageChannelFlowContext { @Bean diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/flowservices/FlowServiceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/flowservices/FlowServiceTests.java index 247a5e6c46..04a99f3b94 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/flowservices/FlowServiceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/flowservices/FlowServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,6 @@ public class FlowServiceTests { assertThat(receive.getPayload()).isEqualTo("bar:FOO"); } - @Autowired @Qualifier("testGateway.input") private MessageChannel testGatewayInput; @@ -229,7 +228,6 @@ public class FlowServiceTests { return payload.toLowerCase(); } - @CorrelationStrategy public Integer correlationKey() { return 1; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/gateway/GatewayDslTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/gateway/GatewayDslTests.java index 87995cbae9..4598c9439f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/gateway/GatewayDslTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/gateway/GatewayDslTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -196,7 +196,6 @@ public class GatewayDslTests { return new QueueChannel(); } - @Bean public IntegrationFlow nestedGatewayErrorPropagationFlow(TaskExecutor taskExecutor) { return f -> f diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java index 646eb01ffc..9879a52de7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/manualflow/ManualFlowTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -142,7 +142,6 @@ public class ManualFlowTests { IntegrationFlowRegistration flowRegistration = this.integrationFlowContext.registration(flow).register(); assertThat(started.get()).isTrue(); - Set replyProducers = TestUtils.getPropertyValue(flowBuilder, "REFERENCED_REPLY_PRODUCERS", Set.class); @@ -165,6 +164,7 @@ public class ManualFlowTests { } } + class MyProducerSpec extends MessageProducerSpec { MyProducerSpec(MyProducer producer) { @@ -172,6 +172,7 @@ public class ManualFlowTests { } } + MyProducerSpec spec = new MyProducerSpec(new MyProducer()); QueueChannel channel = new QueueChannel(); IntegrationFlow flow = IntegrationFlow.from(spec.id("fooChannel")) @@ -292,7 +293,6 @@ public class ManualFlowTests { flowRegistration.destroy(); } - @Test public void testWrongIntegrationFlowScope() { assertThatExceptionOfType(BeanCreationNotAllowedException.class) @@ -324,7 +324,6 @@ public class ManualFlowTests { } - PollableChannel resultChannel = new QueueChannel(); IntegrationFlowRegistration flowRegistration = @@ -484,7 +483,6 @@ public class ManualFlowTests { flowRegistrations.forEach(IntegrationFlowRegistration::destroy); } - @Test public void testDisabledBeansOverride() { assertThatExceptionOfType(BeanCreationException.class) @@ -530,7 +528,6 @@ public class ManualFlowTests { return new Date(); } - @Bean public MessageChannel doNotOverrideChannel() { return new DirectChannel(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/reactivestreams/ReactiveStreamsTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/reactivestreams/ReactiveStreamsTests.java index 20617e3acd..ee98ade390 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/reactivestreams/ReactiveStreamsTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/reactivestreams/ReactiveStreamsTests.java @@ -60,7 +60,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Artem Bilan * @author Gary Russell diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/routers/RouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/routers/RouterTests.java index abf7ba0fc9..a49840276e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/routers/RouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/routers/RouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,6 @@ public class RouterTests { @Qualifier("evenChannel") private PollableChannel evenChannel; - @Test public void testRouter() { this.beanFactory.containsBean("routeFlow.subFlow#0.channel#0"); @@ -148,7 +147,6 @@ public class RouterTests { assertThat(receive.getPayload()).isEqualTo("BAZ"); } - @Autowired @Qualifier("routeSubflowWithoutReplyToMainFlow.input") private MessageChannel routeSubflowWithoutReplyToMainFlowInput; @@ -181,7 +179,6 @@ public class RouterTests { @Qualifier("bar-channel") private PollableChannel barChannel; - @Autowired @Qualifier("recipientListSubFlow1Result") private PollableChannel recipientListSubFlow1Result; @@ -477,7 +474,6 @@ public class RouterTests { assertThat(((List) payload).size()).isGreaterThanOrEqualTo(1); } - @Autowired @Qualifier("exceptionTypeRouteFlow.input") private MessageChannel exceptionTypeRouteFlowInput; @@ -579,7 +575,6 @@ public class RouterTests { @Qualifier("scatterGatherInSubFlow.input") MessageChannel scatterGatherInSubFlowChannel; - @Test public void testNestedScatterGatherSuccess() { PollableChannel replyChannel = new QueueChannel(); @@ -891,7 +886,6 @@ public class RouterTests { .collect(Collectors.joining("\n"))); } - @Bean public IntegrationFlow scatterGatherAndExecutorChannelSubFlow(TaskExecutor taskExecutor) { return f -> f @@ -914,7 +908,6 @@ public class RouterTests { .build(); } - @Bean public IntegrationFlow propagateErrorFromGatherer(TaskExecutor taskExecutor) { return IntegrationFlow.from(Function.class) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dsl/transformers/TransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dsl/transformers/TransformerTests.java index 5b86c9e3c2..268578d5a7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dsl/transformers/TransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dsl/transformers/TransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,6 @@ public class TransformerTests { @Qualifier("enricherErrorChannel") private PollableChannel enricherErrorChannel; - @Test public void testContentEnricher() { QueueChannel replyChannel = new QueueChannel(); @@ -200,7 +199,6 @@ public class TransformerTests { assertThat(receive.getPayload()).isEqualTo(42); } - @Autowired @Qualifier("pojoTransformFlow.input") private MessageChannel pojoTransformFlowInput; @@ -222,7 +220,6 @@ public class TransformerTests { assertThat(receive).isNotNull(); assertThat(receive.getPayload()).isEqualTo("FooBar"); - assertThatExceptionOfType(MessageRejectedException.class) .isThrownBy(() -> this.pojoTransformFlowInput.send(message)) .withMessageContaining("IdempotentReceiver") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java index 754f7a0fde..ff6d779246 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,6 +166,7 @@ public class CorrelationIdTests { public Message createMessage(String input) { return MessageBuilder.withPayload(input).setCorrelationId("456-XYZ").build(); } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceIntegrationTests.java index d6806fd1c4..f8d6bf01d0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceIntegrationTests.java @@ -96,7 +96,6 @@ public class ExpressionEvaluatingMessageSourceIntegrationTests { assertThat(message3.getHeaders().get("bar")).isEqualTo(42); } - public static int next() { return counter.incrementAndGet(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceTests.java index ef4cb722e3..86128f074a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import static org.mockito.Mockito.mock; */ public class ExpressionEvaluatingMessageSourceTests { - @Test public void literalExpression() { Expression expression = new LiteralExpression("foo"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java index 7825f366d7..478ad7accd 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -134,13 +134,12 @@ public class PollerAdviceTests { } } + CountDownLatch latch = new CountDownLatch(1); adapter.setSource(new LocalSource(latch)); adapter.setTrigger(new OnlyOnceTrigger()); AtomicBoolean ehCalled = new AtomicBoolean(); - adapter.setErrorHandler(t -> { - ehCalled.set(true); - }); + adapter.setErrorHandler(t -> ehCalled.set(true)); configure(adapter); List adviceChain = new ArrayList<>(); SimplePollSkipStrategy skipper = new SimplePollSkipStrategy(); @@ -211,6 +210,7 @@ public class PollerAdviceTests { } } + adviceChain.add(new TestSourceAdvice()); adapter.setAdviceChain(adviceChain); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java index 4e311e25e3..3a8b17c09b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,6 @@ public class PollingConsumerEndpointTests { private PollableChannel channelMock; - @Before public void init() { this.channelMock = mock(PollableChannel.class); @@ -82,7 +81,6 @@ public class PollingConsumerEndpointTests { taskScheduler.destroy(); } - @Test public void singleMessage() { Mockito.when(this.channelMock.receive()).thenReturn(this.message); @@ -169,7 +167,6 @@ public class PollingConsumerEndpointTests { assertThat(this.consumer.counter.get()).isEqualTo(1); } - private static class TestConsumer implements MessageHandler { private volatile AtomicInteger counter = new AtomicInteger(); @@ -185,8 +182,8 @@ public class PollingConsumerEndpointTests { throw new MessageRejectedException(message, "intentional test failure"); } } - } + } private static class TestErrorHandler implements ErrorHandler { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingLifecycleTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingLifecycleTests.java index f5ee4eca7e..cc8a49c637 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingLifecycleTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingLifecycleTests.java @@ -228,7 +228,8 @@ public class PollingLifecycleTests { var context = new AnnotationConfigApplicationContext(); context.register(TestDefaultAnnotationConfiguration.class); - PollingConsumer consumer = new PollingConsumer(new QueueChannel(), (m) -> { }); + PollingConsumer consumer = new PollingConsumer(new QueueChannel(), (m) -> { + }); consumer.setTrigger(new PeriodicTrigger(Duration.ofSeconds(10))); consumer.setReceiveTimeout(30_000); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ProducerAndConsumerAutoStartupTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ProducerAndConsumerAutoStartupTests.java index bc6184859a..054162439b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ProducerAndConsumerAutoStartupTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ProducerAndConsumerAutoStartupTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ public class ProducerAndConsumerAutoStartupTests { @Autowired private Consumer consumer; - @Test public void test() throws Exception { List received = new ArrayList<>(); @@ -63,7 +62,6 @@ public class ProducerAndConsumerAutoStartupTests { assertThat(received.get(2)).isEqualTo(3); } - static class Counter { private final AtomicInteger count = new AtomicInteger(); @@ -78,7 +76,6 @@ public class ProducerAndConsumerAutoStartupTests { } - static class Consumer { private final BlockingQueue numbers = new LinkedBlockingQueue<>(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PseudoTransactionalMessageSourceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PseudoTransactionalMessageSourceTests.java index 1f134d4f97..735ef5f9f2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PseudoTransactionalMessageSourceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PseudoTransactionalMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -155,7 +155,6 @@ public class PseudoTransactionalMessageSourceTests { ctx.close(); } - @Test public void testRollback() { SourcePollingChannelAdapter adapter = new SourcePollingChannelAdapter(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java index 182900ae15..99375d2be2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -236,7 +236,6 @@ public class ServiceActivatorEndpointTests { assertThat(beanFactory).isSameAs(mock); } - private ServiceActivatingHandler createEndpoint() { ServiceActivatingHandler handler = new ServiceActivatingHandler(new TestBean(), "handle"); handler.setBeanFactory(mock(BeanFactory.class)); @@ -244,7 +243,6 @@ public class ServiceActivatorEndpointTests { return handler; } - private static class TestBean { @SuppressWarnings("unused") @@ -254,7 +252,6 @@ public class ServiceActivatorEndpointTests { } - private static class TestNullReplyBean { @SuppressWarnings("unused") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorMethodResolutionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorMethodResolutionTests.java index e9365b5397..b28ebf5908 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorMethodResolutionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorMethodResolutionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,6 @@ public class ServiceActivatorMethodResolutionTests { new ServiceActivatingHandler(testBean); } - @Test public void testRequestReplyExchanger() { RequestReplyExchanger testBean = request -> request; @@ -258,7 +257,6 @@ public class ServiceActivatorMethodResolutionTests { assertThat(result.getPayload()).isEqualTo("gotNull"); } - @SuppressWarnings("unused") private static class SingleAnnotationTestBean { @@ -277,7 +275,6 @@ public class ServiceActivatorMethodResolutionTests { } - private static class MultipleAnnotationTestBean { MultipleAnnotationTestBean() { @@ -296,7 +293,6 @@ public class ServiceActivatorMethodResolutionTests { } - @SuppressWarnings("unused") private static class SinglePublicMethodTestBean { @@ -314,7 +310,6 @@ public class ServiceActivatorMethodResolutionTests { } - @SuppressWarnings("unused") private static class MultiplePublicMethodTestBean { @@ -332,7 +327,6 @@ public class ServiceActivatorMethodResolutionTests { } - @SuppressWarnings("unused") private static class NullOkTestBean { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/expression/DynamicExpressionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/expression/DynamicExpressionTests.java index e583c78ea2..aa8f5ff6c8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/expression/DynamicExpressionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/expression/DynamicExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,13 +37,11 @@ public class DynamicExpressionTests { private static final String filepath = basename + ".properties"; - @After public void resetFile() { writeExpressionStringToFile("'Hello World!'"); } - @Test public void expressionUpdate() throws Exception { ReloadableResourceBundleExpressionSource source = new ReloadableResourceBundleExpressionSource(); @@ -55,7 +53,6 @@ public class DynamicExpressionTests { assertThat(expression.getValue("foo")).isEqualTo("FOO"); } - private static void writeExpressionStringToFile(String expressionString) { ClassPathResource resource = new ClassPathResource(filepath); byte[] bytes = new String(key + "=" + expressionString).getBytes(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java b/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java index 2b2d859a8c..a76407add0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/expression/ExpressionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ public class ExpressionUtilsTests { assertThat(TestUtils.getPropertyValue(factory, "typeConverter")).isSameAs(evalContext.getTypeConverter()); } - @Test public void testEvaluationContextDefaultTypeConverter() { GenericApplicationContext context = new GenericApplicationContext(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/filter/DynamicExpressionFilterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/filter/DynamicExpressionFilterIntegrationTests.java index b9ec6fedb1..274e6b4b68 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/filter/DynamicExpressionFilterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/filter/DynamicExpressionFilterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public class DynamicExpressionFilterIntegrationTests { @Autowired private PollableChannel negatives; - @Test void simpleExpressionBasedFilter() { this.input.send(new GenericMessage<>(1)); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/filter/FilterAnnotationMethodResolutionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/filter/FilterAnnotationMethodResolutionTests.java index adea52363f..c5aedbb00b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/filter/FilterAnnotationMethodResolutionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/filter/FilterAnnotationMethodResolutionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,14 +54,12 @@ public class FilterAnnotationMethodResolutionTests { testApplicationContext.close(); } - public static class AnnotatedTestFilter { private volatile boolean invokedCorrectMethod; private volatile boolean invokedIncorrectMethod; - public String notThisOne(String s) { this.invokedIncorrectMethod = true; return s; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/filter/MethodInvokingSelectorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/filter/MethodInvokingSelectorTests.java index dc86c7fb56..65a1a28207 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/filter/MethodInvokingSelectorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/filter/MethodInvokingSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,7 +99,6 @@ public class MethodInvokingSelectorTests { selector.accept(new GenericMessage<>("test")); } - @SuppressWarnings("unused") private static class TestBean { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/filter/SpelFilterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/filter/SpelFilterIntegrationTests.java index 4c3ad46f4c..3cc0a44913 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/filter/SpelFilterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/filter/SpelFilterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,6 @@ public class SpelFilterIntegrationTests { @Autowired private PollableChannel odds; - @Test public void simpleExpressionBasedFilter() { this.simpleInput.send(new GenericMessage<>(1)); @@ -80,7 +79,6 @@ public class SpelFilterIntegrationTests { assertThat(evens.receive(0)).isNull(); } - @SuppressWarnings("unused") private static class TestBean { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/AsyncGatewayTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/AsyncGatewayTests.java index b19a7c8ad0..56fc565432 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/AsyncGatewayTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/AsyncGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -381,7 +381,6 @@ public class AsyncGatewayTests { }).start(); } - private interface TestEchoService { Future returnString(String s); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java index fcd5c3410d..c8c156e8e1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -721,7 +721,6 @@ public class GatewayInterfaceTests { return new BridgeHandler(); } - @Bean public GatewayProxyFactoryBean annotationGatewayProxyFactoryBean() { return new AnnotationGatewayProxyFactoryBean<>(GatewayByAnnotationGPFB.class); @@ -786,7 +785,6 @@ public class GatewayInterfaceTests { } - @MessagingGateway(defaultRequestChannel = "autoCreateChannel") @TestMessagingGateway public interface AutoCreateChannelGateway { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java index c5f3c7ea37..b027786ee1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,7 +133,6 @@ public class GatewayInvokingMessageHandlerTests { assertThat(result).isEqualTo("Error happened in message: echoWithErrorAsyncChannel"); } - public static class SampleErrorTransformer { public Message toMessage(Throwable object) { @@ -144,14 +143,12 @@ public class GatewayInvokingMessageHandlerTests { } - public interface SimpleGateway { String process(String str); } - public static class SimpleService { public String echo(String value) { @@ -172,7 +169,6 @@ public class GatewayInvokingMessageHandlerTests { } - @SuppressWarnings("serial") public static class SampleCheckedException extends Exception { @@ -182,7 +178,6 @@ public class GatewayInvokingMessageHandlerTests { } - @SuppressWarnings("serial") public static class SampleRuntimeException extends RuntimeException { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java index 96d71ad92f..3171c8885b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -295,7 +295,6 @@ public class GatewayMethodInboundMessageMapperToMessageTests { assertThat(message.getHeaders().get("2")).isEqualTo(mapB.get("2")); } - private interface TestService { void sendPayload(String payload); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java index a56ef2c4ef..70f6253252 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -387,7 +387,6 @@ public class GatewayProxyFactoryBeanTests { .isThrownBy(() -> proxy.throwCheckedException("test")); } - private static void startResponder(final PollableChannel requestChannel) { new Thread(() -> { Message input = requestChannel.receive(); @@ -520,14 +519,12 @@ public class GatewayProxyFactoryBeanTests { throw new TestException(); } - interface TestEchoService { Message echo(String s); } - interface HeadersOverwriteService { @Gateway(headers = @GatewayHeader(name = MessageHeaders.ID, value = "id")) @@ -535,7 +532,6 @@ public class GatewayProxyFactoryBeanTests { } - @Gateway @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @@ -546,7 +542,6 @@ public class GatewayProxyFactoryBeanTests { } - interface CompositedGatewayService { @CompositedGateway(requestChannelName = "requestChannel") @@ -554,14 +549,12 @@ public class GatewayProxyFactoryBeanTests { } - interface HeadersParamService { Message echo(String s, @Header(MessageHeaders.TIMESTAMP) String foo); } - interface TestExceptionThrowingInterface { String throwCheckedException(String s) throws TestException; @@ -588,7 +581,6 @@ public class GatewayProxyFactoryBeanTests { } - public static class TestClient { @SuppressWarnings("unused") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java index 3abee8d5f8..47cfb7debc 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -213,7 +213,6 @@ public class GatewayProxyMessageMappingTests { .isThrownBy(() -> this.gateway.payloadAndHeadersAnnotationsOnSameParameter(new HashMap<>())); } - public interface TestGateway { void payloadAndHeaderMapWithoutAnnotations(String s, Map map); @@ -250,7 +249,6 @@ public class GatewayProxyMessageMappingTests { } - public static class TestBean { public String exclaim(String s) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java index ff1f76814d..55fc8020db 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ public class GatewayRequiresReplyTests { @Autowired private ApplicationContext applicationContext; - @Test public void replyReceived() { TestService gateway = this.applicationContext.getBean("gateway", TestService.class); @@ -62,7 +61,6 @@ public class GatewayRequiresReplyTests { assertThat(result).isNull(); } - public interface TestService { String test(String s); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java index 08a436018f..4a6b39911f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ public class GatewayWithHeaderAnnotations { @Autowired private ApplicationContext applicationContext; - @Test // INT-1205 public void priorityAsArgument() { TestService gateway = (TestService) applicationContext.getBean("gateway"); @@ -48,8 +47,8 @@ public class GatewayWithHeaderAnnotations { assertThat(result).isEqualTo("foo99barqux"); } - public interface TestService { + // wrt INT-1205, priority no longer has a $ prefix, so here we are testing the $custom header as well String test(String str, @Header(IntegrationMessageHeaderAccessor.PRIORITY) int priority, @Header("$custom") String custom, @Header(name = "baz") String baz); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java index accb6507c2..102398cea9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,6 @@ public class GatewayWithPayloadExpressionTests { @Autowired private PollableChannel input; - @Test public void simpleExpression() { gateway.send1("foo"); @@ -74,7 +73,6 @@ public class GatewayWithPayloadExpressionTests { assertThat(result.getPayload()).isEqualTo("send3"); } - public interface SampleGateway { void send1(String value); @@ -85,7 +83,6 @@ public class GatewayWithPayloadExpressionTests { } - public interface SampleAnnotatedGateway { @Payload("args[0] + args[1]") @@ -93,7 +90,6 @@ public class GatewayWithPayloadExpressionTests { } - public static class TestBean { public int sum(String s) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java index 78dceb6cba..fcf3cf96ec 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class HeaderEnrichedGatewayTests { private Object testPayload; - @Test public void validateHeaderValueMappings() throws Exception { testPayload = "hello"; @@ -104,7 +103,6 @@ public class HeaderEnrichedGatewayTests { assertThat(message3.getHeaders().get("headerB")).isEqualTo("headerB"); } - public interface SampleGateway { void sendString(String value); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java index cb167a9534..f46d6c3cac 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Oleg Zhurakousky * @author Gunnar Hillert @@ -62,7 +61,6 @@ public class InnerGatewayWithChainTests { @Autowired private SubscribableChannel assignedErrorChannel; - @Test public void testExceptionHandledByMainGateway() { String reply = testGatewayWithErrorChannelA.echo(5); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java index dc8abbc807..563b20f0e7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ public class MultiMethodGatewayConfigTests { @Autowired private ApplicationContext applicationContext; - @Test public void validateGatewayMethods() { TestGateway gateway = this.applicationContext.getBean("myGateway", TestGateway.class); @@ -50,7 +49,6 @@ public class MultiMethodGatewayConfigTests { assertThat(parentClassName + "$TestBeanC:oleg").isEqualTo(gateway.echoViaDefault("oleg")); } - public static class TestBeanA { public String echo(String str) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/NestedGatewayTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/NestedGatewayTests.java index b569c61538..01e8666cd3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/NestedGatewayTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/NestedGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,17 +38,20 @@ public class NestedGatewayTests { DirectChannel innerChannel = new DirectChannel(); DirectChannel outerChannel = new DirectChannel(); innerChannel.subscribe(new AbstractReplyProducingMessageHandler() { + @Override protected Object handleRequestMessage(Message requestMessage) { return requestMessage.getPayload() + "-reply"; } }); final MessagingGatewaySupport innerGateway = new MessagingGatewaySupport() { + }; innerGateway.setRequestChannel(innerChannel); innerGateway.setBeanFactory(mock(BeanFactory.class)); innerGateway.afterPropertiesSet(); outerChannel.subscribe(new AbstractReplyProducingMessageHandler() { + @Override protected Object handleRequestMessage(Message requestMessage) { return innerGateway.sendAndReceiveMessage( @@ -56,6 +59,7 @@ public class NestedGatewayTests { } }); MessagingGatewaySupport outerGateway = new MessagingGatewaySupport() { + }; outerGateway.setRequestChannel(outerChannel); outerGateway.setBeanFactory(mock(BeanFactory.class)); @@ -69,12 +73,14 @@ public class NestedGatewayTests { DirectChannel requestChannel = new DirectChannel(); DirectChannel replyChannel = new DirectChannel(); requestChannel.subscribe(new AbstractReplyProducingMessageHandler() { + @Override protected Object handleRequestMessage(Message requestMessage) { return requestMessage.getPayload() + "-reply"; } }); MessagingGatewaySupport gateway = new MessagingGatewaySupport() { + }; gateway.setRequestChannel(requestChannel); gateway.setBeanFactory(mock(BeanFactory.class)); @@ -91,12 +97,14 @@ public class NestedGatewayTests { DirectChannel requestChannel = new DirectChannel(); DirectChannel errorChannel = new DirectChannel(); requestChannel.subscribe(new AbstractReplyProducingMessageHandler() { + @Override protected Object handleRequestMessage(Message requestMessage) { return requestMessage.getPayload() + "-reply"; } }); MessagingGatewaySupport gateway = new MessagingGatewaySupport() { + }; gateway.setRequestChannel(requestChannel); gateway.setBeanFactory(mock(BeanFactory.class)); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestChannelInterceptor.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestChannelInterceptor.java index 923302fbc1..a0aa964f43 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestChannelInterceptor.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestChannelInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ public class TestChannelInterceptor implements ChannelInterceptor { private final AtomicInteger receivedCount = new AtomicInteger(); - public int getSentCount() { return this.sentCount.get(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java index b3544cdda1..7ab87d237e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,6 @@ public class CustomConverterMessageProcessingTests { @Qualifier("ROUTER_TARGET_CHANNEL") private PollableChannel routerTargetChannel; - @Test public void serviceActivator() { QueueChannel replyChannel = new QueueChannel(); @@ -124,7 +123,6 @@ public class CustomConverterMessageProcessingTests { assertThat(((TestBean1) result.getPayload()).text).isEqualTo("router-test"); } - @SuppressWarnings("unused") public static class TestConverter implements Converter { @@ -134,7 +132,6 @@ public class CustomConverterMessageProcessingTests { } - @SuppressWarnings("unused") public static class TestService { @@ -148,7 +145,6 @@ public class CustomConverterMessageProcessingTests { } - public static class TestBean1 { private String text; @@ -159,7 +155,6 @@ public class CustomConverterMessageProcessingTests { } - public static class TestBean2 { private String text; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java index b6fcdef752..9b741a7c10 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -533,7 +533,6 @@ public class DelayHandlerTests { .until(() -> works.size() == 1); } - private void waitForLatch(long timeout) { try { this.latch.await(timeout, TimeUnit.MILLISECONDS); @@ -546,7 +545,6 @@ public class DelayHandlerTests { } } - private class ResultHandler implements MessageHandler { private volatile Message lastMessage; @@ -566,7 +564,6 @@ public class DelayHandlerTests { } - @SuppressWarnings("serial") private static class TestTimedOutException extends RuntimeException { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java index 080dd96607..0050dfab88 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ public class ExpressionEvaluatingMessageProcessorTests { } @Test - public void testProcessMessageWithParameterCoercion() throws Exception { + public void testProcessMessageWithParameterCoercion() { @SuppressWarnings("unused") class TestTarget { @@ -77,6 +77,7 @@ public class ExpressionEvaluatingMessageProcessorTests { } } + Expression expression = expressionParser.parseExpression("#target.stringify(payload)"); ExpressionEvaluatingMessageProcessor processor = new ExpressionEvaluatingMessageProcessor<>(expression); @@ -89,7 +90,7 @@ public class ExpressionEvaluatingMessageProcessorTests { } @Test - public void testProcessMessageWithVoidResult() throws Exception { + public void testProcessMessageWithVoidResult() { @SuppressWarnings("unused") class TestTarget { @@ -110,7 +111,7 @@ public class ExpressionEvaluatingMessageProcessorTests { } @Test - public void testProcessMessageWithParameterCoercionToNonPrimitive() throws Exception { + public void testProcessMessageWithParameterCoercionToNonPrimitive() { class TestTarget { @SuppressWarnings("unused") @@ -119,6 +120,7 @@ public class ExpressionEvaluatingMessageProcessorTests { } } + Expression expression = expressionParser.parseExpression("#target.find(payload)"); ExpressionEvaluatingMessageProcessor processor = new ExpressionEvaluatingMessageProcessor<>(expression); @@ -136,7 +138,7 @@ public class ExpressionEvaluatingMessageProcessorTests { TestUtils.getPropertyValue(processor, "evaluationContext", EvaluationContext.class); evaluationContext.setVariable("target", new TestTarget()); String result = processor.processMessage(new GenericMessage<>("classpath*:*-test.xml")); - assertThat(result.contains("log4j2-test.xml")).as("Wrong result: " + result).isTrue(); + assertThat(result).contains("log4j2-test.xml"); } @Test @@ -169,7 +171,7 @@ public class ExpressionEvaluatingMessageProcessorTests { } @Test - public void testProcessMessageWithBeanAsMethodArgument() throws Exception { + public void testProcessMessageWithBeanAsMethodArgument() { StaticApplicationContext context = new StaticApplicationContext(); BeanDefinition beanDefinition = new RootBeanDefinition(String.class); beanDefinition.getConstructorArgumentValues().addGenericArgumentValue("bar"); @@ -188,7 +190,7 @@ public class ExpressionEvaluatingMessageProcessorTests { } @Test - public void testProcessMessageWithMethodCallOnBean() throws Exception { + public void testProcessMessageWithMethodCallOnBean() { StaticApplicationContext context = new StaticApplicationContext(); BeanDefinition beanDefinition = new RootBeanDefinition(String.class); beanDefinition.getConstructorArgumentValues().addGenericArgumentValue("bar"); @@ -239,7 +241,6 @@ public class ExpressionEvaluatingMessageProcessorTests { .withCauseInstanceOf(CheckedException.class); } - @SuppressWarnings("unused") private static class TestPayload { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java index 882cdd5d12..354f27f171 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,7 +103,6 @@ public class HeaderAnnotationTransformerTests { assertThat(result.getHeaders().get("foo")).isEqualTo("bar"); } - @Test public void testNotPropagatedHeaders() { Object target = new TestTransformer(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java index 328bc95ab2..f65d2ff12a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,6 +184,7 @@ public class MessageHandlerChainTests { messageHandler.handleMessage(message); output.send(message); } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java index 4c8cd123a5..922465a740 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -369,7 +369,6 @@ public class MethodInvokingMessageProcessorAnnotationTests { assertThat(result).isEqualTo("ABC"); } - private Message getMessage() { MessageBuilder builder = MessageBuilder.withPayload(employee); builder.setHeader("day", "monday"); @@ -385,7 +384,6 @@ public class MethodInvokingMessageProcessorAnnotationTests { } - @SuppressWarnings("unused") private static class TestService { @@ -489,7 +487,6 @@ public class MethodInvokingMessageProcessorAnnotationTests { } - public static class Employee { private String fname; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java index c5377fc822..1e30379aea 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,6 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.BDDMockito.willAnswer; import static org.mockito.Mockito.mock; - /** * @author Mark Fisher * @author Marius Bogoevici @@ -886,7 +885,6 @@ public class MethodInvokingMessageProcessorTests { compilerConfigAccessor.setPropertyValue("compilerMode", SpelCompilerMode.OFF); } - @Test public void testNoSpElFallbackWhenUserException() { class A { @@ -967,7 +965,6 @@ public class MethodInvokingMessageProcessorTests { }); service = (MyHandler) proxyFactory.getProxy(getClass().getClassLoader()); - GenericMessage testMessage = new GenericMessage<>("foo"); MethodInvokingMessageProcessor processor = new MethodInvokingMessageProcessor(service, "handle"); @@ -1126,7 +1123,6 @@ public class MethodInvokingMessageProcessorTests { assertThat(result).isEqualTo("FOO"); } - @Test @Disabled("Jackson does not understand a generic argument value") public void testCollectionArgument() throws JsonProcessingException { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java index ff92c76f88..35699c5d00 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class MockHandlerTests { @Autowired private TestInterface mock; - @Test public void configOk() { QueueChannel output = new QueueChannel(); @@ -57,7 +56,6 @@ public class MockHandlerTests { assertThat(result.getPayload()).isEqualTo("bar"); } - public interface TestInterface { String test(String input); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests.java index 0301b7b91d..20636ad927 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ public class SendTimeoutConfigurationTests { @Autowired private ApplicationContext context; - @Test public void serviceActivator() { assertThat(this.getTimeout("serviceActivator")).isEqualTo(123); @@ -63,7 +62,6 @@ public class SendTimeoutConfigurationTests { assertThat(this.getTimeout("router")).isEqualTo(123); } - private long getTimeout(String endpointName) { return TestUtils.getPropertyValue(context.getBean(endpointName), "handler.messagingTemplate.sendTimeout", Long.class); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/ServiceActivatorOnMockitoMockTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/ServiceActivatorOnMockitoMockTests.java index 33d679368d..e2b6e4bb54 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/ServiceActivatorOnMockitoMockTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/ServiceActivatorOnMockitoMockTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,9 +67,11 @@ public class ServiceActivatorOnMockitoMockTests { } public static class SingleMethodOnClass { + public String move(String s) { return s; } + } @Autowired diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java index 468938d384..a585ea036d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java @@ -702,7 +702,6 @@ public class AdvisedMessageHandlerTests { assertThat(outerCounter.get()).isEqualTo(1); } - @Test public void testINT2858ExpressionAdviceWithSendFailureOnEachRetry() { final AtomicInteger counter = new AtomicInteger(0); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonInboundMessageMapperTests.java b/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonInboundMessageMapperTests.java index 434a38a7be..a3ab776018 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonInboundMessageMapperTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonInboundMessageMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -257,7 +257,6 @@ public abstract class AbstractJsonInboundMessageMapperTests { } } - private String getBeanAsJson(TestBean bean) throws Exception { return this.mapper.toJson(bean); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonSymmetricalMessageMappingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonSymmetricalMessageMappingTests.java index 0923af85a1..e39ef9a410 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonSymmetricalMessageMappingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/AbstractJsonSymmetricalMessageMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ import org.springframework.messaging.Message; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Jeremy Grelle * @author Gary Russell diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/JsonOutboundMessageMapperTests.java b/spring-integration-core/src/test/java/org/springframework/integration/json/JsonOutboundMessageMapperTests.java index bd362ce633..2703ef86b4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/JsonOutboundMessageMapperTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/JsonOutboundMessageMapperTests.java @@ -45,7 +45,6 @@ public class JsonOutboundMessageMapperTests { private final ObjectMapper objectMapper = new ObjectMapper(); - @Test public void testFromMessageWithHeadersAndStringPayload() { Message testMessage = MessageBuilder.withPayload("myPayloadStuff").build(); @@ -122,7 +121,6 @@ public class JsonOutboundMessageMapperTests { return objectMapper.readValue(parser, TestBean.class); } - private record TestNamedComponent(int id) implements NamedComponent { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/JsonPathTests.java b/spring-integration-core/src/test/java/org/springframework/integration/json/JsonPathTests.java index 75a844fd79..575a8e3f06 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/JsonPathTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/JsonPathTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,6 @@ public class JsonPathTests { @Autowired private PollableChannel routerOutput2; - @Test public void testInt3139JsonPathTransformer() throws IOException { this.transformerInput.send(testMessage); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/JsonToObjectTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/json/JsonToObjectTransformerTests.java index 73c1634dc9..99e16d49b0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/JsonToObjectTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/JsonToObjectTransformerTests.java @@ -46,6 +46,7 @@ public class JsonToObjectTransformerTests { JsonToObjectTransformer transformer = new JsonToObjectTransformer( ResolvableType.forType(new ParameterizedTypeReference>() { + })); // Since DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES is disabled by default // (see Jackson2JsonObjectMapper) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/ObjectToJsonTransformerParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/json/ObjectToJsonTransformerParserTests.java index 3d599afc28..c324ac552f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/ObjectToJsonTransformerParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/ObjectToJsonTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,6 @@ public class ObjectToJsonTransformerParserTests { assertThat(TestUtils.getPropertyValue(transformer, "contentType")).isEqualTo("text/xml"); } - @Test public void defaultObjectMapper() { TestAddress address = new TestAddress(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java b/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java index b07417e950..2e89ded618 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ class TestAddress { this.street = street; } - public int getNumber() { return this.number; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/TestBean.java b/spring-integration-core/src/test/java/org/springframework/integration/json/TestBean.java index 38f20f77ed..48534db343 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/TestBean.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/TestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,4 +117,5 @@ public class TestBean { } return true; } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/TestChildBean.java b/spring-integration-core/src/test/java/org/springframework/integration/json/TestChildBean.java index 23489f1331..c821cfff04 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/TestChildBean.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/TestChildBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.springframework.integration.json; public class TestChildBean { + private String value = "bar"; private String baz = null; @@ -96,4 +97,5 @@ public class TestChildBean { } return true; } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/TestPerson.java b/spring-integration-core/src/test/java/org/springframework/integration/json/TestPerson.java index aea58fa642..45f1d7473a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/TestPerson.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/TestPerson.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class TestPerson { this.age = age; } - public String getFirstName() { return this.firstName; } @@ -113,4 +112,5 @@ public class TestPerson { return "name=" + this.firstName + " " + this.lastName + ", age=" + this.age + ", address=" + this.address; } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/mapping/HeaderMapperTests.java b/spring-integration-core/src/test/java/org/springframework/integration/mapping/HeaderMapperTests.java index 39d51da102..55d3f54574 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/mapping/HeaderMapperTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/mapping/HeaderMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -172,6 +172,7 @@ public class HeaderMapperTests { @Test public void customTransientHeaderNames() { GenericTestHeaderMapper customMapper = new GenericTestHeaderMapper() { + @Override protected Collection getTransientHeaderNames() { return Arrays.asList("foo", GenericTestHeaders.APP_ID); @@ -294,7 +295,6 @@ public class HeaderMapperTests { assertThat(properties.getUserDefinedHeaders().size()).isEqualTo(1); } - @Test public void fromHeadersToReplyWithStandardReplyPattern() { this.mapper.setReplyHeaderNames("foo", GenericTestHeaderMapper.STANDARD_REPLY_HEADER_NAME_PATTERN); @@ -322,7 +322,6 @@ public class HeaderMapperTests { return new MessageHeaders(headers); } - @Test public void prefixHeaderPatternMatching() { PatternBasedHeaderMatcher strategy = @@ -428,12 +427,10 @@ public class HeaderMapperTests { assertMapping(strategy, "somethingElse", false); } - protected void assertMapping(HeaderMatcher strategy, String candidate, boolean match) { assertThat(strategy.matchHeader(candidate)).as("Wrong mapping result for " + candidate + "").isEqualTo(match); } - private abstract static class GenericTestHeaders { public static final String PREFIX = "generic_"; @@ -452,7 +449,6 @@ public class HeaderMapperTests { private static class GenericTestHeaderMapper extends AbstractHeaderMapper { - GenericTestHeaderMapper() { super(GenericTestHeaders.PREFIX, Arrays.asList(GenericTestHeaders.APP_ID, GenericTestHeaders.TRANSACTION_SIZE, diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/ExpressionEvaluatingMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/ExpressionEvaluatingMessageHandlerTests.java index 98e7dcff4f..587ee68062 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/ExpressionEvaluatingMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/ExpressionEvaluatingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class ExpressionEvaluatingMessageHandlerTests { parser = new SpelExpressionParser(); } - @Test public void validExpression() { Expression expression = parser.parseExpression("T(System).out.println(payload)"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/MessageHeadersTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/MessageHeadersTests.java index d1237f7f67..4d91ae1753 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/MessageHeadersTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/MessageHeadersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -142,7 +142,6 @@ public class MessageHeadersTests { assertThat(output.get("address")).isNull(); } - private static Object serializeAndDeserialize(Object object) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(baos); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java index f649892e70..dd88203c9b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,7 +99,6 @@ public class MethodInvokingMessageHandlerTests { context.close(); } - private record TestBean(BlockingQueue queue) { @SuppressWarnings("unused") @@ -114,13 +113,11 @@ public class MethodInvokingMessageHandlerTests { } - @SuppressWarnings("unused") private static class TestSink { private String result; - TestSink() { super(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageSourceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageSourceTests.java index dc919b6608..5eb5d40019 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageSourceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,6 @@ public class MethodInvokingMessageSourceTests { assertThat(message).isNull(); } - @SuppressWarnings("unused") private static class TestBean { @@ -127,6 +126,7 @@ public class MethodInvokingMessageSourceTests { public Object nullReturningMethod() { return null; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/PayloadAndHeaderMappingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/PayloadAndHeaderMappingTests.java index aa1ebd2034..6b09fdb691 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/PayloadAndHeaderMappingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/PayloadAndHeaderMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,6 @@ public class PayloadAndHeaderMappingTests { bean = new TestBean(); } - @Test public void headerPropertiesAndObjectPayload() throws Exception { MessageHandler handler = this.getHandler("headerPropertiesAndObjectPayload", Properties.class, Object.class); @@ -705,7 +704,6 @@ public class PayloadAndHeaderMappingTests { assertThat(bean.lastPayload).isEqualTo("123456"); } - private ServiceActivatingHandler getHandler(String methodName, Class... types) throws Exception { ServiceActivatingHandler serviceActivatingHandler = new ServiceActivatingHandler(bean, TestBean.class.getMethod(methodName, types)); @@ -714,7 +712,6 @@ public class PayloadAndHeaderMappingTests { return serviceActivatingHandler; } - @SuppressWarnings("unused") private static class SingleAmbiguousMethodTestBean { @@ -735,7 +732,6 @@ public class PayloadAndHeaderMappingTests { private volatile Object lastPayload; - TestBean() { super(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/resource/ResourceInboundChannelAdapterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/resource/ResourceInboundChannelAdapterParserTests.java index 37b8a916d1..408d11e137 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/resource/ResourceInboundChannelAdapterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/resource/ResourceInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,6 @@ public class ResourceInboundChannelAdapterParserTests { workDir.delete(); } - @Test public void testDefaultConfig() { ClassPathXmlApplicationContext context = @@ -169,7 +168,6 @@ public class ResourceInboundChannelAdapterParserTests { context.close(); } - public static class TestCollectionFilter implements CollectionFilter { private volatile boolean invoked = false; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java index 5d8c817bae..0ac4580ad9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -607,7 +607,6 @@ public class MethodInvokingRouterTests { assertThat(replyMessage).isEqualTo(message); } - public static class SingleChannelNameRoutingTestBean { public String routePayload(String name) { @@ -630,7 +629,6 @@ public class MethodInvokingRouterTests { } - public static class MultiChannelNameRoutingTestBean { public List routePayload(String name) { @@ -663,7 +661,6 @@ public class MethodInvokingRouterTests { } - public static class SingleChannelInstanceRoutingTestBean { private final DestinationResolver channelResolver; @@ -688,7 +685,6 @@ public class MethodInvokingRouterTests { } - public static class MultiChannelInstanceRoutingTestBean { private final DestinationResolver channelResolver; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java index 899d26dba7..adad56591e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -441,7 +441,6 @@ public class RecipientListRouterTests { Mockito.verify(beanFactory).getBean(Mockito.eq("defaultChannel"), Mockito.eq(MessageChannel.class)); } - private static class AlwaysTrueSelector implements MessageSelector { AlwaysTrueSelector() { @@ -455,7 +454,6 @@ public class RecipientListRouterTests { } - private static class AlwaysFalseSelector implements MessageSelector { AlwaysFalseSelector() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterConcurrencyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterConcurrencyTests.java index 653d1f2722..0754110488 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterConcurrencyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterConcurrencyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,6 +52,7 @@ public class RouterConcurrencyTests { final AtomicInteger count = new AtomicInteger(); final Semaphore semaphore = new Semaphore(1); final AbstractMessageRouter router = new AbstractMessageRouter() { + @Override protected Collection determineTargetChannels(Message message) { return null; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java index 0124475024..2ed7c9a47b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -242,7 +242,6 @@ public class RouterTests { context.close(); } - @Test(expected = MessagingException.class) public void beanFactoryWithRouterAndChannelPrefixFailing() { AbstractMappingMessageRouter router = diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java index a80358f36b..d3de1a2fe3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public class DynamicExpressionRouterIntegrationTests { @Autowired private PollableChannel odd; - @Test public void dynamicExpressionBasedRouter() { TestBean testBean1 = new TestBean(1); @@ -69,7 +68,6 @@ public class DynamicExpressionRouterIntegrationTests { assertThat(even.receive(0)).isNull(); } - static class TestBean { private final int number; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterConvertibleTypeTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterConvertibleTypeTests.java index 1e46432534..24ad20315b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterConvertibleTypeTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterConvertibleTypeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public class HeaderValueRouterConvertibleTypeTests { @Autowired private PollableChannel falseChannel; - @Test public void testBooleanValueMappingToChannels() { Message trueMessage = MessageBuilder.withPayload(1) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java index 0ab0d66deb..bbb231c5e4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public class HeaderValueRouterParserTests { @Autowired private TestServiceB testServiceB; - @Test public void testHeaderValuesAsChannels() { context.start(); @@ -85,7 +84,6 @@ public class HeaderValueRouterParserTests { assertThat(message2.getHeaders().get("testHeader")).isEqualTo("2"); } - public interface TestServiceA { void foo(Message message); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/Numbers.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/Numbers.java index 62c72f3440..2283a439d3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/Numbers.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/Numbers.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ public class Numbers { private final List values; - public Numbers(List values) { this.values = values; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java index c9a176f0e9..4c2de95150 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,10 +105,10 @@ public class PayloadTypeRouterParserTests { " " + ""; - public interface TestService { void foo(Message message); + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java index e8fb752940..5187f9495e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -236,7 +236,6 @@ public class RouterParserTests { new ClassPathXmlApplicationContext("rfb-fix-config.xml", this.getClass()).close(); } - public static class NonExistingChannelRouter { public String route(String payload) { @@ -253,7 +252,6 @@ public class RouterParserTests { this.channel = channel; } - @Override protected List getChannelKeys(Message message) { return Collections.singletonList((Object) this.channel); @@ -261,7 +259,6 @@ public class RouterParserTests { } - public static class AnnotatedTestRouterBean { private final MessageChannel channel; @@ -286,7 +283,6 @@ public class RouterParserTests { } - static class TestChannelResolver implements DestinationResolver { @Override diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java index 3d9b25bc8c..2b8b818976 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,8 +136,8 @@ public class RouterWithMappingTests { public String getName() { return this.name; } - } + } private static class TestRouter implements Lifecycle { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java index 5291838743..015ef90788 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class SpelRouterIntegrationTests { @Autowired private TestBean testBean; - @Test public void simpleExpressionBasedRouter() { TestBean testBean1 = new TestBean(1); @@ -92,7 +91,6 @@ public class SpelRouterIntegrationTests { assertThat(testBean.remainders.receive(0)).isNull(); } - static class TestBean { private final int number; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterAggregatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterAggregatorTests.java index 3a7b015108..da358c5747 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterAggregatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterAggregatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ public class SplitterAggregatorTests { private final AtomicInteger count = new AtomicInteger(); - @Test public void testSplitterAndAggregator() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( diff --git a/spring-integration-core/src/test/java/org/springframework/integration/routingslip/RoutingSlipTests.java b/spring-integration-core/src/test/java/org/springframework/integration/routingslip/RoutingSlipTests.java index 644e758102..62240a348b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/routingslip/RoutingSlipTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/routingslip/RoutingSlipTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ import org.springframework.test.context.support.GenericXmlContextLoader; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - /** * @author Artem Bilan * diff --git a/spring-integration-core/src/test/java/org/springframework/integration/selector/MessageSelectorChainTests.java b/spring-integration-core/src/test/java/org/springframework/integration/selector/MessageSelectorChainTests.java index a5ffbc891a..21cc5013ed 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/selector/MessageSelectorChainTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/selector/MessageSelectorChainTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ public class MessageSelectorChainTests { private final Message message = new GenericMessage("test"); - @Test public void anyStrategyAccepts() { MessageSelectorChain chain = new MessageSelectorChain(); @@ -158,7 +157,6 @@ public class MessageSelectorChainTests { assertThat(chain.accept(message)).isFalse(); } - private static class TestSelector implements MessageSelector { private final boolean accept; @@ -171,6 +169,7 @@ public class MessageSelectorChainTests { public boolean accept(Message message) { return this.accept; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java index ea055d8718..0ac602fe96 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -226,7 +226,6 @@ class DefaultSplitterTests { splitter.handleMessage(message); - verifier.verify(Duration.ofSeconds(1)); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java index c194cb814b..1456afc32c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public class DynamicExpressionSplitterIntegrationTests { @Autowired private PollableChannel output; - @Test public void simple() { Message message = MessageBuilder.withPayload(new TestBean()).setHeader("foo", "foo").build(); @@ -66,7 +65,6 @@ public class DynamicExpressionSplitterIntegrationTests { assertThat(output.receive(0)).isNull(); } - static class TestBean { private final List numbers = new ArrayList<>(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java index decf8545e2..cf44956117 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Stream; import org.aopalliance.intercept.MethodInterceptor; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.aop.framework.ProxyFactory; import org.springframework.beans.factory.BeanFactory; @@ -39,6 +39,7 @@ import org.springframework.messaging.handler.annotation.Header; import org.springframework.messaging.support.GenericMessage; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.mockito.Mockito.mock; /** @@ -345,6 +346,7 @@ public class MethodInvokingSplitterTests { } } + GenericMessage> message = new GenericMessage<>(Arrays.asList("foo", "bar")); MethodInvokingSplitter splitter = new MethodInvokingSplitter(new ListSplitter(), "split"); QueueChannel replyChannel = new QueueChannel(); @@ -372,6 +374,7 @@ public class MethodInvokingSplitterTests { } } + Stream stream = Stream.of("foo", "bar"); ProxyFactory pf = new ProxyFactory(stream); AtomicBoolean closed = new AtomicBoolean(); @@ -505,9 +508,10 @@ public class MethodInvokingSplitterTests { assertThat(reply2.getPayload()).isEqualTo("bar"); } - @Test(expected = IllegalArgumentException.class) + @Test public void ambiguousTypeMatch() { - new MethodInvokingSplitter(new AmbiguousTypeMatchTestBean()); + assertThatIllegalArgumentException() + .isThrownBy(() -> new MethodInvokingSplitter(new AmbiguousTypeMatchTestBean())); } @Test @@ -529,9 +533,10 @@ public class MethodInvokingSplitterTests { assertThat(reply2.getPayload()).isEqualTo("bar"); } - @Test(expected = IllegalArgumentException.class) + @Test public void multiplePublicMethods() { - new MethodInvokingSplitter(new MultiplePublicMethodTestBean()); + assertThatIllegalArgumentException() + .isThrownBy(() -> new MethodInvokingSplitter(new MultiplePublicMethodTestBean())); } private MethodInvokingSplitter getSplitter(String methodName) throws Exception { @@ -673,7 +678,6 @@ public class MethodInvokingSplitterTests { } - @SuppressWarnings("serial") private static class TestStringMessage extends GenericMessage { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java index 7a58116e4b..948f734467 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -150,7 +150,6 @@ public class SpelSplitterIntegrationTests { assertThat(output.receive(0)).isNull(); } - static class TestBean { private final List numbers = new ArrayList(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java index 880318248e..662ee21db0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class StreamingSplitterTests { this.message = new GenericMessage<>("foo.bar"); } - @Test public void splitToIterator_sequenceSizeInLastMessageHeader() { int messageQuantity = 5; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreReaperTests.java b/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreReaperTests.java index bcd5afce62..1e6aa6548d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreReaperTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreReaperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,7 +96,6 @@ public class MessageStoreReaperTests { reaper2.setExpireOnDestroy(true); reaper2.setTimeout(0); - if (!reaper2.isAutoStartup()) { reaper2.start(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java b/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java index a37c037c16..988de55451 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,6 @@ public class MessageStoreTests { private boolean removed = false; - TestMessageStore() { super(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageStoreTests.java b/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageStoreTests.java index 6fb6be2be8..7e87f040ac 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageStoreTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,7 +118,6 @@ public class SimpleMessageStoreTests { .isThrownBy(() -> store2.addMessage(new GenericMessage("foo"))); } - @Test public void shouldNotHoldMoreThanGroupCapacity() { SimpleMessageStore store = new SimpleMessageStore(0, 1); @@ -163,7 +162,6 @@ public class SimpleMessageStoreTests { .isThrownBy(() -> store2.addMessageToGroup("foo", MessageBuilder.withPayload("bar").build())); } - @Test public void shouldHoldCapacityExactly() { SimpleMessageStore store = new SimpleMessageStore(2); @@ -194,7 +192,6 @@ public class SimpleMessageStoreTests { store.addMessageToGroup("foo", testMessage2); } - @Test public void shouldListByCorrelation() { SimpleMessageStore store = new SimpleMessageStore(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageTests.java index 16b1a24032..99612a4509 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ import org.springframework.messaging.MessageHeaders; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Stuart Williams * @author Nathan Kurtyka diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/SingleScenarioTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/SingleScenarioTests.java index a7cbb6fe03..c7478fa527 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/SingleScenarioTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/SingleScenarioTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ public class SingleScenarioTests extends SingleRequestResponseScenarioTests { "inputChannel", "outputChannel") .setPayload("hello") .setResponseValidator(new PayloadValidator() { + @Override protected void validateResponse(String response) { assertThat(response).isEqualTo("HELLO"); @@ -39,4 +40,5 @@ public class SingleScenarioTests extends SingleRequestResponseScenarioTests { }); return scenario; } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/SmartLifecycleRoleControllerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/SmartLifecycleRoleControllerTests.java index 45866b1773..420db40f54 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/SmartLifecycleRoleControllerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/SmartLifecycleRoleControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,6 @@ public class SmartLifecycleRoleControllerTests { inOrder.verify(lc2).stop(); } - @Test public void allEndpointRunning() { SmartLifecycle lc1 = new PseudoSmartLifecycle(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/converter/MapMessageConverterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/converter/MapMessageConverterTests.java index f7d5a6fe22..cbd9b24487 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/converter/MapMessageConverterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/converter/MapMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -126,4 +126,5 @@ public class MapMessageConverterTests { assertThat(headers.keySet().contains("bar")).isFalse(); assertThat(headers.size()).isEqualTo(0); } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/converter/ObjectStringMessageConverterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/converter/ObjectStringMessageConverterTests.java index 6dca7ae391..5908057f3a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/converter/ObjectStringMessageConverterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/converter/ObjectStringMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.support.converter; - import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; @@ -67,6 +66,7 @@ class ObjectStringMessageConverterTests { } private record ArbitraryPayload(Integer id, String text) { + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java index e7dc3efc75..f47155fd48 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -239,7 +239,6 @@ public class LockRegistryLeaderInitiatorTests { .given(lock) .unlock(); - given(registry.obtain(anyString())) .willReturn(lock); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/management/observation/IntegrationObservabilityZipkinTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/management/observation/IntegrationObservabilityZipkinTests.java index 530eafdf7a..a68f84eb6e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/management/observation/IntegrationObservabilityZipkinTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/management/observation/IntegrationObservabilityZipkinTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -121,7 +121,6 @@ public class IntegrationObservabilityZipkinTests extends SampleTestRunner { }; } - @Configuration @EnableIntegration @EnableIntegrationManagement( @@ -154,7 +153,6 @@ public class IntegrationObservabilityZipkinTests extends SampleTestRunner { return new QueueChannel(); } - @Bean TestMessagingGatewaySupport skippedObservationInboundGateway() { TestMessagingGatewaySupport messagingGatewaySupport = new TestMessagingGatewaySupport(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/mutable/MutableMessageBuilderFactoryTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/mutable/MutableMessageBuilderFactoryTests.java index 3b0e0ab7c0..86ac208291 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/mutable/MutableMessageBuilderFactoryTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/mutable/MutableMessageBuilderFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Stuart Williams * @since 4.2 diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transaction/TransactionInterceptorBuilderTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transaction/TransactionInterceptorBuilderTests.java index 49629f3659..c52ab7b754 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transaction/TransactionInterceptorBuilderTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transaction/TransactionInterceptorBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,6 @@ public class TransactionInterceptorBuilderTests { assertThat(atts.isReadOnly()).isTrue(); } - @Configuration public static class Config { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass1.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass1.java index 4962a7b958..975cf9ba56 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass1.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass1.java @@ -13,6 +13,7 @@ import org.apache.avro.specific.SpecificData; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class AvroTestClass1 extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + private static final long serialVersionUID = 72441923701471492L; public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroTestClass1\",\"namespace\":\"org.springframework.integration.transformer\",\"fields\":[{\"name\":\"bar\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"qux\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null}]}"); @@ -241,7 +242,6 @@ public class AvroTestClass1 extends org.apache.avro.specific.SpecificRecordBase return fieldSetFlags()[0]; } - /** * Clears the value of the 'bar' field. * @return This builder. @@ -280,7 +280,6 @@ public class AvroTestClass1 extends org.apache.avro.specific.SpecificRecordBase return fieldSetFlags()[1]; } - /** * Clears the value of the 'qux' field. * @return This builder. @@ -304,6 +303,7 @@ public class AvroTestClass1 extends org.apache.avro.specific.SpecificRecordBase throw new org.apache.avro.AvroRuntimeException(e); } } + } @SuppressWarnings("unchecked") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass2.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass2.java index 50d955ac79..6c2cbf3156 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass2.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/AvroTestClass2.java @@ -13,6 +13,7 @@ import org.apache.avro.specific.SpecificData; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class AvroTestClass2 extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { + private static final long serialVersionUID = -5029139830458327575L; public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroTestClass2\",\"namespace\":\"org.springframework.integration.transformer\",\"fields\":[{\"name\":\"bar\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}]},{\"name\":\"qux\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"default\":null}]}"); @@ -241,7 +242,6 @@ public class AvroTestClass2 extends org.apache.avro.specific.SpecificRecordBase return fieldSetFlags()[0]; } - /** * Clears the value of the 'bar' field. * @return This builder. @@ -280,7 +280,6 @@ public class AvroTestClass2 extends org.apache.avro.specific.SpecificRecordBase return fieldSetFlags()[1]; } - /** * Clears the value of the 'qux' field. * @return This builder. @@ -304,6 +303,7 @@ public class AvroTestClass2 extends org.apache.avro.specific.SpecificRecordBase throw new org.apache.avro.AvroRuntimeException(e); } } + } @SuppressWarnings("unchecked") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/ContentEnricherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/ContentEnricherTests.java index 18d668371e..9ec7026f55 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/ContentEnricherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/ContentEnricherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -212,7 +212,6 @@ public class ContentEnricherTests { enricher.setReplyChannel(replyChannel); enricher.setBeanFactory(mock(BeanFactory.class)); - assertThatIllegalStateException() .isThrownBy(enricher::afterPropertiesSet) .withMessage("If the replyChannel is set, then the requestChannel must not be null"); @@ -388,7 +387,6 @@ public class ContentEnricherTests { Message requestMessage = MessageBuilder.withPayload(target).setReplyChannel(replyChannel).build(); - assertThatExceptionOfType(MessageHandlingException.class) .isThrownBy(() -> enricher.handleMessage(requestMessage)) .withMessageContaining("Failed to clone payload object"); @@ -523,7 +521,6 @@ public class ContentEnricherTests { } - public static final class Target implements Cloneable { private volatile String name; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionHeaderEnricherIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionHeaderEnricherIntegrationTests.java index fe3a4f7175..fcead3b75e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionHeaderEnricherIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionHeaderEnricherIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class DynamicExpressionHeaderEnricherIntegrationTests { @Autowired private PollableChannel output; - @Test public void dynamicExpressionHeader() { Message message = MessageBuilder.withPayload("test").build(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionTransformerIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionTransformerIntegrationTests.java index 5e2e60285a..c352f1b8b9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionTransformerIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/DynamicExpressionTransformerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class DynamicExpressionTransformerIntegrationTests { @Autowired private PollableChannel output; - @Test public void transformWithDynamicExpression() { Message message = MessageBuilder.withPayload(new TestBean()).setHeader("bar", 123).build(); @@ -52,7 +51,6 @@ public class DynamicExpressionTransformerIntegrationTests { assertThat(result.getPayload()).isEqualTo("test123"); } - static class TestBean { public String getFoo() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java index b6968f0786..4245456c62 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ import org.springframework.messaging.Message; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Oleg Zhurakousky * @author Gunnar Hillert diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageHistoryParameterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageHistoryParameterTests.java index a5e7728830..fc262ba2af 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageHistoryParameterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MessageHistoryParameterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,6 +63,7 @@ public class MessageHistoryParameterTests { return payload; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MethodInvokingTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MethodInvokingTransformerTests.java index 58653438ae..b98fc160e8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MethodInvokingTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MethodInvokingTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -254,7 +254,6 @@ class MethodInvokingTransformerTests { assertThat(result.getHeaders().get("prop3")).isEqualTo("baz"); } - @SuppressWarnings("unused") private static class TestBean { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/ObjectToStringTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/ObjectToStringTransformerTests.java index a0ef2a7127..acb167c7d3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/ObjectToStringTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/ObjectToStringTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,6 +78,7 @@ public class ObjectToStringTransformerTests { public String toString() { return "test"; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java index 5e3154a2a7..43a20f685f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,6 @@ public class PayloadSerializingTransformerTests { assertThat(new String((byte[]) message.getPayload())).isEqualTo("Converted"); } - @SuppressWarnings("serial") private static class TestBean implements Serializable { @@ -84,6 +83,7 @@ public class PayloadSerializingTransformerTests { TestBean(String name) { this.name = name; } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadTransformerTests.java index 6392f13ca8..5c1024cb93 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class PayloadTransformerTests { transformer.transform(message); } - private static class TestPayloadTransformer extends AbstractPayloadTransformer { TestPayloadTransformer() { @@ -67,6 +66,7 @@ public class PayloadTransformerTests { } return s.length(); } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/SpelTransformerIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/SpelTransformerIntegrationTests.java index 8bec55f83a..b468649333 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/SpelTransformerIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/SpelTransformerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,6 +144,7 @@ public class SpelTransformerIntegrationTests { } public static class Foo { + private String bar; public Foo(String bar) { @@ -198,5 +199,7 @@ public class SpelTransformerIntegrationTests { public static String bar(Message message) { return "bar"; } + } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/util/TestDefaultAnnotationConfiguration.java b/spring-integration-core/src/test/java/org/springframework/integration/util/TestDefaultAnnotationConfiguration.java index fdd8afa32f..78f5cbcaee 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/util/TestDefaultAnnotationConfiguration.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/util/TestDefaultAnnotationConfiguration.java @@ -22,4 +22,5 @@ import org.springframework.integration.config.EnableIntegration; @Configuration @EnableIntegration public class TestDefaultAnnotationConfiguration { + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/util/TestTransactionManager.java b/spring-integration-core/src/test/java/org/springframework/integration/util/TestTransactionManager.java index 6a12f1b67e..0ab1f92633 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/util/TestTransactionManager.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/util/TestTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ public class TestTransactionManager extends AbstractPlatformTransactionManager { private volatile TransactionDefinition lastDefinition; - public void reset() { this.latch = new CountDownLatch(1); this.commitCounter.set(0); diff --git a/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/dsl/DebeziumDslTests.java b/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/dsl/DebeziumDslTests.java index 621b0e8ac7..5f660de367 100644 --- a/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/dsl/DebeziumDslTests.java +++ b/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/dsl/DebeziumDslTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2023 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,12 +95,17 @@ public class DebeziumDslTests implements DebeziumMySqlTestContainer { public static class Config { private final CountDownLatch latch = new CountDownLatch(52); + private final List payloads = new ArrayList<>(); + private final List> headerKeys = new ArrayList<>(); private final CountDownLatch batchLatch = new CountDownLatch(52); + private final List bachPayloads = new ArrayList<>(); + private final List> batchHeaderKeys = new ArrayList<>(); + private int batchMessageCount = 0; @Bean @@ -152,11 +157,12 @@ public class DebeziumDslTests implements DebeziumMySqlTestContainer { @Bean public DebeziumEngine.Builder> debeziumEngineBuilder() { return DebeziumEngine.create(KeyValueHeaderChangeEventFormat - .of(io.debezium.engine.format.JsonByteArray.class, - io.debezium.engine.format.JsonByteArray.class, - io.debezium.engine.format.JsonByteArray.class)) + .of(io.debezium.engine.format.JsonByteArray.class, + io.debezium.engine.format.JsonByteArray.class, + io.debezium.engine.format.JsonByteArray.class)) .using(DebeziumMySqlTestContainer.connectorConfig(DebeziumMySqlTestContainer.mysqlPort())); } + } } diff --git a/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/it/DebeziumTestConfiguration.java b/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/it/DebeziumTestConfiguration.java index a70634eab5..2876b3ad99 100644 --- a/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/it/DebeziumTestConfiguration.java +++ b/spring-integration-debezium/src/test/java/org/springframework/integration/debezium/it/DebeziumTestConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2023 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,10 +43,10 @@ public class DebeziumTestConfiguration { public DebeziumEngine.Builder> debeziumEngineBuilder() { return DebeziumEngine.create(KeyValueHeaderChangeEventFormat - .of( - io.debezium.engine.format.JsonByteArray.class, - io.debezium.engine.format.JsonByteArray.class, - io.debezium.engine.format.JsonByteArray.class)) + .of( + io.debezium.engine.format.JsonByteArray.class, + io.debezium.engine.format.JsonByteArray.class, + io.debezium.engine.format.JsonByteArray.class)) .using(DebeziumMySqlTestContainer.connectorConfig(DebeziumMySqlTestContainer.mysqlPort())); } diff --git a/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java b/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java index 6b38be6864..1c956b46e8 100644 --- a/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java +++ b/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -149,7 +149,6 @@ public class ApplicationEventListeningMessageProducer extends ExpressionMessageP } } - if (eventType.getRawClass() != null && PayloadApplicationEvent.class.isAssignableFrom(eventType.getRawClass())) { if (eventType.hasUnresolvableGenerics()) { diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/dsl/IntegrationFlowEventsTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/dsl/IntegrationFlowEventsTests.java index 0c49b63678..65a5cd4a95 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/dsl/IntegrationFlowEventsTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/dsl/IntegrationFlowEventsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,6 @@ public class IntegrationFlowEventsTests { messageGroupStore.addMessageToGroup(GROUP_ID, new GenericMessage<>("foo")); } - @Autowired private ApplicationContext applicationContext; @@ -165,7 +164,6 @@ public class IntegrationFlowEventsTests { return producer; } - @Bean public PollableChannel resultsChannel() { return new QueueChannel(); diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java index a3090f7206..9baba507cb 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -309,7 +309,6 @@ public class ApplicationEventListeningMessageProducerTests { ctx.close(); } - @SuppressWarnings("serial") private static class TestApplicationEvent1 extends ApplicationEvent { diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java index 6cddf221e6..a7d5b35054 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ public class ApplicationEventPublishingMessageHandlerTests { assertThat((event).getSource()).isEqualTo("foo"); } - private static class TestApplicationEventPublisher implements ApplicationEventPublisher { private volatile ApplicationEvent lastEvent; @@ -79,7 +78,6 @@ public class ApplicationEventPublishingMessageHandlerTests { } - @SuppressWarnings("serial") private static class TestEvent extends ApplicationEvent { diff --git a/spring-integration-feed/src/main/java/org/springframework/integration/feed/dsl/FeedEntryMessageSourceSpec.java b/spring-integration-feed/src/main/java/org/springframework/integration/feed/dsl/FeedEntryMessageSourceSpec.java index 2b5420b427..f28ad7bfd5 100644 --- a/spring-integration-feed/src/main/java/org/springframework/integration/feed/dsl/FeedEntryMessageSourceSpec.java +++ b/spring-integration-feed/src/main/java/org/springframework/integration/feed/dsl/FeedEntryMessageSourceSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,4 +56,5 @@ public class FeedEntryMessageSourceSpec extends MessageSourceSpec { private volatile boolean initialized; - /** * Creates a FeedEntryMessageSource that will use a HttpURLFeedFetcher to read feeds from the given URL. * If the feed URL has a protocol other than http*, consider providing a custom implementation of the diff --git a/spring-integration-feed/src/test/java/org/springframework/integration/feed/config/FeedInboundChannelAdapterParserTests.java b/spring-integration-feed/src/test/java/org/springframework/integration/feed/config/FeedInboundChannelAdapterParserTests.java index b1a30c5dba..043d902c9c 100644 --- a/spring-integration-feed/src/test/java/org/springframework/integration/feed/config/FeedInboundChannelAdapterParserTests.java +++ b/spring-integration-feed/src/test/java/org/springframework/integration/feed/config/FeedInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public class FeedInboundChannelAdapterParserTests { @TempDir public static File tempFolder; - private static CountDownLatch latch; @Test @@ -76,7 +75,6 @@ public class FeedInboundChannelAdapterParserTests { context.close(); } - @Test public void validateSuccessfulHttpConfigurationWithCustomMetadataStore() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( @@ -161,7 +159,6 @@ public class FeedInboundChannelAdapterParserTests { } - public static class SampleServiceNoHistory { public void receiveFeedEntry(SyndEntry entry) { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java index d0815f4205..f26b97baf7 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -169,7 +169,6 @@ public class FileReadingMessageSource extends AbstractMessageSource implem this.toBeReceived = new PriorityBlockingQueue<>(DEFAULT_INTERNAL_QUEUE_CAPACITY, receptionOrderComparator); } - /** * Specify the input directory. * @param directory to monitor @@ -418,7 +417,6 @@ public class FileReadingMessageSource extends AbstractMessageSource implem this.toBeReceived.offer(failedMessage.getPayload()); } - public enum WatchEventType { CREATE(StandardWatchEventKinds.ENTRY_CREATE), diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java index 7d6f9f7ba6..6568e2656d 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -224,7 +224,6 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand this.temporaryFileSuffixSet = true; } - /** * Will set the {@link FileExistsMode} that specifies what will happen in * case the destination exists. For example {@link FileExistsMode#APPEND} @@ -772,7 +771,6 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand boolean append = FileExistsMode.APPEND.equals(this.fileExistsMode) || FileExistsMode.APPEND_NO_FLUSH.equals(this.fileExistsMode); - try { this.lockRegistry.executeLocked(fileToWriteTo.getAbsolutePath(), () -> { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java b/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java index b2814699f3..d74becd2bd 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class HeadDirectoryScanner extends DefaultDirectoryScanner { } } - private static final class HeadFilter implements FileListFilter { private final int maxNumberOfFiles; @@ -68,6 +67,7 @@ public class HeadDirectoryScanner extends DefaultDirectoryScanner { public List filterFiles(File[] files) { return Arrays.asList(files).subList(0, Math.min(files.length, this.maxNumberOfFiles)); } + } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileSplitterParser.java b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileSplitterParser.java index fe16f60bb9..60ddecf6e9 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileSplitterParser.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileSplitterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import org.springframework.integration.config.xml.AbstractConsumerEndpointParser import org.springframework.integration.config.xml.IntegrationNamespaceUtils; import org.springframework.integration.file.splitter.FileSplitter; - /** * @author Gary Russell * @author Artem Bilan diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileInboundChannelAdapterSpec.java b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileInboundChannelAdapterSpec.java index 1d8de28007..a13bde0872 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileInboundChannelAdapterSpec.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileInboundChannelAdapterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,6 @@ public class FileInboundChannelAdapterSpec return _this(); } - /** * Specify a custom scanner. * @param scanner the scanner. diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java index 8b89122a7e..78a11a811a 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class TailAdapterSpec extends MessageProducerSpec implements DiscardAw public List filterFiles(F[] files) { List list = new ArrayList<>(); Instant now = Instant.now(); - for (F file: files) { + for (F file : files) { if (fileIsAged(file, now)) { list.add(file); } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java index d763ef369a..2779f9b232 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ public abstract class AbstractRegexPatternFileListFilter extends AbstractDire private Pattern pattern; - public AbstractRegexPatternFileListFilter(String pattern) { this(Pattern.compile(pattern)); } @@ -46,7 +45,6 @@ public abstract class AbstractRegexPatternFileListFilter extends AbstractDire this.pattern = pattern; } - public void setPattern(String pattern) { Assert.notNull(pattern, "'pattern' must not be null!"); setPattern(Pattern.compile(pattern)); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java index 39cd80ba7e..90d8d8910c 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,12 +39,10 @@ public abstract class AbstractSimplePatternFileListFilter extends AbstractDir private final String path; - public AbstractSimplePatternFileListFilter(String path) { this.path = path; } - /** * Accept the given file if its name matches the pattern. */ diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java index f4ab04684c..184196974c 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.file.filters; - /** * Simple implementation of {@link FileListFilter} that always returns true. * Suitable as a default. diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptOnceFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptOnceFileListFilter.java index a839ed848d..f91c087b7f 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptOnceFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptOnceFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,6 @@ public class AcceptOnceFileListFilter extends AbstractFileListFilter imple private final Lock monitor = new ReentrantLock(); - /** * Creates an AcceptOnceFileListFilter that is based on a bounded queue. If the queue overflows, * files that fall out will be passed through this filter again if passed to the @@ -69,7 +68,6 @@ public class AcceptOnceFileListFilter extends AbstractFileListFilter imple this.seen = null; } - @Override public boolean accept(F file) { this.monitor.lock(); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileSystemPersistentAcceptOnceFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileSystemPersistentAcceptOnceFileListFilter.java index 35f6534261..de36312585 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileSystemPersistentAcceptOnceFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileSystemPersistentAcceptOnceFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2021 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.file.filters; - import java.io.File; import org.springframework.integration.metadata.ConcurrentMetadataStore; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/RegexPatternFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/RegexPatternFileListFilter.java index 8bf7b40305..e5bfe5cd77 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/RegexPatternFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/RegexPatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ public class RegexPatternFileListFilter extends AbstractRegexPatternFileListFilt super(pattern); } - @Override protected String getFilename(File file) { return (file != null) ? file.getName() : null; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/SimplePatternFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/SimplePatternFileListFilter.java index 57249cc4b7..6b2b1fa018 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/SimplePatternFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/SimplePatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,13 +32,11 @@ public class SimplePatternFileListFilter extends AbstractSimplePatternFileListFi super(path); } - @Override protected String getFilename(File file) { return file.getName(); } - @Override protected boolean isDirectory(File file) { return file.isDirectory(); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/locking/FileChannelCache.java b/spring-integration-file/src/main/java/org/springframework/integration/file/locking/FileChannelCache.java index adbc63110d..12c60da274 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/locking/FileChannelCache.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/locking/FileChannelCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ final class FileChannelCache { private static ConcurrentMap channelCache = new ConcurrentHashMap<>(); - private FileChannelCache() { } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractRemoteFileStreamingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractRemoteFileStreamingMessageSource.java index a3793f9e2d..8c2169ff7c 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractRemoteFileStreamingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractRemoteFileStreamingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -175,7 +175,6 @@ public abstract class AbstractRemoteFileStreamingMessageSource protected void doInit() { } - @Override public void start() { this.running.set(true); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/ClientCallbackWithoutResult.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/ClientCallbackWithoutResult.java index e3ab4d1431..4d788fedfe 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/ClientCallbackWithoutResult.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/ClientCallbackWithoutResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.file.remote; - /** * {@code RemoteFileTemplate} callback with the underlying client instance providing * access to lower level methods where no result is returned. diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java index ac70c06ab7..5b6e085d4f 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2021 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -247,7 +247,6 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ this.temporaryFileSuffix = temporaryFileSuffix; } - @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; @@ -416,7 +415,6 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ }); } - @Override public F[] list(String path) { return execute(session -> session.list(path)); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/aop/StandardRotationPolicy.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/aop/StandardRotationPolicy.java index 6f584a81ee..ba34f883f5 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/aop/StandardRotationPolicy.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/aop/StandardRotationPolicy.java @@ -112,7 +112,6 @@ public class StandardRotationPolicy implements RotationPolicy { return this.current; } - protected DelegatingSessionFactory getFactory() { return this.factory; } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java index 2a58fc1c8a..7976615ad7 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1309,8 +1309,8 @@ public abstract class AbstractRemoteFileOutboundGateway extends AbstractReply */ protected String getFullFileName(String remoteDirectory, F remoteFile) { return remoteDirectory != null - ? remoteDirectory + getFilename(remoteFile) - : getFilename(remoteFile); + ? remoteDirectory + getFilename(remoteFile) + : getFilename(remoteFile); } private String getRemoteDirectory(String remoteFilePath, String remoteFilename) { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java index 7c75dc791e..9d3cef4954 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,6 @@ public class FileTransferringMessageHandler extends AbstractMessageHandler { this.mode = mode; } - /** * A {@code boolean} flag to indicate automatically create the directory or not. * @param autoCreateDirectory true to automatically create the directory. diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java index be98c5f96e..23f475b05b 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +85,7 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe "'sessionFactory' cannot be a 'DelegatingSessionFactory'; cache each delegate instead"); this.sessionFactory = sessionFactory; this.pool = new SimplePool<>(sessionCacheSize, new SimplePool.PoolItemCallback>() { + @Override public Session createForPool() { return CachingSessionFactory.this.sessionFactory.getSession(); @@ -103,7 +104,6 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe this.isSharedSessionCapable = sessionFactory instanceof SharedSessionCapable; } - /** * Sets the limit of how long to wait for a session to become available. * @param sessionWaitTimeout the session wait timeout. diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java index 43c316263e..e10f3a1f1a 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.file.remote.session; - /** * A {@link SessionFactory} that implements this interface is capable of supporting a shared session. * diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java index 0c285ee109..83dd2f6340 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -219,7 +219,6 @@ public abstract class AbstractInboundFileSynchronizer doSetRemoteDirectoryExpression(EXPRESSION_PARSER.parseExpression(remoteDirectoryExpression)); } - protected final void doSetRemoteDirectoryExpression(Expression expression) { Assert.notNull(expression, "'remoteDirectoryExpression' must not be null"); this.remoteDirectoryExpression = expression; @@ -274,7 +273,6 @@ public abstract class AbstractInboundFileSynchronizer this.metadataStorePrefix = metadataStorePrefix; } - @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; @@ -297,7 +295,6 @@ public abstract class AbstractInboundFileSynchronizer doInit(); } - /** * Subclasses can override to perform initialization - called from * {@link InitializingBean#afterPropertiesSet()}. diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java index 9f83419d0f..5260f18c0e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,7 +117,6 @@ public abstract class AbstractInboundFileSynchronizingMessageSource } } - public void setAutoCreateLocalDirectory(boolean autoCreateLocalDirectory) { this.autoCreateLocalDirectory = autoCreateLocalDirectory; } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java index 9d2d4b62c3..b0b5e3d178 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,6 @@ public class OSDelegatingFileTailingMessageProducer extends FileTailingMessagePr } } - /** * Runs a thread that waits for the Process result. */ diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java index 345d41e0d9..f22dde1f53 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ public class FileToStringTransformer extends AbstractFilePayloadTransformer 0) { Thread.sleep(100); diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/AutoCreateDirectoryIntegrationTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/AutoCreateDirectoryIntegrationTests.java index e1da999a9d..5b06424d1f 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/AutoCreateDirectoryIntegrationTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/AutoCreateDirectoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,11 +45,9 @@ public class AutoCreateDirectoryIntegrationTests { System.getProperty("java.io.tmpdir") + File.separator + AutoCreateDirectoryIntegrationTests.class.getSimpleName(); - @Autowired private ApplicationContext context; - @BeforeClass public static void setupNonAutoCreatedDirectories() { new File(BASE_PATH).delete(); @@ -63,7 +61,6 @@ public class AutoCreateDirectoryIntegrationTests { new File(BASE_PATH).delete(); } - @Test public void defaultInbound() { Object adapter = context.getBean("defaultInbound"); diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/ChainElementsTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/ChainElementsTests.java index a231b03ecd..5dc1d11d77 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/ChainElementsTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/ChainElementsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ import org.springframework.core.io.InputStreamResource; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; - /** * @author Gunnar Hillert * @author Artem Bilan diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/DefaultConfigurationTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/DefaultConfigurationTests.java index 17d09eba62..3d5d1a3ad6 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/DefaultConfigurationTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/DefaultConfigurationTests.java @@ -16,7 +16,6 @@ package org.springframework.integration.file.config; - import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -48,7 +47,6 @@ public class DefaultConfigurationTests { @Autowired private ApplicationContext context; - @Test public void verifyErrorChannel() { Object errorChannel = context.getBean(IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME); diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPatternParserTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPatternParserTests.java index 409dcbb4f5..5872d2964f 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPatternParserTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPatternParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,13 +55,11 @@ public class FileInboundChannelAdapterWithPatternParserTests { private DirectFieldAccessor accessor; - @Autowired public void setSource(FileReadingMessageSource source) { this.accessor = new DirectFieldAccessor(source); } - @Test public void channelName() { AbstractMessageChannel channel = context.getBean("adapterWithPattern", AbstractMessageChannel.class); diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPreventDuplicatesFlagTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPreventDuplicatesFlagTests.java index 832e9d1b1b..f8f4c54d76 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPreventDuplicatesFlagTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithPreventDuplicatesFlagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class FileInboundChannelAdapterWithPreventDuplicatesFlagTests { @Qualifier("testFilter") private TestFileListFilter testFilter; - @Test public void filterAndNull() { FileListFilter filter = this.extractFilter("filterAndNull"); @@ -144,7 +143,6 @@ public class FileInboundChannelAdapterWithPreventDuplicatesFlagTests { assertThat(result.size()).isEqualTo(3); } - @SuppressWarnings("unchecked") private FileListFilter extractFilter(String beanName) { return (FileListFilter) diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileListFilterFactoryBeanTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileListFilterFactoryBeanTests.java index 93c5dd21cb..0dcda8d298 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileListFilterFactoryBeanTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileListFilterFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,10 +132,12 @@ public class FileListFilterFactoryBeanTests { } private static class TestFilter extends AbstractFileListFilter { + @Override public boolean accept(File file) { return true; } + } } diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileMessageHistoryTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileMessageHistoryTests.java index d8160e2fab..be776fda1e 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileMessageHistoryTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileMessageHistoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class FileMessageHistoryTests { - @Test public void testMessageHistory() throws Exception { ClassPathXmlApplicationContext context = diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundAdaptersWithClasspathInPropertiesTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundAdaptersWithClasspathInPropertiesTests.java index 26496a4b79..64a2b74dec 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundAdaptersWithClasspathInPropertiesTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundAdaptersWithClasspathInPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,6 @@ public class FileOutboundAdaptersWithClasspathInPropertiesTests { @Qualifier("gateway") private EventDrivenConsumer gateway; - @Test public void outboundChannelAdapter() throws Exception { DirectFieldAccessor accessor = new DirectFieldAccessor( diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java index 6bb764e010..50b06ed2d2 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -307,7 +307,6 @@ public class FileOutboundChannelAdapterParserTests { @Test public void adapterUsageWithIgnoreMode() throws Exception { - String expectedFileContent = "Initial File Content:"; File testFile = new File("test/fileToIgnore.txt"); diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/config/InboundAdapterWithLockersTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/config/InboundAdapterWithLockersTests.java index 03df68530f..23ea4468bd 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/config/InboundAdapterWithLockersTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/config/InboundAdapterWithLockersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ @SpringJUnitConfig public class InboundAdapterWithLockersTests { + @Autowired private ApplicationContext context; @@ -48,4 +49,5 @@ public class InboundAdapterWithLockersTests { assertThat(TestUtils.getPropertyValue(context.getBean("inputWithLockerD"), "source.scanner.locker")) .isInstanceOf(NioFileLocker.class); } + } diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/dsl/FileTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/dsl/FileTests.java index 17c4e09b80..5318b53a8c 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/dsl/FileTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/dsl/FileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -403,7 +403,6 @@ public class FileTests { .get(); } - @Bean public IntegrationFlow fileSplitterFlow(BeanFactory beanFactory) { ExpressionFileListFilter fileExpressionFileListFilter = diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/filters/CompositeFileListFilterTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/filters/CompositeFileListFilterTests.java index 0dcfde6ab0..b7561031d0 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/filters/CompositeFileListFilterTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/filters/CompositeFileListFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -138,7 +138,6 @@ public class CompositeFileListFilterTests { return true; } - @Override public boolean isForRecursion() { return true; diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterTests.java index 6cd121c82f..b70ec87d00 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.integration.file.filters; import java.io.Closeable; import java.io.File; import java.io.Flushable; -import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -143,9 +142,6 @@ public class PersistentAcceptOnceFileListFilterTests extends AcceptOnceFileListF } @Test - /* - * INT-3721: Test all operations that can cause the metadata to be flushed. - */ public void testFlush() throws Exception { final AtomicInteger flushes = new AtomicInteger(); final AtomicBoolean replaced = new AtomicBoolean(); @@ -157,7 +153,7 @@ public class PersistentAcceptOnceFileListFilterTests extends AcceptOnceFileListF } @Override - public void close() throws IOException { + public void close() { flush(); } @@ -168,6 +164,7 @@ public class PersistentAcceptOnceFileListFilterTests extends AcceptOnceFileListF } } + MS store = new MS(); String prefix = "flush:"; FileSystemPersistentAcceptOnceFileListFilter filter = new FileSystemPersistentAcceptOnceFileListFilter( diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java index f318643baf..fcf226bf30 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,6 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; - /** * @author Gary Russell * @author Liu Jiong @@ -681,7 +680,6 @@ public class RemoteFileOutboundGatewayTests { assertThat(outFile.exists()).isFalse(); } - @Test public void testGet_P() { SessionFactory sessionFactory = mock(SessionFactory.class); @@ -969,7 +967,6 @@ public class RemoteFileOutboundGatewayTests { private boolean open; - @Override public boolean remove(String path) { return false; @@ -1049,7 +1046,6 @@ public class RemoteFileOutboundGatewayTests { } - static class TestRemoteFileOutboundGateway extends AbstractRemoteFileOutboundGateway { @SuppressWarnings("unchecked") diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformerTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformerTests.java index f6e64bb9c1..cc7c719cc3 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformerTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public abstract class AbstractFilePayloadTransformerTests implements private Integer dataTimeout; - /** * File types defined by {@link org.apache.commons.net.ftp.FTP} constants: *
    diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java index 003864230e..a548f42ba3 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,6 @@ public class DefaultFtpsSessionFactory extends AbstractFtpSessionFactory { public FTPFile getFileInfo() { return this.ftpFile; } + } diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java index 344670aee4..1e7eeaa279 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,6 @@ public class FtpSession implements Session { this.client = client; } - @Override public boolean remove(String path) throws IOException { Assert.hasText(path, "path must not be null"); diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java index 56db29c288..c6289731ce 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpTestSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,6 @@ public class FtpTestSupport extends RemoteFileTestSupport { port = listener.getPort(); } - @AfterAll public static void stopServer() { server.stop(); @@ -123,7 +122,6 @@ public class FtpTestSupport extends RemoteFileTestSupport { this.testUser.setName("TEST_USER"); } - @Override public User getUserByName(String s) { return this.testUser; diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundOutboundSanitySample.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundOutboundSanitySample.java index 91780e3686..cfd2f72f7c 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundOutboundSanitySample.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundOutboundSanitySample.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class FtpInboundOutboundSanitySample { - @Test @Disabled public void testFtpInboundChannelAdapter() throws Exception { diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpOutboundGatewayParserTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpOutboundGatewayParserTests.java index 759f1eeaaa..911c7a5676 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpOutboundGatewayParserTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -186,4 +186,5 @@ public class FtpOutboundGatewayParserTests { } } + } diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpStreamingInboundChannelAdapterParserTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpStreamingInboundChannelAdapterParserTests.java index 2c94288dba..c460ec07be 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpStreamingInboundChannelAdapterParserTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpStreamingInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,6 +102,7 @@ public class FtpStreamingInboundChannelAdapterParserTests { public boolean isSingleton() { return true; } + } } diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpInboundRemoteFileSystemSynchronizerTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpInboundRemoteFileSystemSynchronizerTests.java index ebc60f8525..c575077e2e 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpInboundRemoteFileSystemSynchronizerTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpInboundRemoteFileSystemSynchronizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -168,7 +168,6 @@ public class FtpInboundRemoteFileSystemSynchronizerTests { assertThat(metadata).isEmpty(); } - @Test public void testSyncRemoteFileOnlyOnceByDefault() { File localDirectory = new File("test"); @@ -185,7 +184,6 @@ public class FtpInboundRemoteFileSystemSynchronizerTests { synchronizer.synchronizeToLocalDirectory(localDirectory); - File[] files = localDirectory.listFiles(); assertThat(files.length).isEqualTo(3); @@ -215,7 +213,6 @@ public class FtpInboundRemoteFileSystemSynchronizerTests { } } - public static class TestFtpSessionFactory extends AbstractFtpSessionFactory { private final Collection ftpFiles = new ArrayList<>(); diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpOutboundTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpOutboundTests.java index 8578f8545f..dddad62180 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpOutboundTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpOutboundTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -215,7 +215,6 @@ public class FtpOutboundTests { context.close(); } - public static class TestFtpSessionFactory extends AbstractFtpSessionFactory { @Override diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/session/SessionFactoryTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/session/SessionFactoryTests.java index 573a37f790..8ed1f4b4a6 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/session/SessionFactoryTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/session/SessionFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ import static org.mockito.Mockito.verify; */ class SessionFactoryTests { - @Test void testFtpClientInteraction() throws Exception { final FTPClient client = mock(FTPClient.class); @@ -119,7 +118,6 @@ class SessionFactoryTests { .isThrownBy(() -> sessionFactory.setControlEncoding(null)); } - @Test void testClientModes() throws Exception { DefaultFtpSessionFactory sessionFactory = new DefaultFtpSessionFactory(); @@ -141,7 +139,6 @@ class SessionFactoryTests { } } - @Test @SuppressWarnings("unchecked") void testStaleConnection() { diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java index 0550b6fc1d..499693499d 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,6 @@ public class GroovyCommandMessageProcessor extends AbstractScriptExecutingMessag @Nullable private Binding binding; - /** * Creates a {@link GroovyCommandMessageProcessor} that will use the * {@link org.springframework.integration.scripting.DefaultScriptVariableGenerator}. diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java index fd68d75433..a3936218c0 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,7 +166,6 @@ public class GroovyScriptExecutingMessageProcessor extends AbstractScriptExecuti return (result instanceof GString) ? result.toString() : result; } - private void parseScriptIfNecessary(ScriptSource scriptSource) { if (this.scriptClass == null || scriptSource.isModified()) { this.scriptLock.lock(); diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/VariableBindingGroovyObjectCustomizerDecorator.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/VariableBindingGroovyObjectCustomizerDecorator.java index d23c01bbfa..5d2fd9df51 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/VariableBindingGroovyObjectCustomizerDecorator.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/VariableBindingGroovyObjectCustomizerDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ class VariableBindingGroovyObjectCustomizerDecorator implements GroovyObjectCust private volatile GroovyObjectCustomizer customizer; - public void setVariables(Map variables) { this.variables = variables; } diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyIntegrationConfigurationInitializer.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyIntegrationConfigurationInitializer.java index 6fb0ce16a4..4d89dd1090 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyIntegrationConfigurationInitializer.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyIntegrationConfigurationInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.groovy.config; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java index a2cffde6a0..fc723b25e2 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyScriptParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ import org.springframework.integration.scripting.config.AbstractScriptParser; */ public class GroovyScriptParser extends AbstractScriptParser { - @Override protected Class getBeanClass(Element element) { return GroovyScriptExecutingMessageProcessor.class; diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java index 4db9625995..1b2d3fdffa 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.integration.groovy; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutorService; @@ -27,9 +28,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import groovy.lang.Script; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.springframework.core.io.AbstractResource; import org.springframework.integration.handler.MessageProcessor; @@ -41,7 +41,6 @@ import org.springframework.messaging.support.GenericMessage; import org.springframework.scripting.ScriptSource; import org.springframework.scripting.support.ResourceScriptSource; import org.springframework.scripting.support.StaticScriptSource; -import org.springframework.test.annotation.Repeat; import static org.assertj.core.api.Assertions.assertThat; @@ -55,14 +54,10 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class GroovyScriptExecutingMessageProcessorTests { - @Rule - public RepeatProcessor repeater = new RepeatProcessor(4); - private final AtomicInteger countHolder = new AtomicInteger(); @Test - @Repeat(20) - public void testSimpleExecution() throws Exception { + public void testSimpleExecution() { int count = countHolder.getAndIncrement(); String script = "return \"payload is $payload, header is $headers.testHeader\""; Message message = MessageBuilder.withPayload("foo").setHeader("testHeader", "bar" + count).build(); @@ -74,27 +69,17 @@ public class GroovyScriptExecutingMessageProcessorTests { } @Test - public void testSimpleExecutionWithScriptVariableGenerator() throws Exception { + public void testSimpleExecutionWithScriptVariableGenerator() { int count = countHolder.getAndIncrement(); String script = "return \"payload is $payload, header is $headers.testHeader and date is $date\""; Message message = MessageBuilder.withPayload("foo").setHeader("testHeader", "bar" + count).build(); TestResource resource = new TestResource(script, "simpleTest"); ScriptSource scriptSource = new ResourceScriptSource(resource); Object result = null; - class CustomScriptVariableGenerator implements ScriptVariableGenerator { - - @Override - public Map generateScriptVariables(Message message) { - Map variables = new HashMap(); - variables.put("date", System.nanoTime()); - variables.put("payload", message.getPayload()); - variables.put("headers", message.getHeaders()); - return variables; - } - } for (int i = 0; i < 5; i++) { ScriptVariableGenerator scriptVariableGenerator = new CustomScriptVariableGenerator(); - MessageProcessor processor = new GroovyScriptExecutingMessageProcessor(scriptSource, scriptVariableGenerator); + MessageProcessor processor = + new GroovyScriptExecutingMessageProcessor(scriptSource, scriptVariableGenerator); Object newResult = processor.processMessage(message); assertThat(newResult.equals(result)).isFalse(); // make sure that we get different nanotime verifying that generateScriptVariables() is invoked result = newResult; @@ -126,7 +111,7 @@ public class GroovyScriptExecutingMessageProcessorTests { } @Test - @Ignore("Very sensitive to the time") + @Disabled("Very sensitive to the time") public void testRefreshableScriptExecution() throws Exception { String script = "return \"payload is $payload, header is $headers.testHeader\""; Message message = MessageBuilder.withPayload("foo").setHeader("testHeader", "bar").build(); @@ -151,7 +136,7 @@ public class GroovyScriptExecutingMessageProcessorTests { } @Test - public void testRefreshableScriptExecutionWithInfiniteDelay() throws Exception { + public void testRefreshableScriptExecutionWithInfiniteDelay() { String script = "return \"payload is $payload, header is $headers.testHeader\""; Message message = MessageBuilder.withPayload("foo").setHeader("testHeader", "bar").build(); TestResource resource = new TestResource(script, "simpleTest"); @@ -168,7 +153,7 @@ public class GroovyScriptExecutingMessageProcessorTests { } @Test - public void testRefreshableScriptExecutionWithAlwaysRefresh() throws Exception { + public void testRefreshableScriptExecutionWithAlwaysRefresh() { String script = "return \"payload is $payload, header is $headers.testHeader\""; Message message = MessageBuilder.withPayload("foo").setHeader("testHeader", "bar").build(); TestResource resource = new TestResource(script, "simpleTest"); @@ -177,7 +162,7 @@ public class GroovyScriptExecutingMessageProcessorTests { // process with the first script Object result = processor.processMessage(message); assertThat(result.toString()).isEqualTo("payload is foo, header is bar"); - // change script, but since refresh-delay is less then 0 we should still se old script executing + // change script, but since refresh-delay is less than 0 we should still se old script executing resource.setScript("return \"payload is $payload\""); // process and see assert that the old script is used result = processor.processMessage(message); @@ -201,7 +186,7 @@ public class GroovyScriptExecutingMessageProcessorTests { ScriptSource scriptSource = new StaticScriptSource(script, Script.class.getName()); final MessageProcessor processor = new GroovyScriptExecutingMessageProcessor(scriptSource, message1 -> { - Map variables = new HashMap(2); + Map variables = new HashMap<>(2); variables.put("var1", var1); variables.put("var2", var2); return variables; @@ -253,8 +238,22 @@ public class GroovyScriptExecutingMessageProcessorTests { @Override public InputStream getInputStream() throws IOException { - return new ByteArrayInputStream(script.getBytes("UTF-8")); + return new ByteArrayInputStream(script.getBytes(StandardCharsets.UTF_8)); } + + } + + private static class CustomScriptVariableGenerator implements ScriptVariableGenerator { + + @Override + public Map generateScriptVariables(Message message) { + Map variables = new HashMap<>(); + variables.put("date", System.nanoTime()); + variables.put("payload", message.getPayload()); + variables.put("headers", message.getHeaders()); + return variables; + } + } } diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptPayloadMessageProcessorTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptPayloadMessageProcessorTests.java index 6a42a71911..402cfbfd29 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptPayloadMessageProcessorTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/GroovyScriptPayloadMessageProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,15 +21,13 @@ import java.util.concurrent.atomic.AtomicInteger; import groovy.lang.Binding; import groovy.lang.MissingPropertyException; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.integration.handler.MessageProcessor; import org.springframework.integration.scripting.DefaultScriptVariableGenerator; import org.springframework.integration.scripting.ScriptVariableGenerator; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; -import org.springframework.test.annotation.Repeat; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -43,15 +41,11 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; */ public class GroovyScriptPayloadMessageProcessorTests { - @Rule - public RepeatProcessor repeater = new RepeatProcessor(4); - - private AtomicInteger countHolder = new AtomicInteger(); + private final AtomicInteger countHolder = new AtomicInteger(); private GroovyCommandMessageProcessor processor; @Test - @Repeat(20) public void testSimpleExecution() { int count = countHolder.getAndIncrement(); Message message = MessageBuilder.withPayload("headers.foo" + count).setHeader("foo" + count, "bar").build(); diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/RepeatProcessor.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/RepeatProcessor.java deleted file mode 100644 index 97aba3f3d2..0000000000 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/RepeatProcessor.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2002-2022 the original author or authors. - * - * Licensed 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 - * - * https://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.springframework.integration.groovy; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import org.junit.rules.MethodRule; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.Statement; - -import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.test.annotation.Repeat; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * A method rule that looks at Spring repeat annotations on methods and executes the test multiple times (without - * re-initializing the test case). - * - * @author Dave Syer - * @author Artem Bilan - * - * @since 2.0 - * - */ -public class RepeatProcessor implements MethodRule { - - private final int concurrency; - - public RepeatProcessor(int concurrency) { - this.concurrency = concurrency < 0 ? 0 : concurrency; - } - - public Statement apply(final Statement base, FrameworkMethod method, Object target) { - Repeat repeat = AnnotationUtils.findAnnotation(method.getMethod(), Repeat.class); - if (repeat == null) { - return base; - } - final int repeats = repeat.value(); - if (concurrency <= 0) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - for (int i = 0; i < repeats; i++) { - try { - base.evaluate(); - } - catch (Throwable t) { - throw new IllegalStateException("Failed on iteration: " + i, t); - } - } - } - }; - } - return new Statement() { - @Override - public void evaluate() throws Throwable { - List> results = new ArrayList>(); - ExecutorService executor = Executors.newFixedThreadPool(concurrency); - try { - for (int i = 0; i < repeats; i++) { - final int count = i; - results.add(executor.submit(new Callable() { - public Boolean call() { - try { - base.evaluate(); - } - catch (Throwable t) { - throw new IllegalStateException("Failed on iteration: " + count, t); - } - return true; - } - })); - } - for (Future future : results) { - assertThat(future.get(10, TimeUnit.SECONDS)).as("Null result from completer").isTrue(); - } - } - finally { - executor.shutdownNow(); - } - } - }; - } -} diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/ScriptsFactoryTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/ScriptsFactoryTests.java index 0c23ac5450..cd20475a9b 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/ScriptsFactoryTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/ScriptsFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,6 @@ public class ScriptsFactoryTests { assertThat(delegate).isInstanceOf(GroovyScriptExecutingMessageProcessor.class); } - @Configuration @EnableIntegration public static class ContextConfiguration { diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyControlBusTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyControlBusTests.java index 608f0ba6fd..5e9b177386 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyControlBusTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyControlBusTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ import org.springframework.web.context.request.RequestContextHolder; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; - /** * @author Dave Syer * @author Artem Bilan @@ -182,7 +181,6 @@ public class GroovyControlBusTests { } - public static class NonManagedService { public String convert(String input) { diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyHeaderEnricherTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyHeaderEnricherTests.java index 2efb401adb..b9efefb1b6 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyHeaderEnricherTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyHeaderEnricherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Oleg Zhurakousky * @author Artem Bilan diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java index 81d51f0972..d821169c94 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,6 @@ public class GroovyServiceActivatorTests { @Autowired private MessageChannel outboundChannelAdapterWithGroovy; - @Test public void referencedScriptAndCustomizer() throws Exception { groovyCustomizer.executed = false; @@ -196,7 +195,6 @@ public class GroovyServiceActivatorTests { assertThat(this.invoked.get()).isTrue(); } - public static class SampleScriptVariSource implements ScriptVariableGenerator { public Map generateScriptVariables(Message message) { @@ -211,7 +209,6 @@ public class GroovyServiceActivatorTests { } - public static class MyGroovyCustomizer implements GroovyObjectCustomizer { private volatile boolean executed; diff --git a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyTransformerTests.java b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyTransformerTests.java index cc74d2185d..8ac0be6af1 100644 --- a/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyTransformerTests.java +++ b/spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,4 +94,5 @@ public class GroovyTransformerTests { //before it was MethodInvokingMessageProcessor assertThat(messageProcessor instanceof GroovyScriptExecutingMessageProcessor).isTrue(); } + } diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java index ba485a027f..2906e0e8a2 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,4 +65,5 @@ public class HazelcastDistributedSQLInboundChannelAdapterParser extends Abstract return builder.getBeanDefinition(); } + } diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/leader/LeaderInitiator.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/leader/LeaderInitiator.java index 1db7a909ea..1abd8276cc 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/leader/LeaderInitiator.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/leader/LeaderInitiator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.hazelcast.leader; - import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.Semaphore; @@ -268,7 +267,6 @@ public class LeaderInitiator implements SmartLifecycle, DisposableBean, Applicat stop(); } - FencedLock getLock() { CPSubsystem cpSubSystem = this.client.getCPSubsystem(); FencedLock lock = cpSubSystem.getLock(this.candidate.getRole()); @@ -277,7 +275,6 @@ public class LeaderInitiator implements SmartLifecycle, DisposableBean, Applicat return lock; } - /** * Callable that manages the acquisition of Hazelcast locks * for leadership election. @@ -326,7 +323,6 @@ public class LeaderInitiator implements SmartLifecycle, DisposableBean, Applicat // The lock was broken and we are no longer leader revokeLeadership(); - if (isRunning()) { // Give it a chance to elect some other leader. try { @@ -366,7 +362,6 @@ public class LeaderInitiator implements SmartLifecycle, DisposableBean, Applicat } } - private void handleGranted() throws InterruptedException { LeaderInitiator.this.candidate.onGranted(this.context); if (LeaderInitiator.this.leaderEventPublisher != null) { diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java index e9d7e8e361..89e90c3cf5 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,7 +130,6 @@ public class HazelcastCacheWritingMessageHandler extends AbstractMessageHandler } } - private DistributedObject getDistributedObject(final Message message) { if (this.distributedObject != null) { return this.distributedObject; diff --git a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/IdempotentReceiverIntegrationTests.java b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/IdempotentReceiverIntegrationTests.java index eb44b79dbe..2d79873af1 100644 --- a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/IdempotentReceiverIntegrationTests.java +++ b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/IdempotentReceiverIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,7 +184,6 @@ public class IdempotentReceiverIntegrationTests { .withMessageContaining("duplicate message has been received"); } - @Test public void testIdempotentReceiverOnBridgeTo() { PollableChannel replyChannel = new QueueChannel(); @@ -231,7 +230,6 @@ public class IdempotentReceiverIntegrationTests { return Hazelcast.newHazelcastInstance(); } - @Bean public ConcurrentMetadataStore store() { return new SimpleMetadataStore( diff --git a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/leader/LeaderInitiatorTests.java b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/leader/LeaderInitiatorTests.java index e62bb98788..114e378dbd 100644 --- a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/leader/LeaderInitiatorTests.java +++ b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/leader/LeaderInitiatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -171,7 +171,6 @@ public class LeaderInitiatorTests { initiator1.destroy(); - CountDownLatch onGranted = new CountDownLatch(1); DefaultCandidate candidate = spy(new DefaultCandidate()); @@ -205,7 +204,6 @@ public class LeaderInitiatorTests { initiator.destroy(); } - @Configuration public static class TestConfig { diff --git a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/outbound/HazelcastOutboundChannelAdapterTests.java b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/outbound/HazelcastOutboundChannelAdapterTests.java index fe6d70672b..7ad7bac317 100644 --- a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/outbound/HazelcastOutboundChannelAdapterTests.java +++ b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/outbound/HazelcastOutboundChannelAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -339,7 +339,6 @@ public class HazelcastOutboundChannelAdapterTests { .verifyMapForPayload(new TreeMap(this.bulkReplicatedMap)); } - @Test public void testWriteToDistributedList() { HazelcastOutboundChannelAdapterTestUtils diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/config/HttpInboundEndpointParser.java b/spring-integration-http/src/main/java/org/springframework/integration/http/config/HttpInboundEndpointParser.java index 7df8ecebfa..db061838fd 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/config/HttpInboundEndpointParser.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/config/HttpInboundEndpointParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -119,13 +119,11 @@ public class HttpInboundEndpointParser extends AbstractSingleBeanDefinitionParse IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "message-converters"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "merge-with-default-converters"); - parseHeaderMapper(element, parserContext, builder); BeanDefinition requestMappingDef = createRequestMapping(element); builder.addPropertyValue("requestMapping", requestMappingDef); - parseCrossOrigin(element, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java b/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java index 10c09061a7..3a5d8f3b29 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,6 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver private MultipartFileReader multipartFileReader = new DefaultMultipartFileReader(); - /** * Set the character set used for writing form data. * @param charset The charset. diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/converter/SerializingHttpMessageConverter.java b/spring-integration-http/src/main/java/org/springframework/integration/http/converter/SerializingHttpMessageConverter.java index 5fb1f4e500..cb56d2c615 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/converter/SerializingHttpMessageConverter.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/converter/SerializingHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,13 +43,11 @@ public class SerializingHttpMessageConverter extends AbstractHttpMessageConverte private static final MediaType APPLICATION_JAVA_SERIALIZED_OBJECT = new MediaType("application", "x-java-serialized-object"); - /** Creates a new instance of the {@code SerializingHttpMessageConverter}. */ public SerializingHttpMessageConverter() { super(APPLICATION_JAVA_SERIALIZED_OBJECT); } - @Override public boolean supports(Class clazz) { return Serializable.class.isAssignableFrom(clazz); diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/dsl/BaseHttpMessageHandlerSpec.java b/spring-integration-http/src/main/java/org/springframework/integration/http/dsl/BaseHttpMessageHandlerSpec.java index 1050b9745c..b38ca49575 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/dsl/BaseHttpMessageHandlerSpec.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/dsl/BaseHttpMessageHandlerSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -178,7 +178,6 @@ public abstract class BaseHttpMessageHandlerSpec(expectedResponseTypeFunction)); } - /** * Set the {@link HeaderMapper} to use when mapping between HTTP headers and {@code MessageHeaders}. * @param headerMapper The header mapper. diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java index 0e90828e89..4f8ecf41e0 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -190,7 +190,6 @@ public abstract class HttpRequestHandlingEndpointSupport extends BaseHttpInbound return this.messageConverters; } - /** * Flag which determines if the default converters should be available after * custom converters. @@ -200,7 +199,6 @@ public abstract class HttpRequestHandlingEndpointSupport extends BaseHttpInbound this.mergeWithDefaultConverters = mergeWithDefaultConverters; } - /** * Specify the {@link MultipartResolver} to use when checking requests. If no resolver is provided, the * "multipartResolver" bean in the context will be used as a fallback. If that is not available either, this diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGateway.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGateway.java index 5f02a9420e..194e46e77b 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGateway.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,6 @@ public class HttpRequestHandlingMessagingGateway extends HttpRequestHandlingEndp private volatile boolean convertExceptions; - public HttpRequestHandlingMessagingGateway() { this(true); } @@ -80,7 +79,6 @@ public class HttpRequestHandlingMessagingGateway extends HttpRequestHandlingEndp super(expectReply); } - /** * Flag to determine if conversion and writing out of message handling exceptions should be attempted (default * false, in which case they will simply be re-thrown). If the flag is true and no message converter can convert the diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java index 67a0bafbd6..bc5ac92b62 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,14 +38,12 @@ public class FileCopyingMultipartFileReader implements MultipartFileReader { private volatile Charset defaultCharset = Charset.forName(WebUtils.DEFAULT_CHARACTER_ENCODING); - /** * Specify the default charset name to use when converting multipart file * content into Strings if the multipart itself does not provide a charset. diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/UploadedMultipartFile.java b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/UploadedMultipartFile.java index 5edf77c386..8801799e18 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/UploadedMultipartFile.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/UploadedMultipartFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class UploadedMultipartFile implements MultipartFile { private final String originalFilename; - public UploadedMultipartFile(File file, long size, String contentType, String formParameterName, String originalFilename) { Assert.notNull(file, "file must not be null"); @@ -78,7 +77,6 @@ public class UploadedMultipartFile implements MultipartFile { this.originalFilename = originalFilename; } - @Override public String getName() { return this.formParameterName; diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/support/IntegrationWebExchangeBindException.java b/spring-integration-http/src/main/java/org/springframework/integration/http/support/IntegrationWebExchangeBindException.java index a6a2521a04..bcb7a4bf76 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/support/IntegrationWebExchangeBindException.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/support/IntegrationWebExchangeBindException.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class IntegrationWebExchangeBindException extends WebExchangeBindExceptio this.failedPayload = failedPayload; } - @Override public String getMessage() { BindingResult bindingResult = getBindingResult(); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/StubMultipartFile.java b/spring-integration-http/src/test/java/org/springframework/integration/http/StubMultipartFile.java index 325bc8ec37..cfc7abb912 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/StubMultipartFile.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/StubMultipartFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ public class StubMultipartFile implements MultipartFile { private final String text; - public StubMultipartFile(String parameterName, String filename, String text) { this.parameterName = parameterName; this.filename = filename; diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/config/ChainElementsTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/config/ChainElementsTests.java index a42d9f2007..673e98e5e0 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/config/ChainElementsTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/config/ChainElementsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import org.springframework.core.io.InputStreamResource; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; - /** * @author Gunnar Hillert * @author Artem Bilan diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/config/DefaultConfigurationTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/config/DefaultConfigurationTests.java index 37f4964fd2..0fc37bfe19 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/config/DefaultConfigurationTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/config/DefaultConfigurationTests.java @@ -46,7 +46,6 @@ public class DefaultConfigurationTests { @Autowired private ApplicationContext context; - @Test public void verifyErrorChannel() { Object errorChannel = context.getBean("errorChannel"); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java index 2351e5cc74..732b420f3c 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.willReturn; - /** * @author Mark Fisher * @author Oleg Zhurakousky @@ -248,7 +247,6 @@ public class HttpInboundChannelAdapterParserTests extends AbstractHttpInboundTes assertThat(((TestObject) message.getPayload()).text).isEqualTo("testObject"); } - @Test public void putOrDeleteMethodsSupported() { HttpMethod[] supportedMethods = diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java index d96824a80f..8abc85a14a 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,7 +100,6 @@ public class HttpInboundGatewayParserTests { @Autowired private PollableChannel responses; - @Test public void checkConfig() { assertThat(this.gateway).isNotNull(); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpOutboundGatewayParserTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpOutboundGatewayParserTests.java index a4eae8d56b..7af859e2b0 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpOutboundGatewayParserTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/config/HttpOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -214,7 +214,6 @@ public class HttpOutboundGatewayParserTests { assertThat(this.withPoller1).isInstanceOf(PollingConsumer.class); } - public static class StubErrorHandler implements ResponseErrorHandler { @Override diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/dsl/HttpDslTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/dsl/HttpDslTests.java index d0502ee410..02749a9592 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/dsl/HttpDslTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/dsl/HttpDslTests.java @@ -121,7 +121,6 @@ public class HttpDslTests { .build(); } - @Test public void testHttpProxyFlow() throws Exception { ClientHttpRequestFactory mockRequestFactory = new MockMvcClientHttpRequestFactory(this.mockMvc); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java index af250f3478..1b9657618a 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java @@ -281,6 +281,7 @@ public class HttpRequestHandlingMessagingGatewayTests extends AbstractHttpInboun gateway.setBeanFactory(mock(BeanFactory.class)); ParameterizedTypeReference> parameterizedTypeReference = new ParameterizedTypeReference<>() { + }; gateway.setRequestPayloadType(ResolvableType.forType(parameterizedTypeReference)); gateway.setRequestChannel(channel); @@ -313,7 +314,6 @@ public class HttpRequestHandlingMessagingGatewayTests extends AbstractHttpInboun }); } - @Test public void INT2680DuplicateContentTypeHeader() throws Exception { DirectChannel requestChannel = new DirectChannel(); @@ -451,7 +451,6 @@ public class HttpRequestHandlingMessagingGatewayTests extends AbstractHttpInboun assertThat(response.getContentAsString()).contains("from error channel"); } - @Test public void testMultipart() throws Exception { HttpRequestHandlingMessagingGateway gateway = new HttpRequestHandlingMessagingGateway(false); @@ -500,7 +499,6 @@ public class HttpRequestHandlingMessagingGatewayTests extends AbstractHttpInboun assertThat(twoValues).containsExactly("2"); } - private static class ContentTypeCheckingMockHttpServletResponse extends MockHttpServletResponse { private final List contentTypeList = new ArrayList<>(); @@ -547,7 +545,6 @@ public class HttpRequestHandlingMessagingGatewayTests extends AbstractHttpInboun } - @SuppressWarnings("serial") public static class TestBean implements Serializable { diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayWithPathMappingTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayWithPathMappingTests.java index 60ae5d10ba..9e39bd2094 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayWithPathMappingTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayWithPathMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class HttpRequestHandlingMessagingGatewayWithPathMappingTests extends Abs private static final ExpressionParser PARSER = new SpelExpressionParser(); - @Test public void withoutExpression() { DirectChannel echoChannel = new DirectChannel(); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/Int2312RequestMappingIntegrationTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/Int2312RequestMappingIntegrationTests.java index c15f041d43..28217597b1 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/Int2312RequestMappingIntegrationTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/Int2312RequestMappingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,6 @@ public class Int2312RequestMappingIntegrationTests extends AbstractHttpInboundTe assertThat(response.getContentAsString()).isEqualTo(TEST_STRING_MULTIPLE_PATHS); } - @Test @SuppressWarnings("unchecked") //INT-1362 diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java index e791a1e266..9564e07fa5 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,6 @@ public class CookieTests { ch1.send(new GenericMessage<>("Hello, world!")); assertThat(ch6.receive()).isNotNull(); - bos.close(); BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(bos.toByteArray()))); String line = br.readLine(); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandlerTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandlerTests.java index 992c7cbec7..33318a8522 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandlerTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -635,7 +635,6 @@ public class HttpRequestExecutingMessageHandlerTests { assertThat(template.lastRequestEntity.get().getHeaders().getContentType()).isNull(); - //DELETE handler.setHttpMethod(HttpMethod.DELETE); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java index 968524886a..40ba84548d 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -497,7 +497,6 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests { assertThat(headers.get("X-customHeaderB")).isNull(); } - @Test public void validateCustomHeadersWithNonStringValuesAndDefaultConverterOnly() { DefaultHttpHeaderMapper mapper = new DefaultHttpHeaderMapper(); @@ -588,7 +587,6 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests { assertThat(result.get(MessageHeaders.CONTENT_TYPE)).isEqualTo(MediaType.valueOf("text/plain")); } - public static class TestClass { } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java index 839f9d0bfd..dd4a184e3f 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter private volatile boolean listening; - public AbstractInternetProtocolReceivingChannelAdapter(int port) { this.port = port; } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java index 1f9049be2c..4dc970eab5 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,6 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst this.port = port; } - /** * @param timeout The timeout. * @see java.net.DatagramSocket#setSoTimeout(int) @@ -91,7 +90,6 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst return this.host; } - /** * @return the port */ @@ -99,7 +97,6 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst return this.port; } - /** * @return the destinationAddress */ @@ -107,7 +104,6 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst return this.destinationAddress; } - /** * @return the soTimeout */ @@ -115,7 +111,6 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst return this.soTimeout; } - /** * @return the soSendBufferSize */ @@ -123,7 +118,6 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst return this.soSendBufferSize; } - @Override public void start() { this.lock.lock(); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java index 7345885b8e..0c29b66307 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,7 +132,6 @@ public class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean { - - @Override - public TcpConnectionSupport createForPool() { - try { - return CachingClientConnectionFactory.this.targetConnectionFactory.getConnection(); - } - catch (Exception e) { - throw new MessagingException("Failed to obtain connection", e); - } - } - - @Override - public boolean isStale(TcpConnectionSupport connection) { - return !connection.isOpen(); - } - - @Override - public void removedFromPool(TcpConnectionSupport connection) { - connection.close(); - } - - } - this.pool = new SimplePool(poolSize, new Callback()); + this.pool = new SimplePool<>(poolSize, new TcpConnectionPoolItemCallback(this.targetConnectionFactory)); } /** @@ -144,8 +122,6 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact return new CachedConnection(this.pool.getItem(), getListener()); } -///////////////// DELEGATE METHODS /////////////////////// - @Override public boolean isRunning() { return this.targetConnectionFactory.isRunning(); @@ -291,7 +267,7 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact * it's listening logic (active thread) is terminated. *

    * The listener registered with a factory is provided to each - * connection it creates so it can call the onMessage() method. + * connection it creates, so it can call the onMessage() method. *

    * This code satisfies the first requirement in that this * listener signals to the factory that it needs to run @@ -347,7 +323,7 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact */ @Override public void setSingleUse(boolean singleUse) { - if (!singleUse && logger.isDebugEnabled()) { + if (!singleUse) { logger.debug("singleUse=false is not supported; cached connections are never closed"); } } @@ -367,11 +343,10 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact return this.targetConnectionFactory.isLookupHost(); } - @Override public void forceClose(TcpConnection connection) { - if (connection instanceof CachedConnection) { - ((CachedConnection) connection).physicallyClose(); + if (connection instanceof CachedConnection cachedConnection) { + cachedConnection.physicallyClose(); } // will be returned to pool but stale, so will be re-established super.forceClose(connection); @@ -403,7 +378,7 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact } @Override - public void destroy() throws Exception { + public void destroy() { this.pool.close(); } @@ -460,7 +435,7 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact public boolean onMessage(Message message) { Message modifiedMessage; if (message instanceof ErrorMessage) { - Map headers = new HashMap(message.getHeaders()); + Map headers = new HashMap<>(message.getHeaders()); headers.put(IpHeaders.CONNECTION_ID, getConnectionId()); if (headers.get(IpHeaders.ACTUAL_CONNECTION_ID) == null) { headers.put(IpHeaders.ACTUAL_CONNECTION_ID, @@ -497,4 +472,29 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact } + private record TcpConnectionPoolItemCallback(AbstractClientConnectionFactory targetConnectionFactory) + implements SimplePool.PoolItemCallback { + + @Override + public TcpConnectionSupport createForPool() { + try { + return this.targetConnectionFactory.getConnection(); + } + catch (Exception ex) { + throw new MessagingException("Failed to obtain connection", ex); + } + } + + @Override + public boolean isStale(TcpConnectionSupport connection) { + return !connection.isOpen(); + } + + @Override + public void removedFromPool(TcpConnectionSupport connection) { + connection.close(); + } + + } + } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ConnectionFactory.java index 2518ced128..3f73c73dd9 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2022 the original author or authors. + * Copyright 2001-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.springframework.integration.ip.tcp.connection; import org.springframework.integration.support.management.ManageableLifecycle; - /** * A factory used to create TcpConnection objects. * diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNetConnectionSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNetConnectionSupport.java index e08976dc64..7fa757959a 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNetConnectionSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNetConnectionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import java.net.Socket; import org.springframework.context.ApplicationEventPublisher; import org.springframework.lang.Nullable; - /** * Default implementation of {@link TcpNetConnectionSupport}. * diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNioConnectionSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNioConnectionSupport.java index fe2a07f5ff..ebb1c51656 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNioConnectionSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpNioConnectionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import java.nio.channels.SocketChannel; import org.springframework.context.ApplicationEventPublisher; import org.springframework.lang.Nullable; - /** * Implementation of {@link TcpNioConnectionSupport} for non-SSL * NIO connections. diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionCloseEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionCloseEvent.java index aebf2d18b0..2d4ecba395 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionCloseEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionCloseEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.ip.tcp.connection; - /** * @author Gary Russell * @since 3.0 diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionExceptionEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionExceptionEvent.java index f2e4e9a7c1..e4f1919e75 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionExceptionEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionExceptionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.ip.tcp.connection; - /** * ApplicationEvent representing exceptions on a {@link TcpConnection}. * @author Gary Russell diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java index a839c019ad..de4ffe1720 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.integration.ip.tcp.connection; import org.springframework.integration.ip.event.IpIntegrationEvent; import org.springframework.messaging.MessagingException; - /** * An event emitted when an endpoint cannot correlate a connection id to a * connection; the cause is a messaging exception with the failed message. diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedEvent.java index ed4885058e..cdf2f95ccc 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.springframework.integration.ip.tcp.connection; import org.springframework.integration.ip.event.IpIntegrationEvent; - /** * An event emitted when a connection could not be established for some * reason. diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java index 79f0818bdf..b8f56f33fe 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2019 the original author or authors. + * Copyright 2001-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.ip.tcp.connection; - /** * Interface for TCP connection interceptor factories. * @@ -33,5 +32,6 @@ public interface TcpConnectionInterceptorFactory { * @return the TcpInterceptor */ TcpConnectionInterceptorSupport getInterceptor(); + } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java index 08a8d8539f..ba3688d6d9 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,6 @@ public abstract class TcpConnectionInterceptorSupport extends TcpConnectionSuppo private boolean removed; - public TcpConnectionInterceptorSupport() { } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionOpenEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionOpenEvent.java index ba238e52a1..0f490aff06 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionOpenEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionOpenEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.ip.tcp.connection; - /** * @author Gary Russell * @since 3.0 diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnectionSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnectionSupport.java index e8fe59fd44..27b3bee2b6 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnectionSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnectionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.net.Socket; import org.springframework.context.ApplicationEventPublisher; import org.springframework.lang.Nullable; - /** * Used by NET connection factories to instantiate a {@link TcpNetConnection} object. * diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java index 446d335f38..e23a4a4c45 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import java.util.concurrent.LinkedBlockingQueue; import org.springframework.scheduling.SchedulingAwareRunnable; import org.springframework.util.Assert; - /** * A client connection factory that creates {@link TcpNioConnection}s. * diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java index 4a7b478a48..4ea7ef20bb 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.nio.channels.SocketChannel; import org.springframework.context.ApplicationEventPublisher; import org.springframework.lang.Nullable; - /** * Used by NIO connection factories to instantiate a {@link TcpNioConnection} object. * Implementations for SSL and non-SSL {@link TcpNioConnection}s are provided. diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java index 7c3f20fb47..99f66a1b3c 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; - /** * Reads data in an InputStream to a byte[]; data must be preceded by * a binary length (network byte order, not included in resulting byte[]). diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java index b6b57190fc..d434635de4 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2023 the original author or authors. + * Copyright 2001-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,6 @@ public class MulticastSendingMessageHandler extends UnicastSendingMessageHandler super(address, port, lengthCheck); } - /** * Constructs a MulticastSendingMessageHandler to send data to the multicast address/port * and enables setting the acknowledge option, where the destination sends a receipt acknowledgment. @@ -178,7 +177,6 @@ public class MulticastSendingMessageHandler extends UnicastSendingMessageHandler } } - /** * If acknowledge = true; how many acks needed for success. * @param minAcksForSuccess The minimum number of acks that will represent success. diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java index 2327396221..a37f4971f8 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,4 +157,5 @@ public final class TestingUtilities { } throw new IllegalStateException("Connections=" + factory.getOpenConnectionIds().size() + "wanted=" + n); } + } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBeanTest.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBeanTest.java index 9e319836fc..2bf70c4a16 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBeanTest.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ public class TcpConnectionFactoryFactoryBeanTest { assertThat(TestUtils.getPropertyValue(fb.getObject(), "readDelay")).isEqualTo(100L); } - @Test public void testReadDelay() throws Exception { TcpConnectionFactoryFactoryBean fb = new TcpConnectionFactoryFactoryBean(); diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/dsl/IpIntegrationTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/dsl/IpIntegrationTests.java index 9e5501d08c..b283e158f6 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/dsl/IpIntegrationTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/dsl/IpIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -207,16 +207,11 @@ public class IpIntegrationTests { .get(); CountDownLatch latch = new CountDownLatch(1); AtomicInteger port = new AtomicInteger(); - class Listener implements ApplicationListener { - - @Override - public void onApplicationEvent(TcpConnectionServerListeningEvent event) { - port.set(event.getPort()); - latch.countDown(); - } - - } - this.applicationContext.addApplicationListener(new Listener()); + this.applicationContext.addApplicationListener( + (ApplicationListener) event -> { + port.set(event.getPort()); + latch.countDown(); + }); this.flowContext.registration(server) .id("streamCloseServer") .register(); diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/AutoStartTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/AutoStartTests.java index 5f2b9ffef5..f4aa907bd7 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/AutoStartTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/AutoStartTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,4 +64,5 @@ public class AutoStartTests { tcpNetIn.stop(); TestingUtilities.waitStopListening(cfS1, null); } + } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests.java index d9a7d97240..2af062a8f7 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Gary Russell * @author Gunnar Hillert diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/FactoryStopStartTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/FactoryStopStartTests.java index ca7809b02e..209114d7b6 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/FactoryStopStartTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/FactoryStopStartTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import org.junit.Test; import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory; import org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory; - /** * @author Gary Russell * @since 2.0.4 @@ -42,4 +41,5 @@ public class FactoryStopStartTests { public static void main(String[] args) { new FactoryStopStartTests().testRestart(); } + } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpConfigOutboundGatewayTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpConfigOutboundGatewayTests.java index f59777d7c8..1d7423cb62 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpConfigOutboundGatewayTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpConfigOutboundGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -223,7 +223,6 @@ public class TcpConfigOutboundGatewayTests { assertThat(new String(bytes).trim()).isEqualTo("echo:test"); } - private void testOutboundUsingConfig() { Message message = MessageBuilder.withPayload("test").build(); requestChannel.send(message); diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpInboundGatewayTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpInboundGatewayTests.java index d242830720..c815fbdb87 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpInboundGatewayTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpInboundGatewayTests.java @@ -345,7 +345,6 @@ public class TcpInboundGatewayTests { client.stop(); } - private void readFully(InputStream is, byte[] buff) throws IOException { for (int i = 0; i < buff.length; i++) { buff[i] = (byte) is.read(); diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java index 2eb7531287..a6d7423d8a 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1096,7 +1096,7 @@ public class TcpOutboundGatewayTests { given(connection.getConnectionId()).willReturn("testId"); willThrow(new RuntimeException("intentional")) .given(connection) - .send(any(Message.class)); + .send(any(Message.class)); willReturn(connection) .given(ccf) diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapterTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapterTests.java index 6dd33f0f87..785237a5bc 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapterTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapterTests.java @@ -654,6 +654,7 @@ public class TcpReceivingChannelAdapterTests extends AbstractTcpChannelAdapterTe public String serviceMethod(byte[] bytes) { throw new RuntimeException("Failed"); } + } } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandlerTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandlerTests.java index 92f18072f3..8c6bb858c6 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandlerTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandlerTests.java @@ -80,7 +80,6 @@ import static org.assertj.core.api.Assertions.fail; import static org.awaitility.Awaitility.await; import static org.mockito.Mockito.mock; - /** * @author Gary Russell * @author Artem Bilan diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingNoSocketTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingNoSocketTests.java index 8f2c7c96f5..8f6fd0a3ef 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingNoSocketTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpSendingNoSocketTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,4 +61,5 @@ public class TcpSendingNoSocketTests { public void exceptionTrapped() { advised.send(new GenericMessage("foo")); } + } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionTimeoutTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionTimeoutTests.java index 9ff83b783e..9b1f4da042 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionTimeoutTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionTimeoutTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -227,6 +227,7 @@ public class ConnectionTimeoutTests { return false; }); server.registerSender(new TcpSender() { + @Override public void addNewConnection(TcpConnection connection) { serverConnection.set(connection); @@ -241,6 +242,7 @@ public class ConnectionTimeoutTests { public void setupClientCallback(AbstractClientConnectionFactory client) { client.setComponentName("clientFactory"); client.registerSender(new TcpSender() { + @Override public void addNewConnection(TcpConnection connection) { } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/HelloWorldInterceptorFactory.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/HelloWorldInterceptorFactory.java index e8b6323006..973a0e3dd6 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/HelloWorldInterceptorFactory.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/HelloWorldInterceptorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.integration.ip.tcp.connection; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; - /** * @author Gary Russell * @since 2.0 diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java index 5685d26338..68f0d56471 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,7 +102,6 @@ public class TcpNioConnectionReadTests { done.countDown(); } - @SuppressWarnings("unchecked") @Test public void testFragmented() throws Exception { diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionTests.java index 12dc1610b5..710b60841b 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,7 +93,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; - /** * @author Gary Russell * @author John Anderson diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpSenderTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpSenderTests.java index b2d183008b..76300c4bd0 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpSenderTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpSenderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; import org.junit.jupiter.api.Test; @@ -33,6 +32,8 @@ import static org.assertj.core.api.Assertions.assertThat; /** * @author Gary Russell * @author Kazuki Shimizu + * @author Artem Bilan + * * @since 5.3.10 * */ @@ -83,7 +84,6 @@ public class TcpSenderTests { AtomicInteger instances = new AtomicInteger(); List addOrder = Collections.synchronizedList(new ArrayList<>()); List remOrder = Collections.synchronizedList(new ArrayList<>()); - AtomicReference thread = new AtomicReference<>(); Map interceptorsPerInstance = new HashMap<>(); List passedConnectionsToSenderViaAddNewConnection = new ArrayList<>(); class InterceptorFactory extends HelloWorldInterceptorFactory { @@ -118,6 +118,7 @@ public class TcpSenderTests { } } + chain.setInterceptor(new InterceptorFactory(), new InterceptorFactory(), new InterceptorFactory()); client.setInterceptorFactoryChain(chain); CountDownLatch firstClosed = new CountDownLatch(1); diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/DeserializationTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/DeserializationTests.java index 1925c3202f..842fc3f231 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/DeserializationTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/DeserializationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import java.net.ServerSocket; import java.net.Socket; import java.nio.ByteBuffer; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicReference; import javax.net.ServerSocketFactory; @@ -33,8 +32,6 @@ import org.junit.Rule; import org.junit.Test; import org.springframework.beans.factory.BeanFactory; -import org.springframework.context.ApplicationEvent; -import org.springframework.context.ApplicationEventPublisher; import org.springframework.core.serializer.DefaultDeserializer; import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.integration.channel.QueueChannel; @@ -57,6 +54,7 @@ import static org.mockito.Mockito.mock; /** * @author Gary Russell * @author Gavin Gray + * @author Artem Bilan * * @since 2.0 */ @@ -183,7 +181,6 @@ public class DeserializationTests { } catch (IOException e) { if (!e.getMessage().startsWith("Message length")) { - e.printStackTrace(); fail("Unexpected IO Error:" + e.getMessage()); } } @@ -206,7 +203,6 @@ public class DeserializationTests { } catch (IOException e) { if (!e.getMessage().startsWith("Read timed out")) { - e.printStackTrace(); fail("Unexpected IO Error:" + e.getMessage()); } } @@ -230,7 +226,6 @@ public class DeserializationTests { } catch (IOException e) { if (!e.getMessage().startsWith("ETX not found")) { - e.printStackTrace(); fail("Unexpected IO Error:" + e.getMessage()); } } @@ -253,7 +248,6 @@ public class DeserializationTests { } catch (IOException e) { if (!e.getMessage().startsWith("Read timed out")) { - e.printStackTrace(); fail("Unexpected IO Error:" + e.getMessage()); } } @@ -277,7 +271,6 @@ public class DeserializationTests { } catch (IOException e) { if (!e.getMessage().startsWith("CRLF not found")) { - e.printStackTrace(); fail("Unexpected IO Error:" + e.getMessage()); } } @@ -289,22 +282,18 @@ public class DeserializationTests { public void canDeserializeMultipleSubsequentTerminators() throws IOException { byte terminator = (byte) '\n'; ByteArraySingleTerminatorSerializer serializer = new ByteArraySingleTerminatorSerializer(terminator); - ByteArrayInputStream inputStream = new ByteArrayInputStream("s\n\n".getBytes()); - try { + try (ByteArrayInputStream inputStream = new ByteArrayInputStream("s\n\n".getBytes())) { byte[] bytes = serializer.deserialize(inputStream); assertThat(bytes.length).isEqualTo(1); assertThat(bytes[0]).isEqualTo("s".getBytes()[0]); bytes = serializer.deserialize(inputStream); assertThat(bytes.length).isEqualTo(0); } - finally { - inputStream.close(); - } } @Test - public void deserializationEvents() throws Exception { + public void deserializationEvents() { doDeserialize(new ByteArrayCrLfSerializer(), "CRLF not found before max message length: 5"); doDeserialize(new ByteArrayLengthHeaderSerializer(), "Message length 1718579042 exceeds max message length: 5"); TcpDeserializationExceptionEvent event = doDeserialize(new ByteArrayLengthHeaderSerializer(), @@ -330,24 +319,11 @@ public class DeserializationTests { private TcpDeserializationExceptionEvent doDeserialize(AbstractByteArraySerializer deser, String expectedMessage, byte[] data, int mms) { - final AtomicReference event = - new AtomicReference(); - class Publisher implements ApplicationEventPublisher { - @Override - public void publishEvent(ApplicationEvent anEvent) { - event.set((TcpDeserializationExceptionEvent) anEvent); - } + AtomicReference event = new AtomicReference<>(); - @Override - public void publishEvent(Object event) { - - } - - } - Publisher publisher = new Publisher(); ByteArrayInputStream bais = new ByteArrayInputStream(data); - deser.setApplicationEventPublisher(publisher); + deser.setApplicationEventPublisher(anEvent -> event.set((TcpDeserializationExceptionEvent) anEvent)); deser.setMaxMessageSize(mms); try { deser.deserialize(bais); @@ -362,16 +338,16 @@ public class DeserializationTests { } @Test - public void testTimeoutWithCustomDeserializer() throws Exception { + public void testTimeoutWithCustomDeserializer() { testTimeoutWhileDecoding(new CustomDeserializer(), "\u0000\u0002\u0000\u0005reply"); } @Test - public void testTimeoutWithRawDeserializer() throws Exception { + public void testTimeoutWithRawDeserializer() { testTimeoutWhileDecoding(new ByteArrayRawSerializer(), "reply"); } - public void testTimeoutWhileDecoding(AbstractByteArraySerializer deserializer, String reply) throws Exception { + private void testTimeoutWhileDecoding(AbstractByteArraySerializer deserializer, String reply) { ByteArrayRawSerializer serializer = new ByteArrayRawSerializer(); TcpNioServerConnectionFactory serverNio = new TcpNioServerConnectionFactory(0); ByteArrayLengthHeaderSerializer lengthHeaderSerializer = new ByteArrayLengthHeaderSerializer(1); @@ -407,23 +383,21 @@ public class DeserializationTests { // eat SocketTimeoutException. Doesn't matter for this test } }; - Executor exec = new SimpleAsyncTaskExecutor("-"); + try (SimpleAsyncTaskExecutor exec = new SimpleAsyncTaskExecutor("-")) { + exec.execute(command); + } - Message message; - - // short reply should not be received. - exec.execute(command); - message = serverSideChannel.receive(10000); + Message message = serverSideChannel.receive(10000); assertThat(message).isNotNull(); assertThat(new String((byte[]) message.getPayload())).isEqualTo("Test"); String shortReply = reply.substring(0, reply.length() - 1); - ((MessageChannel) message.getHeaders().getReplyChannel()).send(new GenericMessage(shortReply)); + ((MessageChannel) message.getHeaders().getReplyChannel()).send(new GenericMessage<>(shortReply)); message = outputChannel.receive(1000); assertThat(message).isNull(); } @Test - public void testTimeoutWithRawDeserializerEofIsTerminator() throws Exception { + public void testTimeoutWithRawDeserializerEofIsTerminator() { ByteArrayRawSerializer serializer = new ByteArrayRawSerializer(); TcpNioServerConnectionFactory serverNio = new TcpNioServerConnectionFactory(0); ByteArrayLengthHeaderSerializer lengthHeaderSerializer = new ByteArrayLengthHeaderSerializer(1); @@ -459,15 +433,15 @@ public class DeserializationTests { // eat SocketTimeoutException. Doesn't matter for this test } }; - Executor exec = new SimpleAsyncTaskExecutor("testTimeoutWithRawDeserializerEofIsTerminator-"); - Message message; + try (SimpleAsyncTaskExecutor exec = new SimpleAsyncTaskExecutor("testTimeoutWithRawDeserializerEofIsTerminator-")) { + exec.execute(command); + } - exec.execute(command); - message = serverSideChannel.receive(10000); + Message message = serverSideChannel.receive(10000); assertThat(message).isNotNull(); assertThat(new String((byte[]) message.getPayload())).isEqualTo("Test"); - ((MessageChannel) message.getHeaders().getReplyChannel()).send(new GenericMessage("reply")); + ((MessageChannel) message.getHeaders().getReplyChannel()).send(new GenericMessage<>("reply")); message = outputChannel.receive(10000); assertThat(message).isNotNull(); assertThat(new String(((byte[]) message.getPayload()))).isEqualTo("reply"); @@ -529,7 +503,7 @@ public class DeserializationTests { } @Override - public void serialize(byte[] object, OutputStream outputStream) throws IOException { + public void serialize(byte[] object, OutputStream outputStream) { } } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/LengthHeaderSerializationTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/LengthHeaderSerializationTests.java index 56fc32a1cb..72afa59481 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/LengthHeaderSerializationTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/LengthHeaderSerializationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; - /** * @author Gary Russell * @author Artem Bilan diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializerTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializerTests.java index 88b40522c4..47815106eb 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializerTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,4 +41,5 @@ public class MapJsonSerializerTests { map = deserializer.deserialize(bais); assertThat(map).isNotNull(); } + } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/MultiClientTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/MultiClientTests.java index af67ac5e0b..20561a764a 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/MultiClientTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/MultiClientTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import org.springframework.messaging.Message; import static org.assertj.core.api.Assertions.assertThat; - /** * * For both .net. and .nio. adapters, creates a single server and 10 clients diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/SyslogdTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/SyslogdTests.java index 2888a5b7f1..0dbbae3aaa 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/SyslogdTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/SyslogdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,4 +36,5 @@ public class SyslogdTests { System.in.read(); ctx.close(); } + } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpMulticastEndToEndTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpMulticastEndToEndTests.java index fe82b08330..e8f651fe03 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpMulticastEndToEndTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpMulticastEndToEndTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,6 @@ public class UdpMulticastEndToEndTests implements Runnable { private static long hangAroundFor = 0; - @Test public void runIt() throws Exception { String location = "org/springframework/integration/ip/udp/testIp-out-multicast-context.xml"; @@ -198,7 +197,6 @@ public class UdpMulticastEndToEndTests implements Runnable { ctx.close(); } - public static void main(String[] args) throws Exception { hangAroundFor = 120000; new UdpMulticastEndToEndTests().runIt(); diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpUnicastEndToEndTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpUnicastEndToEndTests.java index 09fcc92843..7b4c64a787 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpUnicastEndToEndTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/udp/UdpUnicastEndToEndTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -124,7 +124,6 @@ public class UdpUnicastEndToEndTests implements Runnable { return applicationContext; } - public void launchSender(ApplicationContext applicationContext) throws Exception { DestinationResolver channelResolver = new BeanFactoryChannelResolver(applicationContext); MessageChannel inputChannel = channelResolver.resolveDestination("inputChannel"); @@ -213,7 +212,6 @@ public class UdpUnicastEndToEndTests implements Runnable { ctx.close(); } - public static void main(String[] args) throws Exception { hangAroundFor = 120000; new UdpUnicastEndToEndTests().runIt(); diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java index 7b2b95e2cb..f97ca072b7 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,6 @@ import org.springframework.lang.Nullable; import org.springframework.messaging.Message; import org.springframework.util.Assert; - /** * This class is used by all Stored Procedure (Stored Function) components and * provides the core functionality to execute those. @@ -132,7 +131,6 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { private boolean returnValueRequired = false; - /** * Constructor taking {@link DataSource} from which the DB Connection can be * obtained. diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java index 24d058f3cf..fa3ca55948 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import org.springframework.messaging.Message; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; - /** * A message handler that executes Stored Procedures for update purposes. * diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java index 7a576b0d16..784d99c2bc 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ import org.springframework.util.xml.DomUtils; */ public final class StoredProcParserUtils { - private static final Log LOGGER = LogFactory.getLog(StoredProcParserUtils.class); private StoredProcParserUtils() { diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java index e01bee4d27..9261f02f14 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java @@ -611,7 +611,6 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto this.idCacheReadLock.unlock(); } - Assert.state(messages.size() < 2, () -> "The query must return zero or 1 row; got " + messages.size() + " rows"); if (messages.size() > 0) { diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java index 3a0c6a2aab..77c7a21ac8 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundChannelAdapterWithinChainTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ public class StoredProcOutboundChannelAdapterWithinChainTests { @Autowired private MessageChannel jdbcStoredProcOutboundChannelAdapterWithinChain; - @Test public void test() { Message message = MessageBuilder.withPayload(new User("username", "password", "email")).build(); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithNamespaceIntegrationTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithNamespaceIntegrationTests.java index 472a2a31af..845057bbd4 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithNamespaceIntegrationTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithNamespaceIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,7 +133,6 @@ public class StoredProcOutboundGatewayWithNamespaceIntegrationTests { } - static class Consumer { private final BlockingQueue>> messages = new LinkedBlockingQueue<>(); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithSpringContextIntegrationTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithSpringContextIntegrationTests.java index 2e2af7ada2..55d35f4398 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithSpringContextIntegrationTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcOutboundGatewayWithSpringContextIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,6 @@ public class StoredProcOutboundGatewayWithSpringContextIntegrationTests { } - static class Consumer { private final BlockingQueue>> messages = new LinkedBlockingQueue<>(); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapterWithNamespace2IntegrationTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapterWithNamespace2IntegrationTests.java index 4e6dff1e60..54db506403 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapterWithNamespace2IntegrationTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapterWithNamespace2IntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,6 +80,7 @@ public class StoredProcPollingChannelAdapterWithNamespace2IntegrationTests { } return Integer.valueOf(count.incrementAndGet()); } + } static class Consumer { @@ -94,5 +95,7 @@ public class StoredProcPollingChannelAdapterWithNamespace2IntegrationTests { Message> poll(long timeoutInMillis) throws InterruptedException { return messages.poll(timeoutInMillis, TimeUnit.MILLISECONDS); } + } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/channel/PostgresChannelMessageTableSubscriberTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/channel/PostgresChannelMessageTableSubscriberTests.java index bf88968390..d5f50bb9ed 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/channel/PostgresChannelMessageTableSubscriberTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/channel/PostgresChannelMessageTableSubscriberTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -112,7 +112,6 @@ public class PostgresChannelMessageTableSubscriberTests implements PostgresConta POSTGRES_CONTAINER.getPassword()) .unwrap(PgConnection.class)); - this.taskExecutor = new ThreadPoolTaskExecutor(); this.taskExecutor.setCorePoolSize(10); this.taskExecutor.setWaitForTasksToCompleteOnShutdown(true); @@ -134,7 +133,6 @@ public class PostgresChannelMessageTableSubscriberTests implements PostgresConta this.taskExecutor.shutdown(); } - @Test public void testMessagePollMessagesAddedAfterStart() throws Exception { CountDownLatch latch = new CountDownLatch(2); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/InnerPollerParserTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/InnerPollerParserTests.java index e9f728ec63..d6616f79ce 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/InnerPollerParserTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/InnerPollerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,4 +157,5 @@ public class InnerPollerParserTests { .isTrue(); } } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcMessageStoreParserTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcMessageStoreParserTests.java index 4fa54f2889..c37cbc1eec 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcMessageStoreParserTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcMessageStoreParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,7 +92,6 @@ public class JdbcMessageStoreParserTests { context = new ClassPathXmlApplicationContext(name, cls); } - public static class EnhancedSerializer implements Serializer, Deserializer { private final Serializer targetSerializer = new DefaultSerializer(); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayParserTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayParserTests.java index 501823f8c2..0117083c11 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayParserTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayParserTests.java @@ -171,7 +171,6 @@ public class JdbcOutboundGatewayParserTests { new DirectFieldAccessor(pollerJdbcTemplate).setPropertyValue("logger", logger); - Message message = MessageBuilder.withPayload(Collections.singletonMap("foo", "bar")).build(); this.channel.send(message); @@ -277,7 +276,6 @@ public class JdbcOutboundGatewayParserTests { PollableChannel outbound = this.context.getBean("replyChannel", PollableChannel.class); Message reply = outbound.receive(10000); - assertThat(reply) .isNotNull() .extracting(Message::getPayload) @@ -289,7 +287,6 @@ public class JdbcOutboundGatewayParserTests { .containsEntry("name", "bar")); } - @AfterEach public void tearDown() { if (this.context != null) { diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcTypesEnumTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcTypesEnumTests.java index 4444e7d423..19962cde7a 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcTypesEnumTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcTypesEnumTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,4 +71,5 @@ public class JdbcTypesEnumTests { fail("Expected Exception"); } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParserTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParserTests.java index 6871b58f01..034502726d 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParserTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -192,4 +192,5 @@ public class StoredProcMessageHandlerParserTests { } } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParserTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParserTests.java index 49a93699ef..85a9d108b1 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParserTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -231,7 +231,6 @@ public class StoredProcOutboundGatewayParserTests { } - @SuppressWarnings("unchecked") @Test public void testSqlParametersAreSet() throws Exception { @@ -304,4 +303,5 @@ public class StoredProcOutboundGatewayParserTests { } } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcPollingChannelAdapterParserTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcPollingChannelAdapterParserTests.java index a679ce6a76..3e4ee22c5c 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcPollingChannelAdapterParserTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/StoredProcPollingChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,7 +93,6 @@ public class StoredProcPollingChannelAdapterParserTests { assertThat(cacheSize).as("Wrong Default JdbcCallOperations Cache Size").isEqualTo(Integer.valueOf(10)); } - @Test public void testJdbcCallOperationsCacheSizeIsSet() { setUp("storedProcPollingChannelAdapterParserTest2.xml", getClass()); @@ -215,7 +214,6 @@ public class StoredProcPollingChannelAdapterParserTests { } - @SuppressWarnings("unchecked") @Test public void testSqlParametersAreSet() throws Exception { diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java index 0e6be45ac1..e5ccbb8309 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -362,7 +362,6 @@ public class JdbcLockRegistryTests { //capacity limit test assertThat(getRegistryLocks(registry)).hasSize(CAPACITY_CNT); - registry.expireUnusedOlderThan(-1000); assertThat(getRegistryLocks(registry)).isEmpty(); } @@ -511,4 +510,5 @@ public class JdbcLockRegistryTests { private static String toUUID(String key) { return UUIDConverter.getUUID(key).toString(); } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests.java index bb637ad376..f0268aab2f 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public class JdbcMetadataStoreTests { @Autowired private DataSource dataSource; - private JdbcMetadataStore metadataStore; @BeforeEach diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java index 8ee28f49e4..cf5eb58d2d 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -129,6 +129,7 @@ public class MySqlJdbcMessageStoreMultipleChannelTests { res.add(message); return res; } + } public static class ServiceActivator { @@ -161,5 +162,7 @@ public class MySqlJdbcMessageStoreMultipleChannelTests { countDownLatch2.countDown(); } + } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests.java index 783e463959..6ec14b0996 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,6 @@ public class JdbcMessageStoreChannelTests { @Qualifier("service-activator") private AbstractEndpoint serviceActivator; - @Before public void init() { Service.reset(1); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java index 0dbb779c75..29a7b9062b 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java @@ -546,7 +546,6 @@ public class JdbcMessageStoreTests { assertThat(this.messageStore.getMessageGroup(groupId).getCondition()).isEqualTo("testCondition"); } - @Test @Transactional(propagation = Propagation.NEVER) public void testMessageGroupStreamNoConnectionPoolLeak() throws NoSuchMethodException { diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests.java index 96c5136a8e..4813bdeda1 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import org.junit.Ignore; import org.springframework.test.context.ContextConfiguration; - /** * * @author Gunnar Hillert diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/OracleTxTimeoutMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/OracleTxTimeoutMessageStoreTests.java index 7e9326244c..071371494a 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/OracleTxTimeoutMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/OracleTxTimeoutMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import org.junit.Ignore; import org.springframework.test.context.ContextConfiguration; - /** * * @author Gunnar Hillert diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/PostgresTxTimeoutMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/PostgresTxTimeoutMessageStoreTests.java index 14f6ad5f1c..83871310b1 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/PostgresTxTimeoutMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/PostgresTxTimeoutMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import org.junit.Ignore; import org.springframework.test.context.ContextConfiguration; - /** * * @author Gunnar Hillert diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/ClobSqlReturnType.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/ClobSqlReturnType.java index 33e0eddcb6..d35924e5fa 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/ClobSqlReturnType.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/ClobSqlReturnType.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,4 +33,5 @@ public class ClobSqlReturnType implements SqlReturnType { Clob clob = cs.getClob(paramIndex); return clob != null ? clob.getSubString(1, (int) clob.length()) : null; } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/CreateUser.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/CreateUser.java index 6ed3346cb1..459de47b76 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/CreateUser.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/CreateUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,5 +22,7 @@ package org.springframework.integration.jdbc.storedproc; * */ public interface CreateUser { + void createUser(User user); + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/PrimeMapper.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/PrimeMapper.java index 90427f8cd3..f1989de4c2 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/PrimeMapper.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/PrimeMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ import org.springframework.jdbc.core.RowMapper; * */ public class PrimeMapper implements RowMapper { + public Integer mapRow(ResultSet rs, int rowNum) throws SQLException { return rs.getInt("PRIME"); } + } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/User.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/User.java index 4b816925be..03c2024827 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/User.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/User.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.integration.jdbc.storedproc; * */ public class User { + private final String username; private final String password; diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/UserMapper.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/UserMapper.java index a2c39b5a15..a12653dc12 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/UserMapper.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/storedproc/UserMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ import org.springframework.jdbc.core.RowMapper; * */ public class UserMapper implements RowMapper { + public User mapRow(ResultSet rs, int rowNum) throws SQLException { return new User(rs.getString("username"), rs.getString("password"), rs.getString("email")); } + } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java index 951e1d531b..4efc99655c 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,13 +31,11 @@ public abstract class AbstractJmsChannel extends AbstractMessageChannel { private final JmsTemplate jmsTemplate; - public AbstractJmsChannel(JmsTemplate jmsTemplate) { Assert.notNull(jmsTemplate, "jmsTemplate must not be null"); this.jmsTemplate = jmsTemplate; } - JmsTemplate getJmsTemplate() { return this.jmsTemplate; } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java index 1d1daa9834..3ca51ce9f8 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java @@ -692,6 +692,7 @@ public class ChannelPublishingJmsMessageListener } } } + } } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java index 1781832f54..a31bb36b3d 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,6 @@ public class DefaultJmsHeaderMapper extends JmsHeaderMapper { Arrays.asList(Boolean.class, Byte.class, Double.class, Float.class, Integer.class, Long.class, Short.class, String.class, byte[].class); - private static final Log LOGGER = LogFactory.getLog(DefaultJmsHeaderMapper.class); private volatile String inboundPrefix = ""; diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DynamicJmsTemplateProperties.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DynamicJmsTemplateProperties.java index a41f3de2e5..df352b86d1 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DynamicJmsTemplateProperties.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DynamicJmsTemplateProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ abstract class DynamicJmsTemplateProperties { private static final ThreadLocal TIME_TO_LIVE_HOLDER = new ThreadLocal<>(); - private DynamicJmsTemplateProperties() { } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java index 2676cc38d1..e4f4d49588 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ import org.springframework.util.Assert; */ public class JmsDestinationPollingSource extends AbstractMessageSource { - private final JmsTemplate jmsTemplate; private volatile Destination destination; diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java index 8a07a7860b..6f73a90368 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -661,7 +661,6 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler .acceptIfNotNull(this.replyContainerProperties.getTaskExecutor(), container::setTaskExecutor); - if (this.replyContainerProperties.getTaskExecutor() == null) { // set the beanName so the default TE threads get a meaningful name String containerBeanName = this.getComponentName(); @@ -673,7 +672,6 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler } } - @Override public void start() { this.lifeCycleMonitor.lock(); @@ -1005,7 +1003,6 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler } } - /* * If the replyTo is not temporary, and the connection is lost while waiting for a reply, reconnect for * up to receiveTimeout. @@ -1365,7 +1362,6 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler return this.replyDestination; } - @Override protected void validateConfiguration() { if (isSubscriptionDurable() && !isPubSubDomain()) { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java index cc937256da..e192db5936 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { private EvaluationContext evaluationContext; - public JmsSendingMessageHandler(JmsTemplate jmsTemplate) { Assert.notNull(jmsTemplate, "'jmsTemplate' must not be null"); this.jmsTemplate = jmsTemplate; @@ -224,7 +223,6 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { } } - private record HeaderMappingMessagePostProcessor(Message integrationMessage, JmsHeaderMapper headerMapper) implements MessagePostProcessor { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java index 10f2eaefeb..126e5fd9cc 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -182,7 +182,6 @@ public class SubscribableJmsChannel extends AbstractJmsChannel } } - private static final class DispatchingMessageListener implements MessageListener { private final Log logger = LogFactory.getLog(this.getClass()); @@ -197,7 +196,6 @@ public class SubscribableJmsChannel extends AbstractJmsChannel private final MessageBuilderFactory messageBuilderFactory; - DispatchingMessageListener(JmsTemplate jmsTemplate, MessageDispatcher dispatcher, SubscribableJmsChannel channel, boolean isPubSub, MessageBuilderFactory messageBuilderFactory) { @@ -209,7 +207,6 @@ public class SubscribableJmsChannel extends AbstractJmsChannel this.messageBuilderFactory = messageBuilderFactory; } - @Override public void onMessage(jakarta.jms.Message message) { Message messageToSend = null; diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java index e904cdfe81..f2248c69d4 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -142,7 +142,6 @@ public class JmsChannelFactoryBean extends AbstractFactoryBean interceptors) { this.interceptors = interceptors; } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelParser.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelParser.java index b9475eafed..6a3ee4f440 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelParser.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ public class JmsChannelParser extends AbstractChannelParser { private static final String ACKNOWLEDGE_ATTRIBUTE = "acknowledge"; - @Override protected BeanDefinitionBuilder buildBeanDefinition(Element element, ParserContext parserContext) { BeanDefinitionBuilder builder = diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointParser.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointParser.java index d50afdf003..743c79e3d0 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointParser.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,6 @@ public class JmsMessageDrivenEndpointParser extends AbstractSingleBeanDefinition private static final String EXPLICIT_QOS_ENABLED_FOR_REPLIES = "explicit-qos-enabled-for-replies"; - private static final String[] CONTAINER_ATTRIBUTES = { JmsParserUtils.CONNECTION_FACTORY_PROPERTY, @@ -74,15 +73,12 @@ public class JmsMessageDrivenEndpointParser extends AbstractSingleBeanDefinition "client-id", "task-executor" }; - private final boolean expectReply; - public JmsMessageDrivenEndpointParser(boolean expectReply) { this.expectReply = expectReply; } - @Override protected String getBeanClassName(Element element) { return JmsMessageDrivenEndpoint.class.getName(); @@ -197,7 +193,6 @@ public class JmsMessageDrivenEndpointParser extends AbstractSingleBeanDefinition return element.getAttribute("container"); } - private boolean hasExternalContainer(Element element) { return element.hasAttribute("container"); } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java index ca1cab8849..78674d8137 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,7 +144,6 @@ public class JmsInboundGatewaySpec> return _this(); } - /** * Set a SpEL expression to resolve a 'replyTo' destination from a request {@link jakarta.jms.Message} * as a root evaluation object if {@link jakarta.jms.Message#getJMSReplyTo()} is null. diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsOutboundGatewaySpec.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsOutboundGatewaySpec.java index 90172547e2..c51df9ba42 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsOutboundGatewaySpec.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsOutboundGatewaySpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -300,7 +300,6 @@ public class JmsOutboundGatewaySpec extends MessageHandlerSpec transform(Throwable t) { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/GlobalChannelInterceptorTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/GlobalChannelInterceptorTests.java index 7ba626d8d9..058ffca054 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/GlobalChannelInterceptorTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/GlobalChannelInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,6 @@ public class GlobalChannelInterceptorTests extends ActiveMQMultiContextTests { assertThat(interceptors.get(0) instanceof SampleInterceptor).isTrue(); } - public static class SampleInterceptor implements ChannelInterceptor { } diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java index e495d97147..0c33c83919 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,6 @@ public class InboundOneWayErrorTests extends ActiveMQMultiContextTests { assertThat(this.errorHandler.lastError).isNull(); } - public static class TestService { public void process(Object o) { @@ -95,7 +94,6 @@ public class InboundOneWayErrorTests extends ActiveMQMultiContextTests { } - @SuppressWarnings("serial") private static class TestException extends RuntimeException { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelParserTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelParserTests.java index 04312d80b7..81ff5f374e 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelParserTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsChannelParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -179,7 +179,6 @@ public class JmsChannelParserTests extends ActiveMQMultiContextTests { .isSameAs(this.messageBuilderFactory); } - @Test public void topicNameChannel() { assertThat(topicNameChannel.getClass()).isEqualTo(SubscribableJmsChannel.class); @@ -320,7 +319,6 @@ public class JmsChannelParserTests extends ActiveMQMultiContextTests { assertThat(container.getDestinationName()).isEqualTo("custom.container.queue"); } - static class TestDestinationResolver implements DestinationResolver { @Autowired @@ -340,7 +338,6 @@ public class JmsChannelParserTests extends ActiveMQMultiContextTests { } - static class TestInterceptor implements ChannelInterceptor { } diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsDynamicDestinationTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsDynamicDestinationTests.java index 4e20c2582d..a9ff25ceb0 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsDynamicDestinationTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsDynamicDestinationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,6 @@ public class JmsDynamicDestinationTests extends ActiveMQMultiContextTests { assertThat(result2.getPayload()).isEqualTo("test-2!!"); } - public static class Responder { public String one(String message) { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointTests.java index 48dd357645..ce9435eb9a 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageDrivenEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2022 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public class JmsMessageDrivenEndpointTests extends ActiveMQMultiContextTests { "a MessageListener configured since the endpoint configures its own listener implementation."); } - @Test public void testStopStart(@Autowired JmsTemplate template, @Autowired JmsMessageDrivenEndpoint endpoint, @Autowired QueueChannel out) { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java index b9a28292b9..93fb48b4a4 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests { assertThat(event2.getProperty(MessageHistory.NAME_PROPERTY)).isEqualTo("jmsInputChannel"); } - public interface SampleGateway { void send(String value); @@ -81,7 +80,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests { } - public static class SampleService { public Message echoMessage(String value) { @@ -90,7 +88,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests { } - public static class SampleHeaderMapper extends DefaultJmsHeaderMapper { public void fromHeaders(MessageHeaders headers, jakarta.jms.Message jmsMessage) { @@ -127,7 +124,6 @@ public class JmsMessageHistoryTests extends ActiveMQMultiContextTests { } - public static class SampleComponent implements NamedComponent { private String name; diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundChannelAdapterParserTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundChannelAdapterParserTests.java index 4efd94d0fb..bc661eb567 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundChannelAdapterParserTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -209,4 +209,5 @@ public class JmsOutboundChannelAdapterParserTests { } } + } diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java index aa3da36715..4276d8267e 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -197,7 +197,6 @@ public class JmsOutboundGatewayParserTests extends ActiveMQMultiContextTests { } } - public interface SampleGateway { String echo(String value); diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsPriorityTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsPriorityTests.java index 0a5b039de0..ca7f9cab96 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsPriorityTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsPriorityTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,7 +96,6 @@ public class JmsPriorityTests extends ActiveMQMultiContextTests { assertThat(result.getPayload()).isEqualTo("priority=8"); } - public static class PriorityReader implements SessionAwareMessageListener { public void onMessage(jakarta.jms.Message request, Session session) throws JMSException { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsWithMarshallingMessageConverterTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsWithMarshallingMessageConverterTests.java index 47b5eaa96b..1589cb407f 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsWithMarshallingMessageConverterTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsWithMarshallingMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,6 @@ public class JmsWithMarshallingMessageConverterTests extends ActiveMQMultiContex assertThat(replyMessage.getPayload()).isEqualTo("HELLO"); } - public static class SampleService { public String echo(String value) { @@ -77,7 +76,6 @@ public class JmsWithMarshallingMessageConverterTests extends ActiveMQMultiContex } - public static class SampleMarshaller implements Marshaller { public void marshal(Object graph, Result result) throws IOException, XmlMappingException { @@ -97,7 +95,6 @@ public class JmsWithMarshallingMessageConverterTests extends ActiveMQMultiContex } - public static class SampleUnmarshaller implements Unmarshaller { public boolean supports(Class clazz) { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/MiscellaneousTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/MiscellaneousTests.java index 3a7aca2bde..d07d491905 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/MiscellaneousTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/MiscellaneousTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class MiscellaneousTests extends ActiveMQMultiContextTests { } } - private void exchange(CountDownLatch latch, RequestReplyExchanger gateway, AtomicInteger replies) { new Thread(() -> { try { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCachedConsumersTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCachedConsumersTests.java index 616451ec78..5f4286c421 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCachedConsumersTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCachedConsumersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -210,7 +210,6 @@ public class RequestReplyScenariosWithCachedConsumersTests extends ActiveMQMulti latch.await(); - TestUtils.getPropertyValue(context.getBean("fastGateway"), "handler", JmsOutboundGateway.class) .setReceiveTimeout(10000); Thread.sleep(1000); diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCorrelationKeyProvidedTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCorrelationKeyProvidedTests.java index 6e86c4ac9b..e5bce0e270 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCorrelationKeyProvidedTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/request_reply/RequestReplyScenariosWithCorrelationKeyProvidedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,6 @@ public class RequestReplyScenariosWithCorrelationKeyProvidedTests extends Active new ClassPathXmlApplicationContext("explicit-correlation-key.xml", this.getClass()); RequestReplyExchanger gateway = context.getBean("explicitCorrelationKeyGatewayC", RequestReplyExchanger.class); - for (int i = 0; i < 3; i++) { try { gateway.exchange(MessageBuilder.withPayload("hello").build()); @@ -97,7 +96,6 @@ public class RequestReplyScenariosWithCorrelationKeyProvidedTests extends Active context.close(); } - public static class DelayedService { public String echo(String s) throws Exception { diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java index 483f937b04..246b679cfa 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ public class AttributePollingMessageSource extends AbstractMessageSource private volatile MBeanServerConnection server; - /** * Provide the MBeanServer where the JMX MBean has been registered. * diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultNotificationMapper.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultNotificationMapper.java index be67da4d67..8faf061dd2 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultNotificationMapper.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultNotificationMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,13 +46,11 @@ class DefaultNotificationMapper implements OutboundMessageMapper { private final AtomicLong sequence = new AtomicLong(); - DefaultNotificationMapper(ObjectName sourceObjectName, @Nullable String defaultNotificationType) { this.sourceObjectName = sourceObjectName; this.defaultNotificationType = defaultNotificationType; } - public Notification fromMessage(Message message) { String type = resolveNotificationType(message); Assert.hasText(type, "No notification type header is available, and no default has been provided."); diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java index f12e80010a..fbbda7ca0b 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.integration.jmx; import javax.management.MBeanServerConnection; import javax.management.ObjectInstance; - /** * @author Stuart Williams * @since 3.0 diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java index f003962412..7275504124 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport private Object handback; - /** * Provide a reference to the MBeanServer where the notification * publishing MBeans are registered. diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java index 8a4b1e27b9..81f24215e7 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,6 @@ public class NotificationPublishingMessageHandler extends AbstractMessageHandler } } - /** * Set a mapper for creating Notifications from a Message. If not provided, * a default implementation will be used such that String-typed payloads will be @@ -141,7 +140,6 @@ public class NotificationPublishingMessageHandler extends AbstractMessageHandler this.delegate.publish(this.notificationMapper.fromMessage(message)); } - /** * Simple class used for the actual MBean instances to be registered. * Exposed to standard MBEs as well as the IMBE for backwards compatibility. diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java index 83e7205d67..ceb2c2414e 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,6 @@ public class OperationInvokingMessageHandler extends AbstractReplyProducingMessa private boolean expectReply = true; - /** * Construct an instance based on the provided {@link MBeanServerConnection}. * @param server the {@link MBeanServerConnection} to use. diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanExporterParser.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanExporterParser.java index 37c9cc9935..b76d9a4ad0 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanExporterParser.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanExporterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,6 @@ public class MBeanExporterParser extends AbstractSingleBeanDefinitionParser { private static final String MBEAN_EXPORTER_NAME = "mbeanExporter"; - @Override protected boolean shouldGenerateIdAsFallback() { return true; diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParser.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParser.java index de726bda7d..6d0a6a5535 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParser.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,6 @@ import org.springframework.integration.jmx.DefaultMBeanObjectConverter; import org.springframework.integration.jmx.MBeanTreePollingMessageSource; import org.springframework.util.StringUtils; - /** * @author Stuart Williams * @author Gary Russell diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java index ba4823c2b9..c86c4295e2 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,14 +58,12 @@ public class AttributePollingMessageSourceTests { factoryBean.destroy(); } - public interface TestCounterMBean { int getCount(); } - public static class TestCounter implements TestCounterMBean { private final AtomicInteger counter = new AtomicInteger(); diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationListeningMessageProducerTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationListeningMessageProducerTests.java index d235a6ae24..54c3c6ab38 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationListeningMessageProducerTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationListeningMessageProducerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public class NotificationListeningMessageProducerTests { private ObjectName objectName; - @BeforeClass public static void setupClass() { serverFactoryBean = new MBeanServerFactoryBean(); @@ -154,7 +153,6 @@ public class NotificationListeningMessageProducerTests { assertThat(notification.getMessage()).isEqualTo("okay"); } - public static class NumberHolder implements NotificationPublisherAware { private final AtomicInteger number = new AtomicInteger(); diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationPublishingMessageHandlerTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationPublishingMessageHandlerTests.java index 894ad781f8..62b6f4e1fc 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationPublishingMessageHandlerTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/NotificationPublishingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,6 @@ public class NotificationPublishingMessageHandlerTests { context.close(); } - @Test public void simplePublish() { MessageHandler handler = context.getBean("testPublisher", MessageHandler.class); diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java index ac89d6da71..946a99f28b 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,7 +83,6 @@ public class OperationInvokingMessageHandlerTests { server.unregisterMBean(ObjectNameManager.getInstance(this.objectName)); } - @Test public void invocationWithMapPayload() { QueueChannel outputChannel = new QueueChannel(); diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/DynamicRouterTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/DynamicRouterTests.java index d667354a1e..19834444da 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/DynamicRouterTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/DynamicRouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,6 @@ public class DynamicRouterTests { @Autowired private NullChannel nullChannel; - @Test @DirtiesContext public void testRouteChange() throws Exception { diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanExporterNameTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanExporterNameTests.java index fb58a12502..7ae997eeac 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanExporterNameTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanExporterNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,9 +33,11 @@ public class MBeanExporterNameTests { } public static class Source { + public String get() { return "foo"; } + } } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationCustomNamingTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationCustomNamingTests.java index e8b0b93c00..b03858d3c9 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationCustomNamingTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationCustomNamingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,9 +65,11 @@ public class MBeanRegistrationCustomNamingTests { } public static class Source { + public String get() { return "foo"; } + } public static class Namer implements ObjectNamingStrategy { diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationTests.java index 58433d878b..d5b143a85f 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanRegistrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,9 +89,11 @@ public class MBeanRegistrationTests { } public static class Source { + public String get() { return "foo"; } + } public static class MyMessagingGateway extends MessagingGatewaySupport { diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParserTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParserTests.java index 16a7789773..5c7bb3b812 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParserTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -216,7 +216,6 @@ public class MBeanTreePollingChannelAdapterParserTests { .extracting(Message::getPayload) .isInstanceOf(HashMap.class); - @SuppressWarnings("unchecked") Map beans = (Map) result.getPayload(); diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingChannelAdapterParserTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingChannelAdapterParserTests.java index 4faea1954e..dfc98b9712 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingChannelAdapterParserTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,6 @@ public class OperationInvokingChannelAdapterParserTests { testBean.messages.clear(); } - @Test public void adapterWithDefaults() { assertThat(testBean.messages.size()).isEqualTo(0); diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingOutboundGatewayTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingOutboundGatewayTests.java index 08d45017ef..1d36ccf691 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingOutboundGatewayTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/OperationInvokingOutboundGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; - /** * @author Oleg Zhurakousky * @author Artem Bilan @@ -78,7 +77,6 @@ public class OperationInvokingOutboundGatewayTests { @Qualifier("operationInvokingWithinChain.handler") private MessageHandler operationInvokingWithinChain; - private static volatile int adviceCalled; @After @@ -168,4 +166,5 @@ public class OperationInvokingOutboundGatewayTests { } } + } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PollingAdapterMBeanTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PollingAdapterMBeanTests.java index 7a5c4b7b06..a042fa87c3 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PollingAdapterMBeanTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PollingAdapterMBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,9 +52,11 @@ public class PollingAdapterMBeanTests { } public static class Source { + public String get() { return "foo"; } + } } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PriorityChannelTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PriorityChannelTests.java index ea429bfa79..56e3cd72f5 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PriorityChannelTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/PriorityChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,9 +65,11 @@ public class PriorityChannelTests { } public static class Source { + public String get() { return "foo"; } + } } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java index b0b143e677..5a191e93a4 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,7 +99,9 @@ public class RouterMBeanTests { } public interface Service { + void send(String input); + } } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanVanillaTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanVanillaTests.java index 534518ea00..ea38bddbe0 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanVanillaTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanVanillaTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,9 +53,11 @@ public class RouterMBeanVanillaTests { } public static class Source { + public String get() { return "foo"; } + } } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/SimpleDynamicRouter.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/SimpleDynamicRouter.java index 760556a6d6..3d85f15e9b 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/SimpleDynamicRouter.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/SimpleDynamicRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ import org.springframework.util.Assert; */ @ManagedResource public class SimpleDynamicRouter { + private final Map channelMappings = new HashMap(); /** @@ -80,4 +81,5 @@ public class SimpleDynamicRouter { String className = key.getClass().getName(); return this.channelMappings.get(className); } + } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ChainWithMessageProducingHandlersTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ChainWithMessageProducingHandlersTests.java index ff5972e462..e3eb35bbce 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ChainWithMessageProducingHandlersTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ChainWithMessageProducingHandlersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,13 +48,18 @@ public class ChainWithMessageProducingHandlersTests { } public static class SampleProducer { + public String echo(String value) { return value; } + } public static class SampleService { + public void echo(String value) { } + } + } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java index c47d73e213..afa198616e 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,6 +95,7 @@ public class RemoteMBeanServerTests { String getFoo(); String fooBar(String foo); + } public static class Tester implements TesterMBean { @@ -110,4 +111,5 @@ public class RemoteMBeanServerTests { } } + } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java index bbb4df45f1..1123db0ad9 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -112,7 +112,6 @@ public class ScatterGatherHandlerIntegrationTests { assertThat((Double) payload).isLessThan(10D); } - @Configuration @EnableIntegration @EnableIntegrationMBeanExport(server = "mBeanServer") @@ -237,7 +236,6 @@ public class ScatterGatherHandlerIntegrationTests { new MessageCountReleaseStrategy(3)); } - @Bean @ServiceActivator(inputChannel = "inputAuctionWithGatherChannel") public ScatterGatherHandler scatterGatherAuctionWithGatherChannel() { diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration_/mbeanexporterhelper/INT_2626Tests.java b/spring-integration-jmx/src/test/java/org/springframework/integration_/mbeanexporterhelper/INT_2626Tests.java index 572280125b..4f4c9f47a8 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration_/mbeanexporterhelper/INT_2626Tests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration_/mbeanexporterhelper/INT_2626Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,4 +31,5 @@ public class INT_2626Tests { public void testInt2626() { new ClassPathXmlApplicationContext("INT-2626-config.xml", this.getClass()).close(); } + } diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/config/xml/JpaNamespaceHandler.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/config/xml/JpaNamespaceHandler.java index 9708316cf6..bd42572b3b 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/config/xml/JpaNamespaceHandler.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/config/xml/JpaNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,4 +37,5 @@ public class JpaNamespaceHandler extends AbstractIntegrationNamespaceHandler { this.registerBeanDefinitionParser("updating-outbound-gateway", new UpdatingJpaOutboundGatewayParser()); this.registerBeanDefinitionParser("retrieving-outbound-gateway", new RetrievingJpaOutboundGatewayParser()); } + } diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java index 8b45dfa2dc..4f2c4967eb 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,24 +36,20 @@ abstract class AbstractJpaOperations implements JpaOperations, InitializingBean private EntityManagerFactory entityManagerFactory; - public void setEntityManager(EntityManager entityManager) { Assert.notNull(entityManager, "The provided entityManager must not be null."); this.entityManager = entityManager; } - protected EntityManager getEntityManager() { return this.entityManager; } - public void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) { Assert.notNull(entityManagerFactory, "The provided entityManagerFactory must not be null."); this.entityManagerFactory = entityManagerFactory; } - @Override public final void afterPropertiesSet() { this.onInit(); diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/DefaultJpaOperations.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/DefaultJpaOperations.java index 7628e285ea..2e79e91d78 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/DefaultJpaOperations.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/DefaultJpaOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,7 +116,6 @@ public class DefaultJpaOperations extends AbstractJpaOperations { return query; } - @Override public List getResultListForClass(Class entityClass, int firstResult, int maxNumberOfResults) { diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java index 16e1994b0b..f5314e741d 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,6 @@ public interface JpaOperations { */ int executeUpdate(String updateQuery, ParameterSource source); - /** * * @param updateQuery The update query. @@ -73,7 +72,6 @@ public interface JpaOperations { */ int executeUpdateWithNativeQuery(String updateQuery, ParameterSource source); - /** * Find an Entity of given type with the given primary key type. * @param The type to return. diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/JpaUtils.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/JpaUtils.java index a1526dc08c..e3155b31d0 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/JpaUtils.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/JpaUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,6 @@ public final class JpaUtils { } - /** * Resolves the alias for the entity to be retrieved from the given JPA query. * @@ -162,4 +161,5 @@ public final class JpaUtils { return em.getMetamodel().entity(entityClass).getName(); } + } diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/BeanPropertyParameterSource.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/BeanPropertyParameterSource.java index 55326615df..279a5d8291 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/BeanPropertyParameterSource.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/BeanPropertyParameterSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ public class BeanPropertyParameterSource implements ParameterSource { private String[] propertyNames; - /** * Create a new BeanPropertySqlParameterSource for the given bean. * @param object the bean instance to wrap @@ -47,7 +46,6 @@ public class BeanPropertyParameterSource implements ParameterSource { this.beanWrapper = PropertyAccessorFactory.forBeanPropertyAccess(object); } - @Override public boolean hasValue(String paramName) { return this.beanWrapper.isReadableProperty(paramName); diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceFactory.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceFactory.java index 8e02be5fdc..041cdcb3ab 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceFactory.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,6 @@ public class ExpressionEvaluatingParameterSourceFactory implements ParameterSour return new ExpressionEvaluatingParameterSource(input, this.parameters, this.expressionEvaluator); } - protected class ExpressionEvaluatingParameterSource implements PositionSupportingParameterSource { private final Object input; diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceUtils.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceUtils.java index 101cc75ef2..8f34f9ecac 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceUtils.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ExpressionEvaluatingParameterSourceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ final class ExpressionEvaluatingParameterSourceUtils { private ExpressionEvaluatingParameterSourceUtils() { } - /** * Utility method that converts a Collection of {@link JpaParameter} to * a Map containing only static parameters. diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/PositionSupportingParameterSource.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/PositionSupportingParameterSource.java index c0b85c944d..ffcb4b1e02 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/PositionSupportingParameterSource.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/PositionSupportingParameterSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.jpa.support.parametersource; - /** * * @author Gunnar Hillert diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaInboundChannelAdapterParserTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaInboundChannelAdapterParserTests.java index af1cc0ec97..2889243d86 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaInboundChannelAdapterParserTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -139,7 +139,6 @@ public class JpaInboundChannelAdapterParserTests { assertThat(TestUtils.getPropertyValue(expression, "expression")).isEqualTo("@maxNumberOfResults"); } - @Test public void testJpaExecutorBeanIdNaming() { JpaExecutor jpaExecutor1 = this.context.getBean("jpaInboundChannelAdapter1.jpaExecutor", JpaExecutor.class); diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaMessageHandlerParserTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaMessageHandlerParserTests.java index 0be1b5cfdd..a83962a231 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaMessageHandlerParserTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaMessageHandlerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ public class JpaMessageHandlerParserTests { public void testJpaMessageHandlerParser() throws Exception { setUp("JpaMessageHandlerParserTests.xml", getClass()); - final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(this.consumer, "inputChannel", AbstractMessageChannel.class); assertThat(inputChannel.getComponentName()).isEqualTo("target"); @@ -134,7 +133,6 @@ public class JpaMessageHandlerParserTests { public void testJpaMessageHandlerParserWithEntityManagerFactory() throws Exception { setUp("JpaMessageHandlerParserTestsWithEmFactory.xml", getClass()); - final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(this.consumer, "inputChannel", AbstractMessageChannel.class); assertThat(inputChannel.getComponentName()).isEqualTo("target"); @@ -233,4 +231,5 @@ public class JpaMessageHandlerParserTests { } } + } diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaOutboundGatewayParserTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaOutboundGatewayParserTests.java index bfd1c0da8f..37da631026 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaOutboundGatewayParserTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/config/xml/JpaOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.verify; - /** * @author Gunnar Hillert * @author Amol Nayak diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java index 78436dd4eb..d2f9b1799f 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/HibernateJpaOperationsTests.java @@ -397,7 +397,6 @@ public class HibernateJpaOperationsTests { assertThat(studentsFromDb).isNotNull(); assertThat(studentsFromDb.size() == 3).isTrue(); - final StudentDomain student = jpaOperations.find(StudentDomain.class, 1001L); assertThat(student).isNotNull(); diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java index dfff5b0167..d7ec7f6d9f 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/dsl/JpaTests.java @@ -86,7 +86,6 @@ public class JpaTests { @Qualifier("retrievingGatewayFlow.input") private MessageChannel retrievingGatewayFlowInput; - @Autowired private PollableChannel retrieveResults; @@ -179,7 +178,6 @@ public class JpaTests { assertThat(student.getGender()).isEqualTo(Gender.FEMALE); } - @Configuration @EnableIntegration public static class ContextConfiguration { diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayIntegrationTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayIntegrationTests.java index ef00c66452..bda1ff2003 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayIntegrationTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,7 +144,6 @@ public class JpaOutboundGatewayIntegrationTests { Message receive = this.findResultChannel.receive(2000); assertThat(receive).isNotNull(); - assertThatExceptionOfType(ReplyRequiredException.class) .isThrownBy(() -> this.findAndDeleteChannel.send(message)); } diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayTests.java index ced7490f38..b0b092cca7 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,6 @@ public class JpaOutboundGatewayTests { assertThat(students).isNotNull().hasSize(1); } - @Test public void deleteNonExistingStudent() { StudentDomain student = JpaTestUtils.getTestStudent(); @@ -153,7 +152,6 @@ public class JpaOutboundGatewayTests { assertThat(students).hasSize(2); } - @Test @Transactional public void testDeleteMany() { diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/JpaTestUtils.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/JpaTestUtils.java index 14937f3aac..899bd097a6 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/JpaTestUtils.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/JpaTestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,4 +73,5 @@ public final class JpaTestUtils { return fb.getObject(); } + } diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/StudentDomain.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/StudentDomain.java index cc499f2fe0..68f220c899 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/StudentDomain.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/StudentDomain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import jakarta.persistence.Table; import jakarta.persistence.Temporal; import jakarta.persistence.TemporalType; - /** * The JPA Entity for the Student class * @@ -114,7 +113,6 @@ public class StudentDomain { this.dateOfBirth = dateOfBirth; } - public Date getLastUpdated() { return lastUpdated; } @@ -154,4 +152,5 @@ public class StudentDomain { setLastUpdated(lastUpdated); return this; } + } diff --git a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/channel/SubscribableKafkaChannel.java b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/channel/SubscribableKafkaChannel.java index ca2fb65eb4..d83ea42b7d 100644 --- a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/channel/SubscribableKafkaChannel.java +++ b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/channel/SubscribableKafkaChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,6 @@ public class SubscribableKafkaChannel extends AbstractKafkaChannel implements Su } } - /** * Set the {@link RecordMessageConverter} to the listener. * @param messageConverter the converter. @@ -177,7 +176,6 @@ public class SubscribableKafkaChannel extends AbstractKafkaChannel implements Su return this.dispatcher.removeHandler(handler); } - private class IntegrationRecordMessageListener extends RecordMessagingMessageListenerAdapter { IntegrationRecordMessageListener() { diff --git a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/config/xml/KafkaInboundGatewayParser.java b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/config/xml/KafkaInboundGatewayParser.java index f7935a57f1..f0f62b9eb4 100644 --- a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/config/xml/KafkaInboundGatewayParser.java +++ b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/config/xml/KafkaInboundGatewayParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import org.springframework.integration.kafka.inbound.KafkaInboundGateway; */ public class KafkaInboundGatewayParser extends AbstractInboundGatewayParser { - @Override protected Class getBeanClass(Element element) { return KafkaInboundGateway.class; diff --git a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/dsl/KafkaDslTests.java b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/dsl/KafkaDslTests.java index fd504945e5..a60fe504aa 100644 --- a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/dsl/KafkaDslTests.java +++ b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/dsl/KafkaDslTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -388,7 +388,6 @@ public class KafkaDslTests { return new DefaultKafkaHeaderMapper(); } - @Bean public IntegrationFlow sourceFlow() { return IntegrationFlow @@ -401,7 +400,6 @@ public class KafkaDslTests { .get(); } - @Bean public IntegrationFlow outboundGateFlow() { return IntegrationFlow.from(Gate.class) diff --git a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageDrivenAdapterTests.java b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageDrivenAdapterTests.java index 480d6c3dfc..28cda08605 100644 --- a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageDrivenAdapterTests.java +++ b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageDrivenAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -281,7 +281,6 @@ class MessageDrivenAdapterTests { pf.reset(); } - /** * the recovery callback is not mandatory, if not set and retries are exhausted the last throwable is rethrown * to the consumer. diff --git a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceTests.java b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceTests.java index 91984be7ac..49101a462a 100644 --- a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceTests.java +++ b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2023 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; - /** * @author Gary Russell * @author Anshul Mehra @@ -633,6 +632,7 @@ class MessageSourceTests { assertThatIllegalArgumentException() .isThrownBy(() -> new KafkaMessageSource((new DefaultKafkaConsumerFactory(Collections.emptyMap()) { + }), new ConsumerProperties("topic"))) .withMessageContaining(ConsumerConfig.MAX_POLL_RECORDS_CONFIG); @@ -907,7 +907,6 @@ class MessageSourceTests { p4r0, p4r1, p4r2, p4r3, p5r0, p5r1, p5r2, p5r3) .forEach(consumer::addRecord); - Message message; Set expected = Stream.of( p0r0, p0r1, p0r2, p0r3, // Seek to beginning diff --git a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandlerTests.java b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandlerTests.java index b7971ba4eb..420207cfad 100644 --- a/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandlerTests.java +++ b/spring-integration-kafka/src/test/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandlerTests.java @@ -345,7 +345,7 @@ class KafkaProducerMessageHandlerTests { producerFactory.destroy(); } - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) @Test void immediateFailure() { Producer producer = mock(Producer.class); @@ -367,11 +367,11 @@ class KafkaProducerMessageHandlerTests { Message fail = fails.receive(0); assertThat(fail).isNotNull(); assertThat(fail.getPayload()) - .asInstanceOf(throwable(KafkaSendFailureException.class)) - .cause() - .isInstanceOf(KafkaException.class) - .cause() - .isEqualTo(rte); + .asInstanceOf(throwable(KafkaSendFailureException.class)) + .cause() + .isInstanceOf(KafkaException.class) + .cause() + .isEqualTo(rte); } @Test diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java index eb301b1f77..2f61d4fc97 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,6 @@ public class ImapMailReceiver extends AbstractMailReceiver { } } - /** * Check if messages should be marked as read. * @return true if messages should be marked as read. diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java index 20c85fbb1f..f1da2e4c88 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class MailReceivingMessageSource extends AbstractMessageSource { private final Queue mailQueue = new ConcurrentLinkedQueue<>(); - public MailReceivingMessageSource(MailReceiver mailReceiver) { Assert.notNull(mailReceiver, "mailReceiver must not be null"); this.mailReceiver = mailReceiver; diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailSendingMessageHandler.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailSendingMessageHandler.java index c60f2eb6d4..d971c15f2b 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailSendingMessageHandler.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class MailSendingMessageHandler extends AbstractMessageHandler { private final MailSender mailSender; - /** * Create a MailSendingMessageHandler. * @param mailSender the {@link MailSender} instance to which this diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java index ca112c7805..4a0ee5e3b6 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2022 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ public abstract class MailTransportUtils { private static final Log LOGGER = LogFactory.getLog(MailTransportUtils.class); - /** * Close the given JavaMail Service and ignore any thrown exception. This is useful for typical * finally diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/Pop3MailReceiver.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/Pop3MailReceiver.java index af19da54f8..325ecb4a7b 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/Pop3MailReceiver.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/Pop3MailReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,6 @@ public class Pop3MailReceiver extends AbstractMailReceiver { super(new URLName(PROTOCOL, host, port, "INBOX", username, password)); } - @Override protected Message[] searchForNewMessages() throws MessagingException { Folder folderToUse = getFolder(); diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/config/ImapIdleChannelAdapterParser.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/config/ImapIdleChannelAdapterParser.java index d5ed26efd2..a7e6d48ca5 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/config/ImapIdleChannelAdapterParser.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/config/ImapIdleChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,4 +103,5 @@ public class ImapIdleChannelAdapterParser extends AbstractChannelAdapterParser { IntegrationNamespaceUtils.setValueIfAttributeDefined(receiverBuilder, element, "cancel-idle-interval"); return receiverBuilder.getBeanDefinition(); } + } diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/dsl/Mail.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/dsl/Mail.java index 66e207d80b..350577db20 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/dsl/Mail.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/dsl/Mail.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -200,7 +200,6 @@ public final class Mail { return transformer; } - private Mail() { } diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java index d7167bb696..dbb3976bb0 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -405,7 +405,6 @@ public class ImapMailReceiverTests { verify(logger).debug(org.mockito.ArgumentMatchers.contains("'msg2' will be discarded by the matching filter")); } - @Test public void receiveMarkAsReadAndDelete() throws Exception { AbstractMailReceiver receiver = new ImapMailReceiver(); @@ -460,7 +459,6 @@ public class ImapMailReceiverTests { given(folder.isOpen()).willReturn(true); folderField.set(receiver, folder); - Message msg1 = GreenMailUtil.newMimeMessage("test1"); Message msg2 = GreenMailUtil.newMimeMessage("test2"); final Message[] messages = new Message[] {msg1, msg2}; @@ -599,7 +597,6 @@ public class ImapMailReceiverTests { //ImapMailReceiver receiver = (ImapMailReceiver) TestUtils.getPropertyValue(adapter, "mailReceiver"); - DirectChannel channel = new DirectChannel(); channel.subscribe(new AbstractReplyProducingMessageHandler() { @@ -803,7 +800,6 @@ public class ImapMailReceiverTests { given(store.getFolder(Mockito.any(URLName.class))).willReturn(folder); given(folder.getPermanentFlags()).willReturn(new Flags(Flags.Flag.USER)); - DirectFieldAccessor df = new DirectFieldAccessor(receiver); df.setPropertyValue("store", store); receiver.setBeanFactory(mock(BeanFactory.class)); @@ -928,6 +924,7 @@ public class ImapMailReceiverTests { } } + ImapMailReceiver receiver = new TestReceiver(); Message[] received = (Message[]) receiver.receive(); assertThat(received.length).isEqualTo(1); @@ -983,7 +980,6 @@ public class ImapMailReceiverTests { mailReceiver.setBeanFactory(bf); } - private static class ImapSearchLoggingHandler extends Handler { private final List searches = new ArrayList<>(); diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailReceivingMessageSourceTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailReceivingMessageSourceTests.java index ba4c153362..bc8670197e 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailReceivingMessageSourceTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailReceivingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,6 @@ public class MailReceivingMessageSourceTests { assertThat(source.receive()).as("Expected null after exhausting all messages").isNull(); } - @SuppressWarnings("unused") private static class StubMailReceiver implements MailReceiver { diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerContextTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerContextTests.java index b12b392015..80ca0aa4de 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerContextTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,6 @@ public class MailSendingMessageHandlerContextTests { @Autowired private BeanFactory beanFactory; - @BeforeEach public void reset() { this.mailSender.reset(); diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerTests.java index 970c38e127..19d9aae2cc 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailSendingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public class MailSendingMessageHandlerTests { private StubJavaMailSender mailSender; - @BeforeEach public void setUp() { this.mailSender = new StubJavaMailSender(new MimeMessage((Session) null)); @@ -54,7 +53,6 @@ public class MailSendingMessageHandlerTests { this.mailSender.reset(); } - @Test public void textMessage() { this.handler.handleMessage(MailTestsHelper.createIntegrationMessage()); diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailTestsHelper.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailTestsHelper.java index 30bd66acc5..c8a4a0c034 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailTestsHelper.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/MailTestsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class MailTestsHelper { public static final String REPLY_TO = "replyTo@springframework.org"; - private MailTestsHelper() { super(); } diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/StubJavaMailSender.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/StubJavaMailSender.java index 165d5aca93..6bc3451b70 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/StubJavaMailSender.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/StubJavaMailSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,12 +40,10 @@ public class StubJavaMailSender implements JavaMailSender { private final List sentSimpleMailMessages = new ArrayList(); - public StubJavaMailSender(MimeMessage uniqueMessage) { this.uniqueMessage = uniqueMessage; } - public List getSentMimeMessages() { return this.sentMimeMessages; } diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/DefaultConfigurationTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/DefaultConfigurationTests.java index 3fd4c27adc..f1a9216652 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/DefaultConfigurationTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/DefaultConfigurationTests.java @@ -47,7 +47,6 @@ public class DefaultConfigurationTests { @Autowired private ApplicationContext context; - @Test public void verifyErrorChannel() { Object errorChannel = context.getBean("errorChannel"); diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/InboundChannelAdapterParserTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/InboundChannelAdapterParserTests.java index 93665f262d..86f31787e3 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/InboundChannelAdapterParserTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/InboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,6 @@ public class InboundChannelAdapterParserTests { assertThat(receiverAccessor.getPropertyValue("simpleContent")).isEqualTo(Boolean.FALSE); } - //==================== INT-1158 ==================== @Test public void pop3ShouldDeleteTrueProperty() { @@ -150,7 +149,6 @@ public class InboundChannelAdapterParserTests { assertThat(value).isFalse(); } - //==================== INT-1159 ==================== @Test public void pop3WithAuthenticator() { @@ -179,13 +177,11 @@ public class InboundChannelAdapterParserTests { assertThat(authenticator).isEqualTo(context.getBean("testAuthenticator")); } - @SuppressWarnings("unused") private static class TestAuthenticator extends Authenticator { } - //==================== INT-1160 ==================== @Test public void pop3WithMaxFetchSize() { @@ -219,7 +215,6 @@ public class InboundChannelAdapterParserTests { assertThat(value).isEqualTo(33); } - //==================== INT-1161 ==================== @Test public void pop3WithSession() { @@ -248,7 +243,6 @@ public class InboundChannelAdapterParserTests { assertThat(session).isEqualTo(context.getBean("testSession")); } - //==================== INT-1162 ==================== @Test public void pop3WithoutStoreUri() { @@ -274,7 +268,6 @@ public class InboundChannelAdapterParserTests { assertThat(url).isNull(); } - //==================== INT-1163 ==================== @Test public void inboundChannelAdapterRequiresShouldDeleteMessages() { @@ -284,7 +277,6 @@ public class InboundChannelAdapterParserTests { .withCauseInstanceOf(SAXParseException.class); } - //==================== INT-2800 ==================== @Test public void imapWithSearchTermStrategy() { @@ -305,7 +297,6 @@ public class InboundChannelAdapterParserTests { .withStackTraceContaining("searchTermStrategy is only allowed with imap"); } - //===================== COMMON ===================== private AbstractMailReceiver getReceiver(String name) { diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MailToStringTransformerParserTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MailToStringTransformerParserTests.java index 2f8c0404d9..7734f614cd 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MailToStringTransformerParserTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MailToStringTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import org.springframework.messaging.support.GenericMessage; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - /** * @author Mark Fisher * @author Artem Bilan diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/PollingMailSourceParserTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/PollingMailSourceParserTests.java index 453f6e50fb..83eab20d28 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/PollingMailSourceParserTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/PollingMailSourceParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class PollingMailSourceParserTests { @Autowired private ApplicationContext context; - @Test public void imapAdapter() { Object adapter = context.getBean("imapAdapter"); diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbNamespaceHandler.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbNamespaceHandler.java index 88eb9c70c4..2c0cd60f0a 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbNamespaceHandler.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,4 +33,5 @@ public class MongoDbNamespaceHandler extends AbstractIntegrationNamespaceHandler registerBeanDefinitionParser("outbound-channel-adapter", new MongoDbOutboundChannelAdapterParser()); registerBeanDefinitionParser("outbound-gateway", new MongoDbOutboundGatewayParser()); } + } diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbOutboundChannelAdapterParser.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbOutboundChannelAdapterParser.java index 4b9bf81a14..6d3e83224e 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbOutboundChannelAdapterParser.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoDbOutboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2022 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,4 +43,5 @@ public class MongoDbOutboundChannelAdapterParser extends AbstractOutboundChannel return builder.getBeanDefinition(); } + } diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoParserUtils.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoParserUtils.java index d1aaa5532d..2b775bf68d 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoParserUtils.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/config/MongoParserUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,6 @@ final class MongoParserUtils { IntegrationNamespaceUtils.createExpressionDefinitionFromValueOrExpression("collection-name", "collection-name-expression", parserContext, element, false); - if (collectionNameExpressionDef != null) { builder.addPropertyValue("collectionNameExpression", collectionNameExpressionDef); } diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java index 09e081ed96..88577b5263 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2023 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb public static final String DEFAULT_COLLECTION_NAME = "configurableStoreMessages"; - public ConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate) { this(mongoTemplate, DEFAULT_COLLECTION_NAME); } @@ -115,7 +114,6 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb return getMongoTemplate().getCollection(this.collectionName).countDocuments(query.getQueryObject()); } - @Override public MessageGroup getMessageGroup(Object groupId) { Assert.notNull(groupId, GROUP_ID_MUST_NOT_BE_NULL); diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java index 534259bdd5..4a55ca6b97 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,7 +85,6 @@ public class MessageDocument { this.messageId = messageId; } - public Message getMessage() { return this.message; } diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java index a3222ebac5..617d7e4c11 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java @@ -86,7 +86,6 @@ import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; - /** * An implementation of both the {@link MessageStore} and * {@link org.springframework.integration.store.MessageGroupStore} @@ -128,7 +127,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore private static final String SEQUENCE = "sequence"; - private final MongoTemplate template; private final MessageReadingMongoConverter converter; @@ -161,7 +159,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore this.collectionName = (StringUtils.hasText(collectionName)) ? collectionName : DEFAULT_COLLECTION_NAME; } - @Override public void setBeanClassLoader(ClassLoader classLoader) { Assert.notNull(classLoader, "classLoader must not be null"); @@ -550,7 +547,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore String.format("Cannot read %s. as map. Given Bson must be a Document or DBObject!", bson.getClass())); } - /** * Custom implementation of the {@link MappingMongoConverter} strategy. */ @@ -720,7 +716,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore } - @WritingConverter private static final class MessageHistoryToDocumentConverter implements Converter { @@ -884,7 +879,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore } - /** * Wrapper class used for storing Messages in MongoDB along with their "group" metadata. */ diff --git a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandlerTests.java b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandlerTests.java index 93984736af..6e8fb8e50c 100644 --- a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandlerTests.java +++ b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2022 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -140,7 +140,6 @@ class MongoDbStoringMessageHandlerTests implements MongoDbContainerTest { converter = spy(converter); MongoTemplate writingTemplate = new MongoTemplate(MONGO_DATABASE_FACTORY, converter); - MongoDbStoringMessageHandler handler = new MongoDbStoringMessageHandler(writingTemplate); handler.setCollectionNameExpression(new LiteralExpression("foo")); handler.setBeanFactory(mock(BeanFactory.class)); diff --git a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageGroupStoreTests.java b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageGroupStoreTests.java index 68045cc351..0589c89d0a 100644 --- a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageGroupStoreTests.java +++ b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageGroupStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -459,7 +459,6 @@ public abstract class AbstractMongoDbMessageGroupStoreTests implements MongoDbCo // assertTrue(failures.size() == 0); // } - protected void testWithAggregatorWithShutdown(String config) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config, this.getClass()); context.refresh(); diff --git a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageStoreTests.java b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageStoreTests.java index 7a183efdce..ad6f6cd97f 100644 --- a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageStoreTests.java +++ b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/AbstractMongoDbMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -347,7 +347,6 @@ public abstract class AbstractMongoDbMessageStoreTests implements MongoDbContain this.name = name; } - public String getName() { return name; } @@ -372,7 +371,6 @@ public abstract class AbstractMongoDbMessageStoreTests implements MongoDbContain } - public static class Person implements Serializable { /** diff --git a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java index 033c095eb7..df52da876a 100644 --- a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java +++ b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java @@ -212,7 +212,6 @@ class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMessageGr context.close(); } - public interface TestGateway { String service(String payload); diff --git a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStoreTests.java b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStoreTests.java index 826932593f..2dff98f7dc 100644 --- a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStoreTests.java +++ b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.mongodb.store; - import org.springframework.integration.store.MessageStore; /** diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParser.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParser.java index d8b335af06..5cb7e289de 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParser.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannel */ public class MqttMessageDrivenChannelAdapterParser extends AbstractChannelAdapterParser { - @Override protected AbstractBeanDefinition doParse(Element element, ParserContext parserContext, String channelName) { diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveredEvent.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveredEvent.java index 3bf3166758..8ca9cc96c7 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveredEvent.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveredEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.mqtt.event; - /** * An event emitted (when using aysnc) when the client indicates the message * was delivered. diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java index a161eca2da..fc56076006 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.mqtt.event; - /** * Base class for events related to message delivery. Properties {@link #messageId}, * {@link #clientId} and {@link #clientInstance} can be used to correlate events. diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java index f28df29eb9..d7a77ac9d7 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ public class MqttPahoMessageDrivenChannelAdapter extends AbstractMqttMessageDrivenChannelAdapter implements MqttCallbackExtended, MqttPahoComponent { - private final Lock lock = new ReentrantLock(); + private final Lock lock = new ReentrantLock(); private final MqttPahoClientFactory clientFactory; diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java index acc3e04e04..e71b53a9c0 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java @@ -341,8 +341,8 @@ public class Mqttv5PahoMessageDrivenChannelAdapter if (this.mqttClient != null && this.mqttClient.isConnected()) { MqttProperties subscriptionProperties = new MqttProperties(); subscriptionProperties.setSubscriptionIdentifier(this.subscriptionIdentifierCounter.incrementAndGet()); - this.mqttClient.subscribe(new MqttSubscription[] { subscription }, - null, null, new IMqttMessageListener[] { this::messageArrived }, subscriptionProperties) + this.mqttClient.subscribe(new MqttSubscription[] {subscription}, + null, null, new IMqttMessageListener[] {this::messageArrived}, subscriptionProperties) .waitForCompletion(getCompletionTimeout()); } } @@ -523,7 +523,6 @@ public class Mqttv5PahoMessageDrivenChannelAdapter return serverURIs[0]; } - /** * Used to complete message arrival when {@link #isManualAcks()} is true. */ diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/Mqttv5PahoMessageHandler.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/Mqttv5PahoMessageHandler.java index 6f62a04764..8bb5cbd714 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/Mqttv5PahoMessageHandler.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/Mqttv5PahoMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2022 the original author or authors. + * Copyright 2021-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.mqtt.outbound; - import java.nio.charset.StandardCharsets; import org.eclipse.paho.mqttv5.client.IMqttAsyncClient; diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java index 20b05716ea..23d66323f6 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import org.springframework.messaging.MessageHeaders; import org.springframework.messaging.converter.MessageConversionException; import org.springframework.util.Assert; - /** * Default implementation for mapping to/from Messages. * @@ -66,7 +65,6 @@ public class DefaultPahoMessageConverter implements MqttMessageConverter, BeanFa private volatile boolean messageBuilderFactorySet; - /** * Construct a converter with default options (qos=0, retain=false, charset=UTF-8). */ diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/ClientManagerBackToBackTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/ClientManagerBackToBackTests.java index 8337699565..46013a8b13 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/ClientManagerBackToBackTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/ClientManagerBackToBackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -247,7 +247,6 @@ class ClientManagerBackToBackTests implements MosquittoContainerTest { } - record ClientV3Disconnector(Mqttv3ClientManager clientManager) { @EventListener(MqttSubscribedEvent.class) diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5AdapterTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5AdapterTests.java index 1e582ffb2e..61dd1dab34 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5AdapterTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5AdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.mqtt; - import org.eclipse.paho.mqttv5.client.IMqttAsyncClient; import org.eclipse.paho.mqttv5.client.IMqttMessageListener; import org.eclipse.paho.mqttv5.client.IMqttToken; diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackAutomaticReconnectTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackAutomaticReconnectTests.java index d04b2be822..872516456d 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackAutomaticReconnectTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackAutomaticReconnectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - /** * @author Lucas Bowler * @author Artem Bilan @@ -94,7 +93,6 @@ public class Mqttv5BackToBackAutomaticReconnectTests implements MosquittoContain assertThat(receive).isNotNull(); } - @Configuration @EnableIntegration public static class Config { @@ -118,7 +116,6 @@ public class Mqttv5BackToBackAutomaticReconnectTests implements MosquittoContain return f -> f.handle(messageHandler); } - @Bean public IntegrationFlow mqttInFlow() { Mqttv5PahoMessageDrivenChannelAdapter messageProducer = diff --git a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackTests.java b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackTests.java index 588d62d8e5..09bbff02f1 100644 --- a/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackTests.java +++ b/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/Mqttv5BackToBackTests.java @@ -153,7 +153,6 @@ public class Mqttv5BackToBackTests implements MosquittoContainerTest { assertThat(receive.getPayload()).isEqualTo(testPayload); } - @Configuration @EnableIntegration public static class Config { diff --git a/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSource.java b/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSource.java index e856280d31..8c0391cc67 100644 --- a/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSource.java +++ b/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ import org.springframework.r2dbc.core.DatabaseClient; import org.springframework.r2dbc.core.RowsFetchSpec; import org.springframework.util.Assert; - /** * An instance of {@link org.springframework.integration.core.MessageSource} which returns * a {@link org.springframework.messaging.Message} with a payload which is the result of diff --git a/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandler.java b/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandler.java index 8cfbe59f41..1e6001ea70 100644 --- a/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandler.java +++ b/spring-integration-r2dbc/src/main/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ import org.springframework.r2dbc.core.Parameter; import org.springframework.r2dbc.core.PreparedOperation; import org.springframework.util.Assert; - /** * Implementation of {@link org.springframework.messaging.ReactiveMessageHandler} which writes * Message payload into a Relational Database, using reactive r2dbc support. @@ -83,7 +82,6 @@ public class R2dbcMessageHandler extends AbstractReactiveMessageHandler { this.statementMapper = this.r2dbcEntityOperations.getDataAccessStrategy().getStatementMapper(); } - /** * Set a {@link R2dbcMessageHandler.Type} for query to execute. * @param type the {@link R2dbcMessageHandler.Type} to use. @@ -134,7 +132,6 @@ public class R2dbcMessageHandler extends AbstractReactiveMessageHandler { this.criteriaExpression = criteriaExpression; } - @Override public String getComponentType() { return "r2dbc:outbound-channel-adapter"; @@ -167,7 +164,6 @@ public class R2dbcMessageHandler extends AbstractReactiveMessageHandler { .then(); } - private Mono handleDelete(Message message) { if (this.tableNameExpression != null) { String tableName = this.tableNameExpression.getValue(this.evaluationContext, message, String.class); @@ -258,7 +254,6 @@ public class R2dbcMessageHandler extends AbstractReactiveMessageHandler { return criteria; } - /** * /** * The mode for the {@link R2dbcMessageHandler}. diff --git a/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/config/R2dbcDatabaseConfiguration.java b/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/config/R2dbcDatabaseConfiguration.java index 4c904f9367..aaae8abac5 100644 --- a/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/config/R2dbcDatabaseConfiguration.java +++ b/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/config/R2dbcDatabaseConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.r2dbc.config; - import io.r2dbc.h2.H2ConnectionConfiguration; import io.r2dbc.h2.H2ConnectionFactory; import io.r2dbc.spi.ConnectionFactory; diff --git a/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSourceTests.java b/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSourceTests.java index 433e6919de..c3e68d1870 100644 --- a/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSourceTests.java +++ b/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/inbound/R2dbcMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.r2dbc.inbound; - import java.time.Duration; import java.util.Arrays; import java.util.List; @@ -106,7 +105,6 @@ public class R2dbcMessageSourceTests { .verifyComplete(); } - @Test public void validateSuccessfulQueryWithSingleElementOfMonoDBObject() { this.entityTemplate.insert(new Person("Bob", 35)) @@ -270,7 +268,6 @@ public class R2dbcMessageSourceTests { } - @Test public void testAnyOtherObjectQueryExpression() { diff --git a/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandlerTests.java b/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandlerTests.java index 304836c2f6..2053e57148 100644 --- a/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandlerTests.java +++ b/spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -277,7 +277,6 @@ public class R2dbcMessageHandlerTests { } - private Person createPerson(String bob, Integer age) { return new Person(bob, age); } @@ -286,7 +285,6 @@ public class R2dbcMessageHandlerTests { return mono.block(Duration.ofSeconds(10)); } - @Configuration @Import(R2dbcDatabaseConfiguration.class) static class R2dbcMessageHandlerConfiguration { diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/config/RedisNamespaceHandler.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/config/RedisNamespaceHandler.java index 7ed33f2153..863fd91b8e 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/config/RedisNamespaceHandler.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/config/RedisNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,4 +39,5 @@ public class RedisNamespaceHandler extends AbstractIntegrationNamespaceHandler { registerBeanDefinitionParser("queue-inbound-gateway", new RedisQueueInboundGatewayParser()); registerBeanDefinitionParser("queue-outbound-gateway", new RedisQueueOutboundGatewayParser()); } + } diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapter.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapter.java index 6484d584da..2a0ffe02fd 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapter.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2022 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,7 +145,6 @@ public class RedisInboundChannelAdapter extends MessageProducerSupport { this.container.start(); } - @Override protected void doStop() { this.container.stop(); @@ -160,7 +159,6 @@ public class RedisInboundChannelAdapter extends MessageProducerSupport { return this.messageConverter.toMessage(object, messageHeaders); } - private class MessageListenerDelegate { MessageListenerDelegate() { diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java index b074ea4250..89a3e648ee 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -362,7 +362,6 @@ public class RedisQueueInboundGateway extends MessagingGatewaySupport this.boundListOperations.getOperations().delete(this.boundListOperations.getKey()); } - private class ListenerTask implements SchedulingAwareRunnable { ListenerTask() { diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java index 7d061baa60..19c5e644a4 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2020 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -325,7 +325,6 @@ public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport this.boundListOperations.getOperations().delete(this.boundListOperations.getKey()); } - private class ListenerTask implements SchedulingAwareRunnable { ListenerTask() { diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java index 95ec60d0f9..646df058bf 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2021 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,7 +103,6 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { private volatile boolean initialized; - /** * Constructs an instance using the provided {@link RedisTemplate}. * The RedisTemplate must be fully initialized. @@ -131,7 +130,6 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { this.connectionFactory = connectionFactory; } - /** * Specifies the key for the Redis store. If an expression is needed, then call * {@link #setKeyExpression(Expression)} instead of this method (they are mutually exclusive). diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisChannelPriorityMessageStore.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisChannelPriorityMessageStore.java index 11aa17e2af..e8134ba22b 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisChannelPriorityMessageStore.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisChannelPriorityMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,6 @@ public class RedisChannelPriorityMessageStore extends RedisChannelMessageStore return getMessageGroupFactory().create(allMessages, groupId); } - @Override public MessageGroup addMessageToGroup(Object groupId, Message message) { Assert.isInstanceOf(String.class, groupId); @@ -133,7 +132,6 @@ public class RedisChannelPriorityMessageStore extends RedisChannelMessageStore return narrowedKeys.size(); } - private Set narrowedKeys() { Set keys = this.getRedisTemplate().keys(this.getBeanName() + ":*"); Set narrowedKeys = new HashSet<>(); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java index 03aa702205..f5b05ae572 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2020 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,6 @@ public class RedisMessageStore extends AbstractKeyValueMessageStore implements B return ops.get(); } - @Override protected void doStore(Object id, Object objectToStore) { Assert.notNull(id, ID_MUST_NOT_BE_NULL); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java index 59560f59de..7f73eebbc7 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java @@ -209,7 +209,6 @@ public final class RedisLockRegistry implements ExpirableLockRegistry, Disposabl this.cacheCapacity = cacheCapacity; } - /** * Set {@link RedisLockType} mode to work in. * By default, the {@link RedisLockType#SPIN_LOCK} is used - works in all the environment. @@ -707,7 +706,6 @@ public final class RedisLockRegistry implements ExpirableLockRegistry, Disposabl } - private final class RedisSpinLock extends RedisLock { private static final String UNLINK_UNLOCK_SCRIPT = """ diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/RedisContainerTest.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/RedisContainerTest.java index 2db10a83af..c2d41be93d 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/RedisContainerTest.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/RedisContainerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -210,4 +210,5 @@ public interface RedisContainerTest { redisTemplate.afterPropertiesSet(); return redisTemplate; } + } diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/channel/SubscribableRedisChannelTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/channel/SubscribableRedisChannelTests.java index d76619a79c..528ad02b32 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/channel/SubscribableRedisChannelTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/channel/SubscribableRedisChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ import static org.mockito.Mockito.mock; * @since 2.0 */ class SubscribableRedisChannelTests implements RedisContainerTest { + private static RedisConnectionFactory redisConnectionFactory; @BeforeAll diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisInboundChannelAdapterParserTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisInboundChannelAdapterParserTests.java index e9451c1620..f91f3dea31 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisInboundChannelAdapterParserTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,6 @@ class RedisInboundChannelAdapterParserTests implements RedisContainerTest { @Autowired private Executor executor; - @Autowired private RedisConnectionFactory redisConnectionFactory; diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisOutboundChannelAdapterParserTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisOutboundChannelAdapterParserTests.java index 2b77bc6407..0cd27620f2 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisOutboundChannelAdapterParserTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisOutboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,7 +130,6 @@ class RedisOutboundChannelAdapterParserTests implements RedisContainerTest { assertThat(message.getPayload()).isEqualTo("Hello Redis from chain"); } - @SuppressWarnings("unused") private static class TestMessageConverter extends SimpleMessageConverter { diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundChannelAdapterParserTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundChannelAdapterParserTests.java index 0a16dd620e..b7b988f49b 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundChannelAdapterParserTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import static org.assertj.core.api.Assertions.assertThat; - /** * @author Artem Bilan * @author Gary Russell @@ -83,11 +82,9 @@ public class RedisQueueInboundChannelAdapterParserTests { @Qualifier("executor") private TaskExecutor taskExecutor; - @Autowired private RedisSerializer serializer; - @Test @SuppressWarnings("unchecked") public void testInt3017DefaultConfig() { @@ -109,7 +106,6 @@ public class RedisQueueInboundChannelAdapterParserTests { assertThat(TestUtils.getPropertyValue(this.defaultAdapter, "rightPop", Boolean.class)).isTrue(); } - @Test @SuppressWarnings("unchecked") public void testInt3017CustomConfig() { @@ -128,7 +124,6 @@ public class RedisQueueInboundChannelAdapterParserTests { assertThat(TestUtils.getPropertyValue(this.customAdapter, "rightPop", Boolean.class)).isFalse(); } - @Test public void testInt4341ZeroReceiveTimeoutConfig() { assertThat(TestUtils.getPropertyValue(this.zeroReceiveTimeoutAdapter, "receiveTimeout")).isEqualTo(0L); diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundGatewayParserTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundGatewayParserTests.java index ee95a08c6a..217023bda5 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundGatewayParserTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.redis.config; - import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -30,7 +29,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import static org.assertj.core.api.Assertions.assertThat; - /** * @author David Liu * @author Artem Bilan @@ -61,7 +59,6 @@ public class RedisQueueInboundGatewayParserTests { @Autowired private RedisSerializer serializer; - @Test public void testDefaultConfig() { assertThat(TestUtils.getPropertyValue(this.defaultGateway, "extractPayload", Boolean.class)).isFalse(); diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapterTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapterTests.java index 7510703e5a..37de193655 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapterTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2022 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +42,7 @@ import static org.mockito.Mockito.mock; * @since 2.1 */ class RedisInboundChannelAdapterTests implements RedisContainerTest { + private static RedisConnectionFactory redisConnectionFactory; @BeforeAll diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java index a2acd3723a..a04707f37b 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -290,7 +290,6 @@ class RedisQueueMessageDrivenEndpointTests implements RedisContainerTest { verify(boundListOperations, atLeastOnce()).rightPush(any(byte[].class)); } - @Test @Disabled("LettuceConnectionFactory doesn't support proper reinitialization after 'destroy()'") void testInt3196Recovery() throws Exception { diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisStoreInboundChannelAdapterIntegrationTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisStoreInboundChannelAdapterIntegrationTests.java index c85d788c1c..250bd5c44a 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisStoreInboundChannelAdapterIntegrationTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisStoreInboundChannelAdapterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @since 2.2 */ class RedisStoreInboundChannelAdapterIntegrationTests implements RedisContainerTest { + private static RedisConnectionFactory redisConnectionFactory; @BeforeAll @@ -197,7 +198,6 @@ class RedisStoreInboundChannelAdapterIntegrationTests implements RedisContainerT zsetAdapterNoScore.stop(); - //ScoreRange test SourcePollingChannelAdapter zsetAdapterWithScoreRange = context.getBean("zsetAdapterWithScoreRange", SourcePollingChannelAdapter.class); @@ -214,7 +214,6 @@ class RedisStoreInboundChannelAdapterIntegrationTests implements RedisContainerT zsetAdapterWithScoreRange.stop(); - //SingleScore test SourcePollingChannelAdapter zsetAdapterWithSingleScore = context.getBean("zsetAdapterWithSingleScore", SourcePollingChannelAdapter.class); @@ -231,7 +230,6 @@ class RedisStoreInboundChannelAdapterIntegrationTests implements RedisContainerT zsetAdapterWithSingleScore.stop(); - //SingleScoreAndSynchronization test SourcePollingChannelAdapter zsetAdapterWithSingleScoreAndSynchronization = context.getBean("zsetAdapterWithSingleScoreAndSynchronization", SourcePollingChannelAdapter.class); diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/leader/RedisLockRegistryLeaderInitiatorTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/leader/RedisLockRegistryLeaderInitiatorTests.java index 667b6ef9fd..b1da95c67c 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/leader/RedisLockRegistryLeaderInitiatorTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/leader/RedisLockRegistryLeaderInitiatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ @LogLevels(categories = "org.springframework.integration.redis.leader") class RedisLockRegistryLeaderInitiatorTests implements RedisContainerTest { + private static RedisConnectionFactory redisConnectionFactory; @BeforeAll diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/metadata/RedisMetadataStoreTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/metadata/RedisMetadataStoreTests.java index abe7e6e0a3..5b38728f39 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/metadata/RedisMetadataStoreTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/metadata/RedisMetadataStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.fail; * */ class RedisMetadataStoreTests implements RedisContainerTest { + private static RedisConnectionFactory redisConnectionFactory; @BeforeAll diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/ReactiveRedisStreamMessageHandlerTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/ReactiveRedisStreamMessageHandlerTests.java index c9d6bf8162..e27999dad5 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/ReactiveRedisStreamMessageHandlerTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/ReactiveRedisStreamMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,7 +74,6 @@ class ReactiveRedisStreamMessageHandlerTests implements RedisContainerTest { template.delete(STREAM_KEY).block(); } - @Test void testIntegrationStreamOutbound() { String messagePayload = "Hello stream message"; @@ -108,7 +107,6 @@ class ReactiveRedisStreamMessageHandlerTests implements RedisContainerTest { assertThat(record.getValue()).isEqualTo(messagePayload); } - @Test void testExplicitSerializationContextWithModel() { Address address = new Address("Rennes, France"); @@ -147,7 +145,6 @@ class ReactiveRedisStreamMessageHandlerTests implements RedisContainerTest { return directChannel; } - @Bean public ReactiveRedisStreamMessageHandler streamMessageHandler(ReactiveRedisConnectionFactory redisConnectionFactory) { diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandlerTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandlerTests.java index 64b92f4e1b..60bbbf23e9 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandlerTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2022 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @since 2.1 */ class RedisPublishingMessageHandlerTests implements RedisContainerTest { + private static RedisConnectionFactory redisConnectionFactory; @BeforeAll @@ -82,7 +83,6 @@ class RedisPublishingMessageHandlerTests implements RedisContainerTest { container.stop(); } - private static class Listener { private final CountDownLatch latch; diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapterTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapterTests.java index 8a5587e0b5..8f68d1b89a 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapterTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,6 @@ class RedisQueueOutboundChannelAdapterTests implements RedisContainerTest { @Qualifier("toRedisQueueChannel") private MessageChannel sendChannel; - @Test void testInt3015Default() { diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java index 9a21aa4ee9..f6a65a3524 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -538,6 +538,7 @@ class RedisStoreWritingMessageHandlerTests implements RedisContainerTest { } private static class President implements Serializable { + private static final long serialVersionUID = 1L; private String name; @@ -555,5 +556,7 @@ class RedisStoreWritingMessageHandlerTests implements RedisContainerTest { public void setName(String name) { this.name = name; } + } + } diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java index 1da003ac88..57efe56cac 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2023 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -228,7 +228,6 @@ class RedisMessageGroupStoreTests implements RedisContainerTest { .isThrownBy(() -> store.removeMessagesFromGroup(this.groupId, new GenericMessage<>("2"))); } - @Test void testMultipleInstancesOfGroupStore() { RedisMessageStore store1 = new RedisMessageStore(redisConnectionFactory); diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageStoreTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageStoreTests.java index c4e12277c4..4a6b60fac8 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageStoreTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2022 the original author or authors. + * Copyright 2007-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * */ class RedisMessageStoreTests implements RedisContainerTest { + private static RedisConnectionFactory redisConnectionFactory; @BeforeAll diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/Person.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/Person.java index b0a6d2af0f..92d5db0ec0 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/Person.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2020 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.integration.redis.util; import java.io.Serializable; import java.util.Objects; - @SuppressWarnings("serial") public class Person implements Serializable { @@ -51,7 +50,6 @@ public class Person implements Serializable { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/RedisLockRegistryTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/RedisLockRegistryTests.java index e3f5a04292..a0874de620 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/RedisLockRegistryTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/util/RedisLockRegistryTests.java @@ -404,7 +404,6 @@ class RedisLockRegistryTests implements RedisContainerTest { registry.destroy(); } - @ParameterizedTest @EnumSource(RedisLockType.class) void testEquals(RedisLockType testRedisLockType) { @@ -530,7 +529,6 @@ class RedisLockRegistryTests implements RedisContainerTest { //capacity limit test assertThat(getRedisLockRegistryLocks(registry)).hasSize(CAPACITY_CNT); - registry.expireUnusedOlderThan(-1000); assertThat(getRedisLockRegistryLocks(registry)).isEmpty(); registry.destroy(); @@ -756,7 +754,6 @@ class RedisLockRegistryTests implements RedisContainerTest { assertThat(atomicInteger.get()).isEqualTo(testCnt * lockRegistryNum); } - @ParameterizedTest @EnumSource(RedisLockType.class) void earlyWakeUpTest(RedisLockType testRedisLockType) throws InterruptedException { diff --git a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ServerRSocketMessageHandler.java b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ServerRSocketMessageHandler.java index 0690bbbf6c..ee2fab6ab3 100644 --- a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ServerRSocketMessageHandler.java +++ b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ServerRSocketMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class ServerRSocketMessageHandler extends IntegrationRSocketMessageHandle private static final Method HANDLE_CONNECTION_SETUP_METHOD = ReflectionUtils.findMethod(ServerRSocketMessageHandler.class, "handleConnectionSetup", Message.class); - private final Map clientRSocketRequesters = new HashMap<>(); private BiFunction, DataBuffer, Object> clientRSocketKeyStrategy = diff --git a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGateway.java b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGateway.java index 90b07f270b..95b3f5bf55 100644 --- a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGateway.java +++ b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -151,7 +151,6 @@ public class RSocketOutboundGateway extends AbstractReplyProducingMessageHandler this.interactionModelExpression = interactionModelExpression; } - /** * Configure a type for a request {@link Publisher} elements. * @param publisherElementType the type of the request {@link Publisher} elements. diff --git a/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/dsl/RSocketDslTests.java b/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/dsl/RSocketDslTests.java index 1f726a2d95..aed3d7dd5b 100644 --- a/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/dsl/RSocketDslTests.java +++ b/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/dsl/RSocketDslTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,6 @@ public class RSocketDslTests { flowRegistration.destroy(); } - @Configuration @EnableIntegration public static class TestConfiguration { diff --git a/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/inbound/RSocketInboundGatewayIntegrationTests.java b/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/inbound/RSocketInboundGatewayIntegrationTests.java index ed2ce8efeb..2076a028a9 100644 --- a/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/inbound/RSocketInboundGatewayIntegrationTests.java +++ b/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/inbound/RSocketInboundGatewayIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -146,7 +146,6 @@ public class RSocketInboundGatewayIntegrationTests { .verify(Duration.ofSeconds(10)); } - private abstract static class CommonConfig { @Bean diff --git a/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGatewayIntegrationTests.java b/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGatewayIntegrationTests.java index 3c28a531a4..df2ff9ca65 100644 --- a/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGatewayIntegrationTests.java +++ b/spring-integration-rsocket/src/test/java/org/springframework/integration/rsocket/outbound/RSocketOutboundGatewayIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 the original author or authors. + * Copyright 2019-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,7 +166,6 @@ public class RSocketOutboundGatewayIntegrationTests { disposable.dispose(); } - @Test void clientEcho() { echo(this.inputChannel, this.resultChannel, null); @@ -299,7 +298,6 @@ public class RSocketOutboundGatewayIntegrationTests { verifier.verify(Duration.ofSeconds(10)); } - @Test void clientVoidReturnValue() { voidReturnValue(this.inputChannel, this.resultChannel, null); @@ -450,7 +448,6 @@ public class RSocketOutboundGatewayIntegrationTests { .thenCancel() .verify(Duration.ofSeconds(10)); - disposable.dispose(); this.clientRsocketOutboundGateway.setExpectedResponseType(String.class); } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java index 4b93a22ab5..85ca053335 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,6 @@ public abstract class AbstractScriptExecutingMessageProcessor this.scriptVariableGenerator = scriptVariableGenerator; } - @Override public void setBeanClassLoader(ClassLoader classLoader) { this.beanClassLoader = classLoader; diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/DefaultScriptVariableGenerator.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/DefaultScriptVariableGenerator.java index d8aea2a34e..8aaac10fa0 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/DefaultScriptVariableGenerator.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/DefaultScriptVariableGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ public class DefaultScriptVariableGenerator implements ScriptVariableGenerator { private final Map variableMap; - public DefaultScriptVariableGenerator() { this.variableMap = Collections.emptyMap(); } @@ -45,7 +44,6 @@ public class DefaultScriptVariableGenerator implements ScriptVariableGenerator { this.variableMap = variableMap; } - public Map generateScriptVariables(Message message) { Map scriptVariables = new HashMap(); // Add Message content diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java index cdffa71ff2..cdf343d676 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class RefreshableResourceScriptSource implements ScriptSource { private volatile String script; - public RefreshableResourceScriptSource(Resource resource, long refreshDelay) { this.refreshDelay = refreshDelay; this.source = new ResourceScriptSource(resource); diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java index 7642ea9ef5..7c2161df12 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2019 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,4 +44,5 @@ public class ScriptExecutingMessageSource extends AbstractMessageSource protected Object doReceive() { return this.scriptMessageProcessor.processMessage(null); } + } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptingException.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptingException.java index 269ecd697f..d784c3cc4a 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptingException.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ public class ScriptingException extends MessagingException { super(description); } - public ScriptingException(String description, Throwable cause) { super(description, cause); } + } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/DslScriptExecutingMessageProcessor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/DslScriptExecutingMessageProcessor.java index 386502c307..9120f78536 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/DslScriptExecutingMessageProcessor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/DslScriptExecutingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,7 +99,6 @@ class DslScriptExecutingMessageProcessor this.script = this.applicationContext.getResource(this.location); } - if (!StringUtils.hasText(this.lang)) { String scriptFilename = this.script.getFilename(); Assert.hasText(scriptFilename, diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/ScriptSpec.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/ScriptSpec.java index 04ad106eb5..9341ca30f7 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/ScriptSpec.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/dsl/ScriptSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -125,7 +125,6 @@ public class ScriptSpec extends MessageProcessorSpec { return this; } - @Override protected MessageProcessor doGet() { if (this.variableGenerator == null) { diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/PythonScriptExecutor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/PythonScriptExecutor.java index 90a5fe95d3..b04c15a23d 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/PythonScriptExecutor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/PythonScriptExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,11 +57,14 @@ public class PythonScriptExecutor extends AbstractScriptExecutor { } public static class PythonVariableParser { + public static String parseReturnVariable(String script) { String[] lines = script.trim().split("\n"); String lastLine = lines[lines.length - 1]; String[] tokens = lastLine.split("="); return tokens[0].trim(); } + } + } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java index 94b1e5ee74..9b21442f77 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public class ScriptExecutingMessageProcessor extends AbstractScriptExecutingMess private final ScriptSource scriptSource; - /** * Create a processor for the {@link ScriptSource} using the provided * {@link ScriptExecutor} using the DefaultScriptVariableGenerator @@ -83,7 +82,6 @@ public class ScriptExecutingMessageProcessor extends AbstractScriptExecutingMess this(scriptSource, new DefaultScriptVariableGenerator(variables), scriptExecutor); } - @Override protected ScriptSource getScriptSource(Message message) { return this.scriptSource; diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.java index dfb56b03e7..b35874fad6 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,6 @@ public class Jsr223FilterTests { @Autowired private MessageChannel inlineScriptInput; - @Test public void referencedScript() { QueueChannel replyChannel = new QueueChannel(); diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RefreshTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RefreshTests.java index d2497a0df9..839ccb9912 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RefreshTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RefreshTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,10 +58,12 @@ public class Jsr223RefreshTests { } public static class ResourceEditor extends PropertyEditorSupport { + @Override public void setAsText(String text) throws IllegalArgumentException { super.setValue(new CycleResource()); } + } private static class CycleResource extends AbstractResource { @@ -98,4 +100,5 @@ public class Jsr223RefreshTests { } } + } diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RouterTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RouterTests.java index ca978e5eb3..96bc936c09 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RouterTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223RouterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class Jsr223RouterTests { @Autowired private QueueChannel shortStrings; - @AfterEach void cleanUp() { this.longStrings.clear(); diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.java index 0cb71cd959..177fc6c202 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class Jsr223SplitterTests { @Autowired private MessageChannel inlineScriptInput; - @Test public void referencedScript() { QueueChannel replyChannel = new QueueChannel(); diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java index cb88d0d62b..2b7512404a 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class Jsr223TransformerTests { @Autowired private PollableChannel int3162OutputChannel; - @Test public void referencedScript() { QueueChannel replyChannel = new QueueChannel(); diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/dsl/ScriptsTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/dsl/ScriptsTests.java index ad2bac6de2..08a965425e 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/dsl/ScriptsTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/dsl/ScriptsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -191,7 +191,6 @@ public class ScriptsTests { .isEqualTo(5); } - @Configuration @EnableIntegration public static class ContextConfiguration { diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/PythonVariableParserTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/PythonVariableParserTests.java index b4170172f5..128291a1cf 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/PythonVariableParserTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/PythonVariableParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class PythonVariableParserTests { var = PythonScriptExecutor.PythonVariableParser.parseReturnVariable("\n\n\nx\n\n\n"); } - @Test public void test2() throws IOException { ScriptSource source = @@ -51,4 +50,5 @@ public class PythonVariableParserTests { String var = PythonScriptExecutor.PythonVariableParser.parseReturnVariable(source.getScriptAsString()); assertThat(var).isEqualTo("bar"); } + } diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/config/SftpOutboundChannelAdapterParser.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/config/SftpOutboundChannelAdapterParser.java index 09fdb5f85b..17ea5aef49 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/config/SftpOutboundChannelAdapterParser.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/config/SftpOutboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import org.springframework.integration.sftp.session.SftpRemoteFileTemplate; */ public class SftpOutboundChannelAdapterParser extends RemoteFileOutboundChannelAdapterParser { - @Override protected Class handlerClass() { return SftpMessageHandler.class; diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpOutboundGatewaySpec.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpOutboundGatewaySpec.java index 3390cc6651..7630b50564 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpOutboundGatewaySpec.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpOutboundGatewaySpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import org.springframework.integration.sftp.filters.SftpSimplePatternFileListFil public class SftpOutboundGatewaySpec extends RemoteFileOutboundGatewaySpec { - protected SftpOutboundGatewaySpec(AbstractRemoteFileOutboundGateway outboundGateway) { super(outboundGateway); } diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpRegexPatternFileListFilter.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpRegexPatternFileListFilter.java index 1ce3e783ff..15891a6176 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpRegexPatternFileListFilter.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpRegexPatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ public class SftpRegexPatternFileListFilter extends AbstractRegexPatternFileList super(pattern); } - @Override protected String getFilename(SftpClient.DirEntry entry) { return (entry != null) ? entry.getFilename() : null; diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpSimplePatternFileListFilter.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpSimplePatternFileListFilter.java index 64f5652d56..75d59db644 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpSimplePatternFileListFilter.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/filters/SftpSimplePatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ public class SftpSimplePatternFileListFilter extends AbstractSimplePatternFileLi super(pattern); } - @Override protected String getFilename(SftpClient.DirEntry entry) { return (entry != null) ? entry.getFilename() : null; diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java index a93d9f3b4d..136de52a55 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ public class SftpFileInfo extends AbstractFileInfo { private final SftpClient.Attributes attrs; - public SftpFileInfo(SftpClient.DirEntry lsEntry) { Assert.notNull(lsEntry, "'lsEntry' must not be null"); this.lsEntry = lsEntry; diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserCachingTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserCachingTests.java index df666eed3b..27e50d9a05 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserCachingTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserCachingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ public class OutboundChannelAdapterParserCachingTests { @Autowired private Object nonCachingAdapter; - @Test public void cachingAdapter() { Object sessionFactory = TestUtils.getPropertyValue(cachingAdapter, "handler.remoteFileTemplate.sessionFactory"); diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundGatewayParserTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundGatewayParserTests.java index 920924df82..1d343b5889 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundGatewayParserTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -191,4 +191,5 @@ public class SftpOutboundGatewayParserTests { } } + } diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpStreamingInboundChannelAdapterParserTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpStreamingInboundChannelAdapterParserTests.java index aa80b8028b..c51ccf4614 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpStreamingInboundChannelAdapterParserTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpStreamingInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,6 +110,7 @@ public class SftpStreamingInboundChannelAdapterParserTests { public boolean isSingleton() { return true; } + } } diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/dsl/SftpTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/dsl/SftpTests.java index 9828fe7ad4..d03f9e733e 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/dsl/SftpTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/dsl/SftpTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -196,7 +196,6 @@ public class SftpTests extends SftpTestSupport { registration.destroy(); } - @Test @DisabledOnOs(OS.WINDOWS) public void testSftpOutboundFlowWithChmod() { @@ -273,7 +272,6 @@ public class SftpTests extends SftpTestSupport { registration.destroy(); } - @Test public void testSftpMv() { QueueChannel out = new QueueChannel(); diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java index 0352691779..03b8858cde 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -175,7 +175,6 @@ public class SftpStreamingMessageSourceTests extends SftpTestSupport { StaticMessageHeaderAccessor.getCloseableResource(received).close(); } - @Test public void maxFetchIsAdjustedWhenNoSupportsSingleFileFiltering() throws Exception { SftpStreamingMessageSource messageSource = buildSource(); @@ -269,7 +268,6 @@ public class SftpStreamingMessageSourceTests extends SftpTestSupport { return new ConcurrentHashMap<>(); } - @Bean @InboundChannelAdapter(channel = "stream", autoStartup = "false") public MessageSource sftpMessageSource() { diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/session/SftpTestSessionFactory.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/session/SftpTestSessionFactory.java index 4a5de2eb12..da2014ab6d 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/session/SftpTestSessionFactory.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/session/SftpTestSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.sftp.session; - import org.apache.sshd.sftp.client.SftpClient; import static org.mockito.BDDMockito.willReturn; diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/dsl/Smb.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/dsl/Smb.java index 0bbce68f0b..9e1de71ea6 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/dsl/Smb.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/dsl/Smb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 the original author or authors. + * Copyright 2022-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -192,7 +192,6 @@ public final class Smb { return new SmbOutboundGatewaySpec(new SmbOutboundGateway(remoteFileTemplate, command, expression)); } - /** * Produce a {@link SmbOutboundGatewaySpec} based on the * {@link MessageSessionCallback}. diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbPersistentAcceptOnceFileListFilter.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbPersistentAcceptOnceFileListFilter.java index c9dce57b72..785b1f1d8c 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbPersistentAcceptOnceFileListFilter.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbPersistentAcceptOnceFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2022 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import org.springframework.integration.metadata.ConcurrentMetadataStore; */ public class SmbPersistentAcceptOnceFileListFilter extends AbstractPersistentAcceptOnceFileListFilter { - public SmbPersistentAcceptOnceFileListFilter(ConcurrentMetadataStore store, String prefix) { super(store, prefix); } diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbSimplePatternFileListFilter.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbSimplePatternFileListFilter.java index bb81a06593..9fd556ea6b 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbSimplePatternFileListFilter.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/filters/SmbSimplePatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2022 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,6 @@ public class SmbSimplePatternFileListFilter extends AbstractSimplePatternFileLis return (file != null) ? file.getName() : null; } - @Override protected boolean isDirectory(SmbFile file) { try { diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbRemoteFileTemplate.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbRemoteFileTemplate.java index 8a1c34211b..f14208522d 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbRemoteFileTemplate.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbRemoteFileTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,4 +92,5 @@ public class SmbRemoteFileTemplate extends RemoteFileTemplate { return findSmbException(ex.getCause()); } } + } diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbShare.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbShare.java index e3cb4bb9d1..d287a481e1 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbShare.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbShare.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -161,7 +161,6 @@ public class SmbShare extends SmbFile { return super.equals(other); } - /** * Return a cache code from the super class. * @return A hashcode for this share diff --git a/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java b/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java index c8c3f519e0..be03eb8e51 100644 --- a/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java +++ b/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,7 +120,6 @@ public class SmbInboundChannelAdapterParserTests { assertThat(adapter).isNotNull(); } - public static class TestSessionFactoryBean implements FactoryBean { public SmbSessionFactory getObject() { diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java index 13ae624efc..d4233b4ce1 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -369,7 +369,6 @@ public abstract class AbstractStompSessionManager implements StompSessionManager protected abstract CompletableFuture doConnect(StompSessionHandler handler); - private class CompositeStompSessionHandler extends StompSessionHandlerAdapter { private final List delegates = Collections.synchronizedList(new ArrayList<>()); diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java index 30847da281..a12853f249 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -204,38 +204,8 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement private void subscribeDestination(final String destination) { if (this.stompSession != null) { - class FrameHandler implements StompFrameHandler { - - @Override - public Type getPayloadType(StompHeaders headers) { - return StompInboundChannelAdapter.this.payloadType; - } - - @Override - public void handleFrame(StompHeaders headers, @Nullable Object body) { - Message message; - - if (body == null) { - logger.info("No body in STOMP frame: nothing to produce."); - return; - } - else if (body instanceof Message) { - message = (Message) body; - } - else { - message = - getMessageBuilderFactory() - .withPayload(body) - .copyHeaders( - StompInboundChannelAdapter.this.headerMapper.toHeaders(headers)) - .build(); - } - sendMessage(message); - } - - } - final StompSession.Subscription subscription = - this.stompSession.subscribe(destination, new FrameHandler()); + StompSession.Subscription subscription = + this.stompSession.subscribe(destination, new IntegrationFrameHandler()); if (this.stompSessionManager.isAutoReceiptEnabled()) { final ApplicationEventPublisher eventPublisher = this.applicationEventPublisher; @@ -268,6 +238,9 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement private final class IntegrationInboundStompSessionHandler extends StompSessionHandlerAdapter { + IntegrationInboundStompSessionHandler() { + } + @Override public void afterConnected(StompSession session, StompHeaders connectedHeaders) { StompInboundChannelAdapter.this.stompSession = session; @@ -307,4 +280,38 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement } + private final class IntegrationFrameHandler implements StompFrameHandler { + + IntegrationFrameHandler() { + } + + @Override + public Type getPayloadType(StompHeaders headers) { + return StompInboundChannelAdapter.this.payloadType; + } + + @Override + public void handleFrame(StompHeaders headers, @Nullable Object body) { + Message message; + + if (body == null) { + logger.info("No body in STOMP frame: nothing to produce."); + return; + } + else if (body instanceof Message) { + message = (Message) body; + } + else { + message = + getMessageBuilderFactory() + .withPayload(body) + .copyHeaders( + StompInboundChannelAdapter.this.headerMapper.toHeaders(headers)) + .build(); + } + sendMessage(message); + } + + } + } diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/support/StompHeaderMapper.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/support/StompHeaderMapper.java index 9a52b0f487..b091a60dbf 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/support/StompHeaderMapper.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/support/StompHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2021 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -234,7 +234,6 @@ public class StompHeaderMapper implements HeaderMapper { return target; } - private static boolean shouldMapHeader(String headerName, String[] patterns) { if (patterns != null && patterns.length > 0) { for (String pattern : patterns) { diff --git a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java index adc3ad0d60..acf30513b8 100644 --- a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java +++ b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java @@ -209,7 +209,6 @@ public class StompServerIntegrationTests { } while (!(eventMessage.getPayload() instanceof StompConnectionFailedEvent) && n++ < 100); - assertThatExceptionOfType(MessageDeliveryException.class) .isThrownBy(() -> stompOutputChannel1.send(new GenericMessage<>("foo".getBytes()))) .withMessageContaining("could not deliver message"); diff --git a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java index 8d11caa100..454024febe 100644 --- a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java +++ b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapterWebSocketIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,6 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests { @Autowired private StompInboundChannelAdapter stompInboundChannelAdapter; - @Test public void testWebSocketStompClient() throws Exception { Message eventMessage = this.stompEvents.receive(10000); @@ -220,7 +219,6 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests { .isTrue(); } - private boolean containsDestination(String destination, SubscriptionRegistry subscriptionRegistry) { StompHeaderAccessor stompHeaderAccessor = StompHeaderAccessor.create(StompCommand.MESSAGE); stompHeaderAccessor.setDestination(destination); @@ -229,7 +227,6 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests { return !subscriptions.isEmpty(); } - // STOMP Client @Configuration @@ -248,7 +245,7 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests { @Bean public WebSocketStompClient stompClient( - @Qualifier("taskScheduler") TaskScheduler taskScheduler) { + @Qualifier("taskScheduler") TaskScheduler taskScheduler) { WebSocketStompClient webSocketStompClient = new WebSocketStompClient(webSocketClient()); webSocketStompClient.setMessageConverter(new MappingJackson2MessageConverter()); webSocketStompClient.setTaskScheduler(taskScheduler); @@ -348,8 +345,7 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests { //SimpleBrokerMessageHandler doesn't support RECEIPT frame, hence we emulate it this way @Bean public ApplicationListener webSocketEventListener( - @Qualifier("clientOutboundChannel") - final AbstractSubscribableChannel clientOutboundChannel) { + @Qualifier("clientOutboundChannel") final AbstractSubscribableChannel clientOutboundChannel) { return event -> { Message message = event.getMessage(); StompHeaderAccessor stompHeaderAccessor = StompHeaderAccessor.wrap(message); diff --git a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java index decdfcac33..b81a705074 100644 --- a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java +++ b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/outbound/StompMessageHandlerWebSocketIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -260,7 +260,6 @@ public class StompMessageHandlerWebSocketIntegrationTests { configurer.enableSimpleBroker("/topic", "/queue"); } - @Override public void configureClientInboundChannel(ChannelRegistration registration) { registration.interceptors(new ChannelInterceptor() { diff --git a/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java b/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java index edeaef7147..d92401d526 100644 --- a/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java +++ b/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,6 @@ public class ByteStreamReadingMessageSource extends AbstractMessageSource(new byte[] {1, 2, 3})); diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandlerTests.java b/spring-integration-stream/src/test/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandlerTests.java index 68266c329e..1d98bed6ba 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandlerTests.java +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ public class CharacterStreamWritingMessageHandlerTests { private ThreadPoolTaskScheduler scheduler; - @BeforeEach public void initialize() { writer = new StringWriter(); @@ -76,7 +75,6 @@ public class CharacterStreamWritingMessageHandlerTests { scheduler.destroy(); } - @Test public void singleString() { handler.handleMessage(new GenericMessage<>("foo")); @@ -190,7 +188,6 @@ public class CharacterStreamWritingMessageHandlerTests { assertThat(writer.toString()).isEqualTo("foo" + newLine + "bar" + newLine); } - private record TestObject(String text) { @Override @@ -200,7 +197,6 @@ public class CharacterStreamWritingMessageHandlerTests { } - private static class TestTrigger implements Trigger { private final AtomicBoolean hasRun = new AtomicBoolean(); diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java index 2826dbeeba..40274ce474 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,6 @@ public class ConsoleInboundChannelAdapterParserTests { stream.reset(); } - @Test public void adapterWithDefaultCharset() { SourcePollingChannelAdapter adapter = context.getBean("adapterWithDefaultCharset.adapter", diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java index a50af25134..13cd4690e7 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -153,7 +153,6 @@ public class ConsoleOutboundChannelAdapterParserTests { DirectFieldAccessor dfa = new DirectFieldAccessor(this.stderrAdapterHandler); dfa.setPropertyValue("writer", bufferedWriter); - this.stderrAdapterHandler.handleMessage(new GenericMessage("bar")); verify(bufferedWriter, times(1)).write(eq("bar")); @@ -212,4 +211,5 @@ public class ConsoleOutboundChannelAdapterParserTests { this.stdoutInsideNestedChain.send(new GenericMessage("foo")); verify(bufferedWriter, times(1)).write(eq("foobar")); } + } diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/DefaultConfigurationTests.java b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/DefaultConfigurationTests.java index 3e53aa00f4..edb08a7394 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/DefaultConfigurationTests.java +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/DefaultConfigurationTests.java @@ -47,7 +47,6 @@ public class DefaultConfigurationTests { @Autowired private ApplicationContext context; - @Test public void verifyErrorChannel() { Object errorChannel = context.getBean("errorChannel"); diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/MessageConverter.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/MessageConverter.java index e97c27c4ce..7314bd76cd 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/MessageConverter.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/MessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package org.springframework.integration.syslog; import org.springframework.messaging.Message; - /** * A converter to convert the raw message created by the underlying * UDP/TCP endpoint to a specific form of Syslog message. diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java index a749f642f1..e62583e398 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class RFC5424SyslogParser { protected final boolean retainOriginal; // NOSONAR final - /** * Construct a default parser; do not retain the original message content unless there * is an error. diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogInboundChannelAdapterParser.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogInboundChannelAdapterParser.java index 5e586dc241..3e372d17c5 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogInboundChannelAdapterParser.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogInboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ import org.springframework.util.xml.DomUtils; */ public class SyslogInboundChannelAdapterParser extends UdpInboundChannelAdapterParser { - @Override protected AbstractBeanDefinition doParse(Element element, ParserContext parserContext, String channelName) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(SyslogReceivingChannelAdapterFactoryBean.class); diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java index 9151f75490..494e721f13 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.syslog.inbound; - import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory; diff --git a/spring-integration-test-support/src/main/java/org/springframework/integration/test/rule/Log4j2LevelAdjuster.java b/spring-integration-test-support/src/main/java/org/springframework/integration/test/rule/Log4j2LevelAdjuster.java index 86107fe921..83c3e925c1 100644 --- a/spring-integration-test-support/src/main/java/org/springframework/integration/test/rule/Log4j2LevelAdjuster.java +++ b/spring-integration-test-support/src/main/java/org/springframework/integration/test/rule/Log4j2LevelAdjuster.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2022 the original author or authors. + * Copyright 2018-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,6 +89,7 @@ public final class Log4j2LevelAdjuster implements MethodRule { } } + return new AdjustingStatement(); } diff --git a/spring-integration-test-support/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java b/spring-integration-test-support/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java index 91bcd7a64f..32c838f757 100644 --- a/spring-integration-test-support/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java +++ b/spring-integration-test-support/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2021 the original author or authors. + * Copyright 2011-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -131,7 +131,6 @@ public class RequestResponseScenario { return this; } - /** * Set the request message (as an alternative to setPayload()) * @param message The message. diff --git a/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/OnlyOnceTrigger.java b/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/OnlyOnceTrigger.java index a9a6e3f980..6c750a8f02 100644 --- a/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/OnlyOnceTrigger.java +++ b/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/OnlyOnceTrigger.java @@ -47,7 +47,6 @@ public class OnlyOnceTrigger implements Trigger { private volatile CountDownLatch latch = new CountDownLatch(1); - public OnlyOnceTrigger() { this.executionTime = Instant.now(); } diff --git a/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/TestUtils.java b/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/TestUtils.java index 9a2a09b3c4..e371493a01 100644 --- a/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/TestUtils.java +++ b/spring-integration-test-support/src/main/java/org/springframework/integration/test/util/TestUtils.java @@ -156,7 +156,6 @@ public abstract class TestUtils { applicationContext.registerBean(beanName, (Class) bean.getClass(), () -> bean); } - /** * A {@link GenericApplicationContext} extension with some support methods * to register Spring Integration beans in the application context at runtime. diff --git a/spring-integration-test/src/test/java/org/springframework/integration/test/mock/MockMessageHandlerTests.java b/spring-integration-test/src/test/java/org/springframework/integration/test/mock/MockMessageHandlerTests.java index 2f44d9b3a8..c1326c0beb 100644 --- a/spring-integration-test/src/test/java/org/springframework/integration/test/mock/MockMessageHandlerTests.java +++ b/spring-integration-test/src/test/java/org/springframework/integration/test/mock/MockMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -211,7 +211,6 @@ public class MockMessageHandlerTests { mockMessageHandler() .handleNextAndReply(m -> m); - assertThatIllegalStateException() .isThrownBy(() -> this.mockIntegrationContext.substituteMessageHandlerFor(endpointId, mockMessageHandler2)) @@ -272,7 +271,6 @@ public class MockMessageHandlerTests { .isSameAs(mockMessageHandler); } - @Autowired private MessageChannel reactiveInputChannel; @@ -290,7 +288,6 @@ public class MockMessageHandlerTests { verify(mockMessageHandler).handleMessage(any(Message.class)); } - @Configuration @EnableIntegration public static class Config { @@ -361,7 +358,6 @@ public class MockMessageHandlerTests { return new LoggingHandler(LoggingHandler.Level.FATAL); } - @Bean @EndpointId("reactiveEndpoint") @ServiceActivator(inputChannel = "reactiveInputChannel", reactive = @Reactive) diff --git a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpoint.java b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpoint.java index d578597c6a..ecad415475 100644 --- a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpoint.java +++ b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -231,7 +231,6 @@ public class WebFluxInboundEndpoint extends BaseHttpInboundEndpoint implements W "Could not convert request: no suitable HttpMessageReader found for expected type [" + elementType + "] and content type [" + contentType + "]")); - Map readHints = Collections.emptyMap(); if (adapter != null && adapter.isMultiValue()) { Flux flux = httpMessageReader.read(bodyType, elementType, request, response, readHints); diff --git a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxIntegrationRequestMappingHandlerMapping.java b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxIntegrationRequestMappingHandlerMapping.java index 33b4853536..863e8d6f13 100644 --- a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxIntegrationRequestMappingHandlerMapping.java +++ b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/inbound/WebFluxIntegrationRequestMappingHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -191,7 +191,6 @@ public class WebFluxIntegrationRequestMappingHandlerMapping extends RequestMappi return config.applyPermitDefaultValues(); } - /** * {@link org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport}s * may depend on auto-created {@code requestChannel}s, so MVC Handlers detection should be postponed diff --git a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandler.java b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandler.java index 333380213d..b85c36c11d 100644 --- a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandler.java +++ b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,7 +85,6 @@ public class WebFluxRequestExecutingMessageHandler extends AbstractHttpRequestEx private StandardEvaluationContext evaluationContext; - /** * Create a handler that will send requests to the provided URI. * @param uri The URI. diff --git a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests.java b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests.java index 5daed5cd38..1f549a3955 100644 --- a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests.java +++ b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,7 +145,7 @@ public class WebFluxOutboundGatewayParserTests { assertThatExceptionOfType(BeanDefinitionParsingException.class) .isThrownBy(() -> new ClassPathXmlApplicationContext("WebFluxOutboundGatewayParser-encoding-mode-fail.xml", - getClass())) + getClass())) .withMessageContaining("The 'web-client' and 'encoding-mode' attributes are mutually exclusive"); } diff --git a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/dsl/WebFluxDslTests.java b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/dsl/WebFluxDslTests.java index bb8456c74f..e4d5238671 100644 --- a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/dsl/WebFluxDslTests.java +++ b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/dsl/WebFluxDslTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -214,7 +214,6 @@ public class WebFluxDslTests { @Autowired private PollableChannel storeChannel; - @Test @SuppressWarnings("unchecked") public void testHttpReactivePost() { @@ -382,7 +381,6 @@ public class WebFluxDslTests { return new MapReactiveUserDetailsService(userDetails()); } - @Bean public SecurityWebFilterChain reactiveSpringSecurityFilterChain(ServerHttpSecurity http) { return http.authorizeExchange(authorizeExchangeSpec -> authorizeExchangeSpec.anyExchange().hasRole("ADMIN")) diff --git a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpointTests.java b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpointTests.java index 490f466daf..18833862c3 100644 --- a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpointTests.java +++ b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/inbound/WebFluxInboundEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -148,7 +148,6 @@ public class WebFluxInboundEndpointTests { return Flux.just(new Person("Jane"), new Person("Jason"), new Person("John")); } - @Bean public WebFluxInboundEndpoint errorInboundEndpoint() { WebFluxInboundEndpoint endpoint = new WebFluxInboundEndpoint(); @@ -182,7 +181,6 @@ public class WebFluxInboundEndpointTests { } - static class Person { private final String name; diff --git a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/observation/WebFluxObservationPropagationTests.java b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/observation/WebFluxObservationPropagationTests.java index 6ab6e69191..8eb0e4476a 100644 --- a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/observation/WebFluxObservationPropagationTests.java +++ b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/observation/WebFluxObservationPropagationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,7 +145,6 @@ public class WebFluxObservationPropagationTests { return new BravePropagator(tracing); } - @Bean ObservationRegistry observationRegistry(Tracer tracer, Propagator propagator) { ObservationRegistry observationRegistry = ObservationRegistry.create(); diff --git a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandlerTests.java b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandlerTests.java index 93aded3ba4..29893db779 100644 --- a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandlerTests.java +++ b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -279,7 +279,6 @@ class WebFluxRequestExecutingMessageHandlerTests { ClientHttpResponse response = (ClientHttpResponse) receive.getPayload(); - assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(response.getHeaders().getContentType()).isEqualTo(MediaType.TEXT_PLAIN); @@ -410,6 +409,7 @@ class WebFluxRequestExecutingMessageHandlerTests { this.attributeValueName.set(request.attribute("name").orElse(null)); return next.exchange(request); } + } AttributeFilter attributeFilter = new AttributeFilter(); diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java index fb103b8aa3..4f185ae61b 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,6 @@ public class ServerWebSocketContainer extends IntegrationWebSocketContainer return this; } - /** * Configure one or more factories to decorate the handler used to process * WebSocket messages. This may be useful in some advanced use cases, for diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapter.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapter.java index 5c05d23faf..08b251f22b 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapter.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,7 +145,6 @@ public class WebSocketInboundChannelAdapter extends MessageProducerSupport this.messageConverters = new ArrayList<>(messageConverters); } - /** * Flag which determines if the default converters should be available after * custom converters. diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java index 74ec4ede6b..a5c079a17f 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -101,7 +101,6 @@ public class WebSocketOutboundMessageHandler extends AbstractMessageHandler { this.messageConverters = new ArrayList<>(messageConverters); } - /** * Flag which determines if the default converters should be available after * custom converters. diff --git a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/ClientWebSocketContainerTests.java b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/ClientWebSocketContainerTests.java index ea1a83e063..dc71c637a1 100644 --- a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/ClientWebSocketContainerTests.java +++ b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/ClientWebSocketContainerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2023 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.websocket; - import java.net.URI; import java.util.Collections; import java.util.HashMap; diff --git a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java index 78fa3c2f8b..4f4f3efa3c 100644 --- a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java +++ b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -260,7 +260,6 @@ public class StompIntegrationTests { this.webSocketOutputChannel.send(message2); - Message receive = webSocketInputChannel.receive(20000); assertThat(receive).isNotNull(); @@ -438,7 +437,6 @@ public class StompIntegrationTests { } - @MessagingGateway @Controller public interface WebSocketGateway { diff --git a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/dsl/WebSocketDslTests.java b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/dsl/WebSocketDslTests.java index c445769808..b9731875f7 100644 --- a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/dsl/WebSocketDslTests.java +++ b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/dsl/WebSocketDslTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2023 the original author or authors. + * Copyright 2021-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -149,7 +149,6 @@ public class WebSocketDslTests { } - @Configuration @EnableIntegration static class ServerConfig { diff --git a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapterTests.java b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapterTests.java index 9dca769b7d..518e1ff86a 100644 --- a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapterTests.java +++ b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/inbound/WebSocketInboundChannelAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,6 @@ public class WebSocketInboundChannelAdapterTests { Map sessions = TestUtils.getPropertyValue(this.subProtocolWebSocketHandler, "sessions", Map.class); - assertThat(sessions.size()).isEqualTo(1); String sessionId = sessions.keySet().iterator().next(); diff --git a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandlerTests.java b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandlerTests.java index ee33ccfd5b..e0ad4541a9 100644 --- a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandlerTests.java +++ b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 the original author or authors. + * Copyright 2014-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,6 @@ public class WebSocketOutboundMessageHandlerTests { assertThat(payload.getBytes()).isEqualTo(receivedPayload); } - @Configuration @EnableIntegration public static class ContextConfiguration { diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java index 50f8338b9e..377abca9c3 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -228,7 +228,6 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro return this.uriFactory.expand(this.uri, uriVariables); } - protected abstract Object doHandle(String theUri, Message requestMessage, WebServiceMessageCallback reqCallback); diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java index 1b0ae426f9..d7f6ea52cb 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -114,4 +114,5 @@ public class MarshallingWebServiceInboundGateway extends AbstractWebServiceInbou MarshallingUtils.marshal(this.marshaller, replyMessage.getPayload(), response); } } + } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java index e57505ae20..4853015278 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ import org.springframework.ws.client.support.destination.DestinationProvider; */ public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutboundGateway { - public MarshallingWebServiceOutboundGateway(DestinationProvider destinationProvider, Marshaller marshaller, Unmarshaller unmarshaller, WebServiceMessageFactory messageFactory) { super(destinationProvider, messageFactory); diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java index 08f2333a62..949322cbd5 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,7 +96,6 @@ public class SimpleWebServiceInboundGateway extends AbstractWebServiceInboundGat } } - private static class TransformerSupportDelegate extends TransformerObjectSupport { TransformerSupportDelegate() { diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java index 5481b2dd31..d5185e1a02 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -214,7 +214,6 @@ public class SimpleWebServiceOutboundGateway extends AbstractWebServiceOutboundG } - private static class DefaultSourceExtractor extends TransformerObjectSupport implements SourceExtractor { DefaultSourceExtractor() { diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java index b5fef23073..fe6e8071c2 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,4 +80,5 @@ public class WebServiceInboundGatewayParser extends AbstractInboundGatewayParser super.doParse(element, parserContext, builder); IntegrationNamespaceUtils.configureHeaderMapper(element, builder, parserContext, DefaultSoapHeaderMapper.class, null); } + } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsInboundGatewaySpec.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsInboundGatewaySpec.java index af47be5dd9..dbcaa4a53a 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsInboundGatewaySpec.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsInboundGatewaySpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import org.springframework.oxm.Unmarshaller; public class MarshallingWsInboundGatewaySpec extends BaseWsInboundGatewaySpec { - protected MarshallingWsInboundGatewaySpec() { super(new MarshallingWebServiceInboundGateway()); } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/SimpleWsOutboundGatewaySpec.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/SimpleWsOutboundGatewaySpec.java index 4560a6345f..fb584394ed 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/SimpleWsOutboundGatewaySpec.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/SimpleWsOutboundGatewaySpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,6 @@ public class SimpleWsOutboundGatewaySpec return this; } - @Override protected SimpleWebServiceOutboundGateway assemble(SimpleWebServiceOutboundGateway gateway) { SimpleWebServiceOutboundGateway assembled = super.assemble(gateway); @@ -115,7 +114,6 @@ public class SimpleWsOutboundGatewaySpec return this; } - /** * Specify the {@link WebServiceMessageFactory} to use. * @param messageFactory the message factory. diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/DefaultSoapHeaderMapperTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/DefaultSoapHeaderMapperTests.java index d9b26a3606..956a9322f8 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/DefaultSoapHeaderMapperTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/DefaultSoapHeaderMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,7 +222,6 @@ public class DefaultSoapHeaderMapperTests { System. out. println(stringResult.toString());*/ } - @Test public void testDoNotOverriderSoapAction() throws Exception { MimeHeaders mimeHeaders = new MimeHeaders(); diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/MarshallingWebServiceIntegrationTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/MarshallingWebServiceIntegrationTests.java index 853ab7e0b1..5192abd3f4 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/MarshallingWebServiceIntegrationTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/MarshallingWebServiceIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,7 +110,6 @@ public class MarshallingWebServiceIntegrationTests { } } - public boolean supports(Class clazz) { return true; } diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceInboundGatewayTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceInboundGatewayTests.java index 02b257d6fd..080c53e5ea 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceInboundGatewayTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceInboundGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,6 @@ public class SimpleWebServiceInboundGatewayTests { .isThrownBy(() -> gateway.invoke(context)); } - private Answer withReplyTo(final MessageChannel replyChannel) { return invocation -> { replyChannel.send((Message) invocation.getArguments()[0]); diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceOutboundGatewayTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceOutboundGatewayTests.java index ed82062960..df9cfd5ac6 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceOutboundGatewayTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/SimpleWebServiceOutboundGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,7 +116,6 @@ public class SimpleWebServiceOutboundGatewayTests { assertThat(soapActionFromCallback.get()).isEqualTo("\"" + soapActionHeaderValue + "\""); } - @Test //INT-1029 public void testWsOutboundGatewayInsideChain() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceInboundGatewayJavaConfigTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceInboundGatewayJavaConfigTests.java index b284d47e79..21680776a8 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceInboundGatewayJavaConfigTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceInboundGatewayJavaConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -112,7 +112,6 @@ public class WebServiceInboundGatewayJavaConfigTests { assertThat(output.toString().endsWith(input)).isTrue(); - context = mock(MessageContext.class); request = mock(SoapMessage.class); diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/DefaultConfigurationTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/DefaultConfigurationTests.java index 54ab4b11e7..375667c410 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/DefaultConfigurationTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/DefaultConfigurationTests.java @@ -47,7 +47,6 @@ public class DefaultConfigurationTests { @Autowired private ApplicationContext context; - @Test public void verifyErrorChannel() { Object errorChannel = context.getBean("errorChannel"); diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubMarshallerAndUnmarshaller.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubMarshallerAndUnmarshaller.java index b5b7d5752d..78eed372c5 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubMarshallerAndUnmarshaller.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubMarshallerAndUnmarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import org.springframework.oxm.XmlMappingException; */ public class StubMarshallerAndUnmarshaller implements Marshaller, Unmarshaller { - @SuppressWarnings("rawtypes") public boolean supports(Class clazz) { return false; diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubUnmarshaller.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubUnmarshaller.java index f4580e0ee0..253af64868 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubUnmarshaller.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/StubUnmarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import org.springframework.oxm.XmlMappingException; */ public class StubUnmarshaller implements Unmarshaller { - @SuppressWarnings("rawtypes") public boolean supports(Class clazz) { return false; diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java index 5041cb3ba2..06bcfb50bb 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -179,7 +179,6 @@ public class WebServiceInboundGatewayParserTests { assertThat(TestUtils.getPropertyValue(replyTimeoutGateway, "messagingTemplate.receiveTimeout")).isEqualTo(1234L); } - @SuppressWarnings("unused") private static class TestHeaderMapper implements SoapHeaderMapper { diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java index 0446a71ace..e7f12c8766 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -202,7 +202,6 @@ public class WebServiceOutboundGatewayParserTests { assertThat(accessor.getPropertyValue("faultMessageResolver")).isEqualTo(resolver); } - @Test public void simpleGatewayWithCustomMessageSender() { AbstractEndpoint endpoint = this.context.getBean("gatewayWithCustomMessageSender", AbstractEndpoint.class); diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java index d40534dd61..4e783155ce 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ public class AggregatedXmlMessageValidationException extends RuntimeException { private final List exceptions; - public AggregatedXmlMessageValidationException(List exceptions) { this.exceptions = (exceptions != null) ? exceptions : Collections.emptyList(); } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/DefaultXmlPayloadConverter.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/DefaultXmlPayloadConverter.java index be48e562bd..c70f5f49e0 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/DefaultXmlPayloadConverter.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/DefaultXmlPayloadConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,6 @@ public class DefaultXmlPayloadConverter implements XmlPayloadConverter { this.documentBuilderFactory = documentBuilderFactory; } - @Override public Document convertToDocument(Object object) { try { diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java index a20844ae42..9d2e11199f 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ public class XPathFilterParser extends AbstractConsumerEndpointParser { private final XPathExpressionParser xpathParser = new XPathExpressionParser(); - @Override protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) { final BeanDefinitionBuilder selectorBuilder = BeanDefinitionBuilder.genericBeanDefinition(); diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathRouterParser.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathRouterParser.java index 6e595a952e..b5fd4148ae 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathRouterParser.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathRouterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class XPathRouterParser extends AbstractRouterParser { private final XPathExpressionParser xpathParser = new XPathExpressionParser(); - @Override protected BeanDefinition doParseRouter(Element element, ParserContext parserContext) { BeanDefinitionBuilder xpathRouterBuilder = BeanDefinitionBuilder.genericBeanDefinition(XPathRouter.class); diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/result/DomResultFactory.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/result/DomResultFactory.java index 4ee51dab40..584af90d78 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/result/DomResultFactory.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/result/DomResultFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class DomResultFactory implements ResultFactory { private final Lock lock = new ReentrantLock(); - public DomResultFactory() { this(DocumentBuilderFactoryUtils.newInstance()); this.documentBuilderFactory.setNamespaceAware(true); @@ -54,7 +53,6 @@ public class DomResultFactory implements ResultFactory { this.documentBuilderFactory = documentBuilderFactory; } - @Override public Result createResult(Object payload) { this.lock.lock(); diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java index c9a80e9b0d..72a949d4d6 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -122,7 +122,6 @@ public class XPathRouter extends AbstractMappingMessageRouter { } } - private static class TextContentNodeMapper implements NodeMapper { TextContentNodeMapper() { diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java index 5dbefda1f2..990f6a8f0a 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,6 @@ public abstract class AbstractXPathMessageSelector implements MessageSelector { private volatile XmlPayloadConverter converter = new DefaultXmlPayloadConverter(); - /** * @param xPathExpression XPath expression as a String */ @@ -70,7 +69,6 @@ public abstract class AbstractXPathMessageSelector implements MessageSelector { this.xPathExpresion = xPathExpression; } - /** * Specify the converter used to convert payloads prior to XPath testing. * diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/BooleanTestXPathMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/BooleanTestXPathMessageSelector.java index d9e3d5ed81..839b27c545 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/BooleanTestXPathMessageSelector.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/BooleanTestXPathMessageSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,6 @@ public class BooleanTestXPathMessageSelector extends AbstractXPathMessageSelecto super(expression); } - /** * Return true if the {@link XPathExpression} evaluates to true */ diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/RegexTestXPathMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/RegexTestXPathMessageSelector.java index 08c22115e8..abfb94b61c 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/RegexTestXPathMessageSelector.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/RegexTestXPathMessageSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class RegexTestXPathMessageSelector extends AbstractXPathMessageSelector private final String regex; - /** * Creates a selector which attempts to match the given regex and supports multiple namespaces. * @@ -92,7 +91,6 @@ public class RegexTestXPathMessageSelector extends AbstractXPathMessageSelector this.regex = regex; } - /** * Evaluate the payload and return true if the value returned by the * {@link XPathExpression} matches the regex. diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java index 549f2ca5ff..4804072fe8 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel private volatile boolean caseSensitive = true; - /** * Create a selector which tests for the given value and supports multiple namespaces. * @@ -85,7 +84,6 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel this.valueToTestFor = valueToTestFor; } - /** * Specify whether comparison of value returned by {@link XPathExpression} * to test value should be case sensitive. Default is 'true'. diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java index 306bebf439..e80e99eb13 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,7 +74,6 @@ public class XmlValidatingMessageSelector implements MessageSelector { private XmlPayloadConverter converter = new DefaultXmlPayloadConverter(); - /** * Create a selector with a default {@link XmlValidator}. The validator will be initialized with * the provided 'schema' location {@link Resource} and 'schemaType'. The valid options for schema @@ -96,7 +95,6 @@ public class XmlValidatingMessageSelector implements MessageSelector { this.xmlValidator = xmlValidator; } - public XmlValidatingMessageSelector(Resource schema, String schemaType) throws IOException { this(schema, StringUtils.hasText(schemaType) @@ -104,7 +102,6 @@ public class XmlValidatingMessageSelector implements MessageSelector { : null); } - public void setThrowExceptionOnRejection(boolean throwExceptionOnRejection) { this.throwExceptionOnRejection = throwExceptionOnRejection; } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java index 4714e1bbfc..713dcc2c5a 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class DomSourceFactory implements SourceFactory { private final DocumentBuilderFactory documentBuilderFactory; - public DomSourceFactory() { this(DocumentBuilderFactoryUtils.newInstance()); this.documentBuilderFactory.setNamespaceAware(true); @@ -60,7 +59,6 @@ public class DomSourceFactory implements SourceFactory { this.documentBuilderFactory = documentBuilderFactory; } - public Source createSource(Object payload) { Source source = null; if (payload instanceof Document) { diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java index b1317fdc1b..3fe4983f0a 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ public class StringSourceFactory implements SourceFactory { private final TransformerFactory transformerFactory; - public StringSourceFactory() { this(TransformerFactoryUtils.newInstance()); } @@ -60,7 +59,6 @@ public class StringSourceFactory implements SourceFactory { this.transformerFactory = transformerFactory; } - public Source createSource(Object payload) { Source source = null; if (payload instanceof String) { diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java index dd3fd17f51..14a0a1318b 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ public class MarshallingTransformer extends AbstractXmlTransformer { private volatile boolean extractPayload = true; - public MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer) { Assert.notNull(marshaller, "a marshaller is required"); this.marshaller = marshaller; @@ -54,7 +53,6 @@ public class MarshallingTransformer extends AbstractXmlTransformer { this(marshaller, null); } - /** * Specify whether the source Message's payload should be extracted prior * to marshalling. This value is set to "true" by default. To send the @@ -70,7 +68,6 @@ public class MarshallingTransformer extends AbstractXmlTransformer { return "xml:marshalling-transformer"; } - @Override public Object doTransform(Message message) { Object source = (this.extractPayload) ? message.getPayload() : message; diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToDocumentTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToDocumentTransformer.java index 10a77624bb..3c0f19ad6b 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToDocumentTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToDocumentTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class ResultToDocumentTransformer implements ResultTransformer { // Not guaranteed to be thread safe private final DocumentBuilderFactory documentBuilderFactory; - public ResultToDocumentTransformer() { this(DocumentBuilderFactoryUtils.newInstance()); this.documentBuilderFactory.setNamespaceAware(true); @@ -60,7 +59,6 @@ public class ResultToDocumentTransformer implements ResultTransformer { this.documentBuilderFactory = documentBuilderFactory; } - public Object transformResult(Result result) { Document document; if (DOMResult.class.isAssignableFrom(result.getClass())) { diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToStringTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToStringTransformer.java index cffdd19896..cda6f0fcbb 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToStringTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/ResultToStringTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ public class ResultToStringTransformer implements ResultTransformer { private Properties outputProperties; - public ResultToStringTransformer() { this.transformerFactory = TransformerFactoryUtils.newInstance(); } @@ -65,7 +64,6 @@ public class ResultToStringTransformer implements ResultTransformer { this.transformerFactory = transformerFactory; } - public void setOutputProperties(Properties outputProperties) { this.outputProperties = outputProperties; } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/SourceCreatingTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/SourceCreatingTransformer.java index 0e371c32e1..defbf3e164 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/SourceCreatingTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/SourceCreatingTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ public class SourceCreatingTransformer extends AbstractPayloadTransformer nodeMapper; - /** * Create an {@link XPathTransformer} that will create an XPath expression from the given String * to be evaluated against converted inbound Message payloads. @@ -74,7 +73,6 @@ public class XPathTransformer extends AbstractTransformer { this.xpathExpression = expression; } - /** * Specify the expected {@link XPathEvaluationType}. The default is {@link XPathEvaluationType#STRING_RESULT}. * diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java index 59370f1665..1ce83f6b8d 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -363,7 +363,6 @@ public class XsltPayloadTransformer extends AbstractXmlTransformer implements Be return (Document) domResult.getNode(); } - private Transformer buildTransformer(Message message) throws TransformerException { // process individual mappings Transformer transformer = this.templates.newTransformer(); diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathEvaluationType.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathEvaluationType.java index 3a946589ac..9835a555aa 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathEvaluationType.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathEvaluationType.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public enum XPathEvaluationType { } }; - public abstract Object evaluateXPath(XPathExpression expression, Node node); } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java index 67f9068a8f..8e60e8cb0f 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.xml.xpath; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/DefaultXmlPayloadConverterTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/DefaultXmlPayloadConverterTests.java index 8005419b4e..8b83817958 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/DefaultXmlPayloadConverterTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/DefaultXmlPayloadConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,7 +94,6 @@ public class DefaultXmlPayloadConverterTests { assertThat(n).and(TEST_DOCUMENT_AS_STRING).areIdentical(); } - @Test public void testGetSourcePassingDocument() { Source source = converter.convertToSource(testDocument); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/ChainElementsTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/ChainElementsTests.java index b4559939ae..f7c5de2ba3 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/ChainElementsTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/ChainElementsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import org.springframework.integration.xml.transformer.XPathTransformer; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - /** * @author Gunnar Hillert * @author Artem Bilan diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/DefaultConfigurationTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/DefaultConfigurationTests.java index c2a24b6141..646f084c7b 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/DefaultConfigurationTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/DefaultConfigurationTests.java @@ -16,7 +16,6 @@ package org.springframework.integration.xml.config; - import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -48,7 +47,6 @@ public class DefaultConfigurationTests { @Autowired private ApplicationContext context; - @Test public void verifyErrorChannel() { Object errorChannel = context.getBean("errorChannel"); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/TestXmlApplicationContext.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/TestXmlApplicationContext.java index e218134d52..5f125b50e3 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/TestXmlApplicationContext.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/TestXmlApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class TestXmlApplicationContext extends AbstractXmlApplicationContext { this.xmlString = xmlString; } - @Override public String getDescription() { return "test"; diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/UnmarshallingTransformerParserTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/UnmarshallingTransformerParserTests.java index 9b82259850..182320ef6b 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/UnmarshallingTransformerParserTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/UnmarshallingTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -134,7 +134,6 @@ public class UnmarshallingTransformerParserTests { assertThat(unmarshaller.sourcesPassed.poll()).isInstanceOf(StringSource.class); } - @Test public void testUnmarshallUnsupported() { MessageChannel input = (MessageChannel) appContext.getBean("input"); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathHeaderEnricherParserTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathHeaderEnricherParserTests.java index bdc3b94ee2..8b4196b3df 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathHeaderEnricherParserTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathHeaderEnricherParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,6 @@ public class XPathHeaderEnricherParserTests { private final Message message = MessageBuilder.withPayload("").build(); - @Test public void testParse() { EventDrivenConsumer consumer = (EventDrivenConsumer) context.getBean("parseOnly"); @@ -171,7 +170,6 @@ public class XPathHeaderEnricherParserTests { assertThat(reply.getHeaders().get("foo")).isEqualTo("bar"); } - private Message getResultMessage() { this.input.send(message); return output.receive(0); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathRouterParserTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathRouterParserTests.java index fcc1d87df3..e917119aba 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathRouterParserTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathRouterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,6 @@ public class XPathRouterParserTests { @Autowired @Qualifier("defaultOutput") QueueChannel defaultOutput; - ConfigurableApplicationContext appContext; public EventDrivenConsumer buildContext(String routerDef) { @@ -90,7 +89,6 @@ public class XPathRouterParserTests { return consumer; } - @AfterEach public void tearDown() { if (appContext != null) { @@ -333,7 +331,6 @@ public class XPathRouterParserTests { ac.close(); } - @SuppressWarnings("unused") private static class TestXmlPayloadConverter extends DefaultXmlPayloadConverter { diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathTransformerParserTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathTransformerParserTests.java index bee66b6f48..06d14793ad 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathTransformerParserTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/config/XPathTransformerParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -159,7 +159,6 @@ public class XPathTransformerParserTests { assertThat(output.receive(0).getPayload()).isEqualTo(84d); } - @SuppressWarnings("unused") private static class TestNodeMapper implements NodeMapper { @@ -167,8 +166,8 @@ public class XPathTransformerParserTests { public Object mapNode(Node node, int nodeNum) throws DOMException { return node.getTextContent() + "-mapped"; } - } + } @SuppressWarnings("unused") private static class TestXmlPayloadConverter implements XmlPayloadConverter { diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/source/StringSourceTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/source/StringSourceTests.java index dd7ba9c892..a330880bf3 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/source/StringSourceTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/source/StringSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,6 @@ public class StringSourceTests { assertThat(docAsString).and(testDoc).areIdentical(); } - @Test public void testWithString() throws Exception { String docString = "one"; @@ -64,7 +63,6 @@ public class StringSourceTests { assertThat(docAsString).and(docString).areIdentical(); } - @Test public void testWithUnsupportedPayload() { StringBuffer buffer = new StringBuffer(testDoc); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/splitter/XPathMessageSplitterTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/splitter/XPathMessageSplitterTests.java index fef9020a19..d79d2c8590 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/splitter/XPathMessageSplitterTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/splitter/XPathMessageSplitterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,6 @@ public class XPathMessageSplitterTests { private final QueueChannel replyChannel = new QueueChannel(); - @BeforeEach public void setUp() { String splittingXPath = "/orders/order"; @@ -53,7 +52,6 @@ public class XPathMessageSplitterTests { this.splitter.setRequiresReply(true); } - @Test public void splitDocument() throws Exception { Document doc = XmlTestUtil.getDocumentForString(""" diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/CustomTestResultFactory.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/CustomTestResultFactory.java index 4c3b509244..8cc7f0d8aa 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/CustomTestResultFactory.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/CustomTestResultFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.xml.transformer; - import java.io.StringWriter; import javax.xml.transform.Result; @@ -28,7 +27,6 @@ public class CustomTestResultFactory implements ResultFactory { private final String stringToReturn; - public CustomTestResultFactory(String stringToReturn) { this.stringToReturn = stringToReturn; } @@ -39,7 +37,6 @@ public class CustomTestResultFactory implements ResultFactory { public static class FixedStringResult extends StreamResult { - private final String stringToReturn; public FixedStringResult(String stringToReturn) { diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/MarshallingTransformerTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/MarshallingTransformerTests.java index 7248eaa71b..dd0ef76fe5 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/MarshallingTransformerTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/MarshallingTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,7 +74,6 @@ public class MarshallingTransformerTests { assertThat(marshaller.messages.get(0)).isSameAs(message); } - private static class TestMarshaller implements Marshaller { private final List> messages = new ArrayList<>(); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/ResultToStringTransformerTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/ResultToStringTransformerTests.java index 21a5c8d5c0..58d41b46d3 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/ResultToStringTransformerTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/ResultToStringTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public class ResultToStringTransformerTests { """; - @BeforeEach public void setUp() { transformer = new ResultToStringTransformer(); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/UnmarshallingTransformerTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/UnmarshallingTransformerTests.java index 5a9657c9da..f8af793a2b 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/UnmarshallingTransformerTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/UnmarshallingTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,6 @@ public class UnmarshallingTransformerTests { assertThat(result.getPayload()).isEqualTo("message: bar"); } - private record TestUnmarshaller(boolean returnMessage) implements Unmarshaller { @Override diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XPathTransformerTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XPathTransformerTests.java index 0a93a0fb09..c4ba7fd627 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XPathTransformerTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XPathTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,13 +51,11 @@ public class XPathTransformerTests { private volatile Message message; - @BeforeEach public void createMessage() { this.message = MessageBuilder.withPayload(XML).build(); } - @Test public void stringResultTypeByDefault() { XPathTransformer transformer = new XPathTransformer("/parent/child/@name"); @@ -137,7 +135,6 @@ public class XPathTransformerTests { assertThat(result).isEqualTo("custom"); } - private static class TestNodeMapper implements NodeMapper { TestNodeMapper() { @@ -151,7 +148,6 @@ public class XPathTransformerTests { } - private static class TestXmlPayloadConverter implements XmlPayloadConverter { TestXmlPayloadConverter() { diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltPayloadTransformerTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltPayloadTransformerTests.java index 4192763472..300b6018e8 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltPayloadTransformerTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltPayloadTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; import static org.xmlunit.assertj3.XmlAssert.assertThat; - /** * @author Jonas Partner * @author Oleg Zhurakousky @@ -199,7 +198,6 @@ public class XsltPayloadTransformerTests { assertThat(transformed).and(this.outputAsString).areIdentical(); } - @Test public void documentInStringResultOut() throws Exception { Resource resource = new ClassPathResource("transform-with-import.xsl", getClass()); @@ -215,7 +213,6 @@ public class XsltPayloadTransformerTests { .isInstanceOf(StringResult.class); } - @Test public void stringInDomResultOut() throws Exception { Resource resource = new ClassPathResource("transform-with-import.xsl", getClass()); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltTransformerTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltTransformerTests.java index b2eb902618..09a8906020 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltTransformerTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -122,7 +122,6 @@ public class XsltTransformerTests { assertThat(((String) resultMessage.getPayload()).contains("hello")).isTrue(); } - @Test public void outputAsString() { var input = applicationContext.getBean("outputAsStringChannel", MessageChannel.class); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/jaxbmarshaling/JaxbMarshallingIntegrationTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/jaxbmarshaling/JaxbMarshallingIntegrationTests.java index 3423df475e..799d1a92f1 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/jaxbmarshaling/JaxbMarshallingIntegrationTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/jaxbmarshaling/JaxbMarshallingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,6 @@ public class JaxbMarshallingIntegrationTests { assertThat(doc.getDocumentElement().getLocalName()).as("Wrong name for root element ").isEqualTo("person"); } - @Test public void testUnmarshalling() { StringSource source = new StringSource("bob"); diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/util/XmlTestUtil.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/util/XmlTestUtil.java index c06ad870e2..bead51b868 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/util/XmlTestUtil.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/util/XmlTestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,4 +86,5 @@ public class XmlTestUtil { transform(source, res); return res.toString(); } + } diff --git a/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java b/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java index 75624bc952..b5e05f506d 100644 --- a/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java +++ b/spring-integration-xml/src/test/java/org/springframework/integration/xml/xpath/XPathTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2023 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -129,7 +129,6 @@ public class XPathTests { result = XPathUtils.evaluate(XML, "/parent/child/@name", new TestNodeMapper()); assertThat(result).isEqualTo("test-mapped"); - assertThatExceptionOfType(MessagingException.class) .isThrownBy(() -> XPathUtils.evaluate(new Date(), "/parent/child")) .withMessageContaining("unsupported payload type"); @@ -185,7 +184,6 @@ public class XPathTests { assertThat(stringSourceFactory.createSource(receive.getPayload()).toString()).contains("book2"); } - @Test public void testInt3140Router() { this.xpathRouterInput.send(new GenericMessage("A")); @@ -205,7 +203,6 @@ public class XPathTests { assertThat(receive.getPayload()).isEqualTo("X"); } - public static class TestNodeMapper implements NodeMapper { @Override diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/AbstractXmppOutboundChannelAdapterParser.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/AbstractXmppOutboundChannelAdapterParser.java index 01a15c6167..7c5e92e35e 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/AbstractXmppOutboundChannelAdapterParser.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/AbstractXmppOutboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,4 +58,5 @@ public abstract class AbstractXmppOutboundChannelAdapterParser extends AbstractO } protected abstract String getHandlerClassName(); + } diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParser.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParser.java index f3b200b135..948704a0da 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParser.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageOutboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.xmpp.config; - import org.w3c.dom.Element; import org.springframework.beans.factory.config.RuntimeBeanReference; diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParser.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParser.java index 6392068d81..a4a5b03825 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParser.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.xmpp.config; - /** * Parser for 'xmpp:presence-outbound-channel-adapter' element * diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java index 833bfc7162..eabd2abe12 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,6 @@ public class XmppConnectionFactoryBean extends AbstractFactoryBean { + } diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/ConsoleChatTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/ConsoleChatTests.java index d8d1738795..1b62f8a923 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/ConsoleChatTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/ConsoleChatTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.xmpp.ignore; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundPresenceTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundPresenceTests.java index 2bba649849..a2f9cf59f3 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundPresenceTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundPresenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.xmpp.ignore; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java index 67caf630a8..f9e0a78ab0 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -257,7 +257,6 @@ public class ChatMessageListeningEndpointTests { private static class TestXMPPConnection extends XMPPTCPConnection { - TestXMPPConnection() throws XmppStringprepException { super(XMPPTCPConnectionConfiguration.builder().setXmppDomain("example.org").build()); diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/outbound/ChatMessageSendingMessageHandlerTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/outbound/ChatMessageSendingMessageHandlerTests.java index 49433d8bc5..7a596371d5 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/outbound/ChatMessageSendingMessageHandlerTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/outbound/ChatMessageSendingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,7 +118,6 @@ public class ChatMessageSendingMessageHandlerTests { .setBody("Test Message") .build(); - Message message = MessageBuilder.withPayload(smackMessage).build(); // first Message new handler.handleMessage(message); @@ -184,7 +183,6 @@ public class ChatMessageSendingMessageHandlerTests { verify(extensionElementProvider).from(eq(json)); } - @Test public void validateFailureNoChatToUser() { ChatMessageSendingMessageHandler handler = new ChatMessageSendingMessageHandler(mock(XMPPConnection.class)); diff --git a/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMq.java b/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMq.java index 834f1e0864..74a2c530f9 100644 --- a/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMq.java +++ b/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMq.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -119,7 +119,6 @@ public final class ZeroMq { return new ZeroMqMessageProducerSpec(context, socketType); } - private ZeroMq() { } diff --git a/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMqMessageHandlerSpec.java b/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMqMessageHandlerSpec.java index 57506db768..24e14af7a7 100644 --- a/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMqMessageHandlerSpec.java +++ b/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/dsl/ZeroMqMessageHandlerSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,6 @@ public class ZeroMqMessageHandlerSpec super(new ZeroMqMessageHandler(context, connectUrl)); } - /** * Create an instance based on the provided {@link ZContext}, connection string and {@link SocketType}. * @param context the {@link ZContext} to use for creating sockets. diff --git a/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandler.java b/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandler.java index 4a2fe185c0..df6ac71d04 100644 --- a/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandler.java +++ b/spring-integration-zeromq/src/main/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -119,7 +119,6 @@ public class ZeroMqMessageHandler extends AbstractReactiveMessageHandler Assert.hasText(connectUrl, "'connectUrl' must not be empty"); } - /** * Create an instance based on the provided {@link ZContext}, connection string supplier and {@link SocketType}. * @param context the {@link ZContext} to use for creating sockets. diff --git a/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/channel/ZeroMqChannelTests.java b/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/channel/ZeroMqChannelTests.java index d85c9b85e6..79e802c924 100644 --- a/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/channel/ZeroMqChannelTests.java +++ b/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/channel/ZeroMqChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -177,7 +177,6 @@ public class ZeroMqChannelTests { proxy.destroy(); } - @Test void testPubSubBind() throws InterruptedException { ZeroMqProxy proxy = new ZeroMqProxy(CONTEXT, ZeroMqProxy.Type.SUB_PUB); diff --git a/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandlerTests.java b/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandlerTests.java index 237f9c1751..0d491ae487 100644 --- a/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandlerTests.java +++ b/spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/outbound/ZeroMqMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.integration.zeromq.outbound; - import java.time.Duration; import org.junit.jupiter.api.AfterAll; diff --git a/spring-integration-zip/src/main/java/org/springframework/integration/zip/config/xml/ZipNamespaceHandler.java b/spring-integration-zip/src/main/java/org/springframework/integration/zip/config/xml/ZipNamespaceHandler.java index 5643ece885..5920ce58f9 100644 --- a/spring-integration-zip/src/main/java/org/springframework/integration/zip/config/xml/ZipNamespaceHandler.java +++ b/spring-integration-zip/src/main/java/org/springframework/integration/zip/config/xml/ZipNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ public class ZipNamespaceHandler extends AbstractIntegrationNamespaceHandler { @Override public void init() { - this.registerBeanDefinitionParser("zip-transformer", new ZipTransformerParser()); - this.registerBeanDefinitionParser("unzip-transformer", new UnZipTransformerParser()); + this.registerBeanDefinitionParser("zip-transformer", new ZipTransformerParser()); + this.registerBeanDefinitionParser("unzip-transformer", new UnZipTransformerParser()); } } diff --git a/spring-integration-zip/src/test/java/org/springframework/integration/zip/UnZip2FileTests.java b/spring-integration-zip/src/test/java/org/springframework/integration/zip/UnZip2FileTests.java index 9074dd9d4e..ef829e3434 100644 --- a/spring-integration-zip/src/test/java/org/springframework/integration/zip/UnZip2FileTests.java +++ b/spring-integration-zip/src/test/java/org/springframework/integration/zip/UnZip2FileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -149,7 +149,7 @@ public class UnZip2FileTests { } private static void cleanupDirectory(File dir) { - for (File file: dir.listFiles()) { + for (File file : dir.listFiles()) { if (file.isDirectory()) { cleanupDirectory(file); } diff --git a/spring-integration-zip/src/test/java/org/springframework/integration/zip/transformer/UnZipTransformerTests.java b/spring-integration-zip/src/test/java/org/springframework/integration/zip/transformer/UnZipTransformerTests.java index ce4a955f26..2b2cc54390 100644 --- a/spring-integration-zip/src/test/java/org/springframework/integration/zip/transformer/UnZipTransformerTests.java +++ b/spring-integration-zip/src/test/java/org/springframework/integration/zip/transformer/UnZipTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -198,7 +198,6 @@ public class UnZipTransformerTests { unZipTransformer.setExpectSingleResult(true); unZipTransformer.afterPropertiesSet(); - assertThatExceptionOfType(MessagingException.class) .isThrownBy(() -> unZipTransformer.transform(message)) .withStackTraceContaining("The UnZip operation extracted 5 result objects " + @@ -232,7 +231,6 @@ public class UnZipTransformerTests { final UnZipTransformer unZipTransformer = new UnZipTransformer(); unZipTransformer.afterPropertiesSet(); - assertThatExceptionOfType(MessageTransformationException.class) .isThrownBy(() -> unZipTransformer.transform(message)) .withRootCauseInstanceOf(ZipException.class) diff --git a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/CuratorFrameworkFactoryBean.java b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/CuratorFrameworkFactoryBean.java index 4fca3c612e..4a2778de64 100644 --- a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/CuratorFrameworkFactoryBean.java +++ b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/CuratorFrameworkFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2023 the original author or authors. + * Copyright 2015-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,6 @@ public class CuratorFrameworkFactoryBean implements FactoryBean - + + + + diff --git a/src/idea/spring-framework.xml b/src/idea/spring-framework.xml index c2dddb7c7c..a66a6d14c3 100644 --- a/src/idea/spring-framework.xml +++ b/src/idea/spring-framework.xml @@ -40,9 +40,15 @@ +