GH-7: Add checkstyle and javaformat plugins

Fixes: #7

* Run `./gradlew format`
* Updates from PR review suggestions
This commit is contained in:
Chris Bono
2023-12-29 21:08:58 -06:00
committed by Artem Bilan
parent 84e732da08
commit 836708f0f2
357 changed files with 4344 additions and 4519 deletions

View File

@@ -58,8 +58,8 @@ public class HeaderEnricherFunctionConfiguration {
Enumeration<?> enumeration = props.propertyNames();
while (enumeration.hasMoreElements()) {
String propertyName = (String) enumeration.nextElement();
ExpressionEvaluatingHeaderValueMessageProcessor<?> headerValueMessageProcessor =
new ExpressionEvaluatingHeaderValueMessageProcessor<>(props.getProperty(propertyName), null);
ExpressionEvaluatingHeaderValueMessageProcessor<?> headerValueMessageProcessor = new ExpressionEvaluatingHeaderValueMessageProcessor<>(
props.getProperty(propertyName), null);
headerValueMessageProcessor.setBeanFactory(beanFactory);
headersToAdd.put(propertyName, headerValueMessageProcessor);
}

View File

@@ -35,8 +35,8 @@ import org.springframework.validation.annotation.Validated;
public class HeaderEnricherFunctionProperties {
/**
* \n separated properties representing headers in which values are SpEL expressions, e.g
* foo='bar' \n baz=payload.baz.
* \n separated properties representing headers in which values are SpEL expressions,
* e.g foo='bar' \n baz=payload.baz.
*/
private Properties headers;

View File

@@ -33,12 +33,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
/**
*
* @author Gary Russell
* @author Soby Chacko
*/
@SpringBootTest(properties = {
"header.enricher.headers=foo='bar' \\n baz='fiz' \\n buz=payload \\n jaz=@value",
@SpringBootTest(properties = { "header.enricher.headers=foo='bar' \\n baz='fiz' \\n buz=payload \\n jaz=@value",
"header.enricher.overwrite = true" })
@DirtiesContext
public class HeaderEnricherFunctionApplicationTests {
@@ -48,8 +46,7 @@ public class HeaderEnricherFunctionApplicationTests {
@Test
public void testDefault() {
final Message<?> message = MessageBuilder.withPayload("hello")
.setHeader("baz", "qux").build();
final Message<?> message = MessageBuilder.withPayload("hello").setHeader("baz", "qux").build();
final Message<?> enriched = headerEnricherFunction.apply(message);
assertThat(enriched, HeaderMatcher.hasHeader("foo", equalTo("bar")));