Add EmptyLineSeparator Checkstyle rule
* Support "blank lines around" via `spring-framework.xml` IDEA config * Fix all the Checkstyle violations
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author 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<Throwable> exceptions;
|
||||
|
||||
|
||||
public AggregatedXmlMessageValidationException(List<Throwable> exceptions) {
|
||||
this.exceptions = (exceptions != null) ? exceptions : Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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<Object> {
|
||||
|
||||
TextContentNodeMapper() {
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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 <code>true</code>
|
||||
*/
|
||||
|
||||
@@ -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 <code>regex</code>.
|
||||
|
||||
@@ -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'.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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())) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<Object
|
||||
|
||||
private final SourceFactory sourceFactory;
|
||||
|
||||
|
||||
public SourceCreatingTransformer() {
|
||||
this.sourceFactory = new DomSourceFactory();
|
||||
}
|
||||
@@ -41,7 +40,6 @@ public class SourceCreatingTransformer extends AbstractPayloadTransformer<Object
|
||||
this.sourceFactory = sourceFactory;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Source transformPayload(Object payload) {
|
||||
return this.sourceFactory.createSource(payload);
|
||||
|
||||
@@ -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.
|
||||
@@ -52,7 +52,6 @@ public class XPathTransformer extends AbstractTransformer {
|
||||
|
||||
private volatile NodeMapper<?> 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}.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author 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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author 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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author 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";
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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("<person name='John Doe' age='42' married='true'/>").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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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<Object> {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>one</item>";
|
||||
@@ -64,7 +63,6 @@ public class StringSourceTests {
|
||||
assertThat(docAsString).and(docString).areIdentical();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWithUnsupportedPayload() {
|
||||
StringBuffer buffer = new StringBuffer(testDoc);
|
||||
|
||||
@@ -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("""
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<Message<?>> messages = new ArrayList<>();
|
||||
|
||||
@@ -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 {
|
||||
</order>
|
||||
""";
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
transformer = new ResultToStringTransformer();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author 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<Object> {
|
||||
|
||||
TestNodeMapper() {
|
||||
@@ -151,7 +148,6 @@ public class XPathTransformerTests {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static class TestXmlPayloadConverter implements XmlPayloadConverter {
|
||||
|
||||
TestXmlPayloadConverter() {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author 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("<person><firstname>bob</firstname></person>");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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("<book>book2</book>");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testInt3140Router() {
|
||||
this.xpathRouterInput.send(new GenericMessage<Object>("<name>A</name>"));
|
||||
@@ -205,7 +203,6 @@ public class XPathTests {
|
||||
assertThat(receive.getPayload()).isEqualTo("<name>X</name>");
|
||||
}
|
||||
|
||||
|
||||
public static class TestNodeMapper implements NodeMapper<String> {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user