Upgrade to spring-javaformat 0.0.11

This commit is contained in:
Andy Wilkinson
2019-06-07 09:44:58 +01:00
parent d548c5ed31
commit 8f1be4cded
1940 changed files with 16814 additions and 28498 deletions

View File

@@ -38,8 +38,7 @@ import org.springframework.integration.file.FileWritingMessageHandler;
public class SampleParentContextApplication {
public static void main(String[] args) throws Exception {
new SpringApplicationBuilder(Parent.class)
.child(SampleParentContextApplication.class).run(args);
new SpringApplicationBuilder(Parent.class).child(SampleParentContextApplication.class).run(args);
}
@Configuration
@@ -65,21 +64,18 @@ public class SampleParentContextApplication {
@Bean
public FileWritingMessageHandler fileWriter() {
FileWritingMessageHandler writer = new FileWritingMessageHandler(
new File("target/output"));
FileWritingMessageHandler writer = new FileWritingMessageHandler(new File("target/output"));
writer.setExpectReply(false);
return writer;
}
@Bean
public IntegrationFlow integrationFlow(SampleEndpoint endpoint) {
return IntegrationFlows.from(fileReader(), new FixedRatePoller())
.channel(inputChannel()).handle(endpoint).channel(outputChannel())
.handle(fileWriter()).get();
return IntegrationFlows.from(fileReader(), new FixedRatePoller()).channel(inputChannel()).handle(endpoint)
.channel(outputChannel()).handle(fileWriter()).get();
}
private static class FixedRatePoller
implements Consumer<SourcePollingChannelAdapterSpec> {
private static class FixedRatePoller implements Consumer<SourcePollingChannelAdapterSpec> {
@Override
public void accept(SourcePollingChannelAdapterSpec spec) {

View File

@@ -81,21 +81,18 @@ public class SampleIntegrationParentApplicationTests {
}
}
}
fail("Timed out awaiting output containing '" + requiredContents
+ "'. Output was '" + output + "'");
fail("Timed out awaiting output containing '" + requiredContents + "'. Output was '" + output + "'");
}
private Resource[] findResources() throws IOException {
return ResourcePatternUtils
.getResourcePatternResolver(new DefaultResourceLoader())
return ResourcePatternUtils.getResourcePatternResolver(new DefaultResourceLoader())
.getResources("file:target/output/**/*.msg");
}
private String readResources(Resource[] resources) throws IOException {
StringBuilder builder = new StringBuilder();
for (Resource resource : resources) {
builder.append(
new String(StreamUtils.copyToByteArray(resource.getInputStream())));
builder.append(new String(StreamUtils.copyToByteArray(resource.getInputStream())));
}
return builder.toString();
}

View File

@@ -30,8 +30,7 @@ public class ProducerApplication implements CommandLineRunner {
public void run(String... args) throws Exception {
new File("target/input").mkdirs();
if (args.length > 0) {
FileOutputStream stream = new FileOutputStream(
"target/input/data" + System.currentTimeMillis() + ".txt");
FileOutputStream stream = new FileOutputStream("target/input/data" + System.currentTimeMillis() + ".txt");
for (String arg : args) {
stream.write(arg.getBytes());
}