GH-7: Add checkstyle and javaformat plugins
Fixes: #7 * Run `./gradlew format` * Updates from PR review suggestions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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")));
|
||||
|
||||
Reference in New Issue
Block a user