From 59cb7db53e660ac324411476fd18213098d5db88 Mon Sep 17 00:00:00 2001 From: slavisa-baeldung Date: Mon, 17 Jul 2017 19:12:24 +0100 Subject: [PATCH] BAEL-982 - reformatting --- spring-mustache/pom.xml | 97 ++++++++++--------- .../SpringMustacheApplication.java | 8 +- .../controller/ArticleController.java | 12 +-- .../SpringMustacheApplicationTests.java | 6 +- 4 files changed, 60 insertions(+), 63 deletions(-) diff --git a/spring-mustache/pom.xml b/spring-mustache/pom.xml index e671672b72..45fee6b10e 100644 --- a/spring-mustache/pom.xml +++ b/spring-mustache/pom.xml @@ -1,60 +1,61 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung - spring-mustache - 0.0.1-SNAPSHOT - jar + com.baeldung + spring-mustache + 0.0.1-SNAPSHOT + jar - spring-mustache - Demo project for Spring Boot + spring-mustache + Demo project for Spring Boot - - org.springframework.boot - spring-boot-starter-parent - 1.5.4.RELEASE - - + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + + + - - UTF-8 - UTF-8 - 1.8 - + + UTF-8 + UTF-8 + 1.8 + - - - org.springframework.boot - spring-boot-starter-mustache - + + + org.springframework.boot + spring-boot-starter-mustache + - - org.springframework.boot - spring-boot-starter-test - test - - - org.webjars - bootstrap - 3.3.7 - - - org.fluttercode.datafactory - datafactory - 0.8 - - + + org.springframework.boot + spring-boot-starter-test + test + + + org.webjars + bootstrap + 3.3.7 + + + org.fluttercode.datafactory + datafactory + 0.8 + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/spring-mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java b/spring-mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java index d4338ffd7d..addd1fa088 100644 --- a/spring-mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java +++ b/spring-mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java @@ -10,7 +10,7 @@ import org.springframework.core.env.Environment; import com.samskivert.mustache.Mustache; @SpringBootApplication -@ComponentScan(basePackages = { "com.baeldung" }) +@ComponentScan(basePackages = {"com.baeldung"}) public class SpringMustacheApplication { public static void main(String[] args) { @@ -24,9 +24,9 @@ public class SpringMustacheApplication { collector.setEnvironment(environment); Mustache.Compiler compiler = Mustache.compiler() - .defaultValue("Some Default Value") - .withLoader(templateLoader) - .withCollector(collector); + .defaultValue("Some Default Value") + .withLoader(templateLoader) + .withCollector(collector); return compiler; } diff --git a/spring-mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java b/spring-mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java index e0db127d66..b24625e7d5 100644 --- a/spring-mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java +++ b/spring-mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java @@ -23,9 +23,9 @@ public class ArticleController { List
articles = new LinkedList<>(); IntStream.range(0, 10) - .forEach(count -> { - articles.add(generateArticle("Article Title "+count)); - }); + .forEach(count -> { + articles.add(generateArticle("Article Title " + count)); + }); Map modelMap = new HashMap<>(); modelMap.put("articles", articles); @@ -38,12 +38,10 @@ public class ArticleController { DataFactory factory = new DataFactory(); article.setTitle(title); article.setBody( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur faucibus tempor diam. In molestie arcu eget ante facilisis sodales. Maecenas porta tellus sapien, eget rutrum nisi blandit in. Mauris tempor auctor ante, ut blandit velit venenatis id. Ut varius, augue aliquet feugiat congue, arcu ipsum finibus purus, dapibus semper velit sapien venenatis magna. Nunc quam ex, aliquet at rutrum sed, vestibulum quis libero. In laoreet libero cursus maximus vulputate. Nullam in fermentum sem. Duis aliquam ullamcorper dui, et dictum justo placerat id. Aliquam pretium orci quis sapien convallis, non blandit est tempus."); - article.setPublishDate(factory.getBirthDate() - .toString()); + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur faucibus tempor diam. In molestie arcu eget ante facilisis sodales. Maecenas porta tellus sapien, eget rutrum nisi blandit in. Mauris tempor auctor ante, ut blandit velit venenatis id. Ut varius, augue aliquet feugiat congue, arcu ipsum finibus purus, dapibus semper velit sapien venenatis magna. Nunc quam ex, aliquet at rutrum sed, vestibulum quis libero. In laoreet libero cursus maximus vulputate. Nullam in fermentum sem. Duis aliquam ullamcorper dui, et dictum justo placerat id. Aliquam pretium orci quis sapien convallis, non blandit est tempus."); + article.setPublishDate(factory.getBirthDate().toString()); article.setAuthor(factory.getName()); return article; - } } diff --git a/spring-mustache/src/test/java/com/baeldung/springmustache/SpringMustacheApplicationTests.java b/spring-mustache/src/test/java/com/baeldung/springmustache/SpringMustacheApplicationTests.java index 4a72d4156e..9138dfe92b 100644 --- a/spring-mustache/src/test/java/com/baeldung/springmustache/SpringMustacheApplicationTests.java +++ b/spring-mustache/src/test/java/com/baeldung/springmustache/SpringMustacheApplicationTests.java @@ -22,11 +22,9 @@ public class SpringMustacheApplicationTests { public void givenIndexPageWhenContainsArticleThenTrue() { ResponseEntity entity = this.restTemplate.getForEntity("/article", String.class); - Assert.assertTrue(entity.getStatusCode() - .equals(HttpStatus.OK)); - Assert.assertTrue(entity.getBody() - .contains("Article Title 0")); + Assert.assertTrue(entity.getStatusCode().equals(HttpStatus.OK)); + Assert.assertTrue(entity.getBody().contains("Article Title 0")); } }