mirror of
https://gitee.com/dcren/initializr.git
synced 2026-02-26 13:43:15 +08:00
Polish
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package io.spring.initializr.generator.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -74,17 +75,18 @@ class IndentingWriterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void customIndentStrategyIsUsed() {
|
||||
IndentingWriter customIndentingWriter = new IndentingWriter(this.stringWriter,
|
||||
new SimpleIndentStrategy("\t"));
|
||||
customIndentingWriter.println("a");
|
||||
customIndentingWriter.indented(() -> {
|
||||
customIndentingWriter.println("b");
|
||||
void customIndentStrategyIsUsed() throws IOException {
|
||||
try (IndentingWriter customIndentingWriter = new IndentingWriter(
|
||||
this.stringWriter, new SimpleIndentStrategy("\t"))) {
|
||||
customIndentingWriter.println("a");
|
||||
customIndentingWriter.indented(() -> {
|
||||
customIndentingWriter.print("c");
|
||||
customIndentingWriter.println("e");
|
||||
customIndentingWriter.println("b");
|
||||
customIndentingWriter.indented(() -> {
|
||||
customIndentingWriter.print("c");
|
||||
customIndentingWriter.println("e");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
assertThat(this.stringWriter.toString()).isEqualTo("a\n\tb\n\t\tce\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import io.spring.initializr.generator.project.ProjectGenerationException;
|
||||
/**
|
||||
* Base tester for project generation.
|
||||
*
|
||||
* @param <SELF> concrete type of the tester
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public abstract class AbstractProjectGenerationTester<SELF extends AbstractProjectGenerationTester<SELF>> {
|
||||
|
||||
Reference in New Issue
Block a user