BAEL-982 Spring-boot mustache initial commit

This commit is contained in:
dhruba619
2017-07-16 12:36:17 +05:30
parent b4d3e23c3e
commit dc0d802cd9
12 changed files with 280 additions and 0 deletions
@@ -0,0 +1,32 @@
package com.baeldung.springmustache;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class SpringMustacheApplicationTests {
@Autowired
private TestRestTemplate restTemplate;
@Test
public void givenIndexPageWhenContainsArticleThenTrue() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/article", String.class);
Assert.assertTrue(entity.getStatusCode()
.equals(HttpStatus.OK));
Assert.assertTrue(entity.getBody()
.contains("Article Title 0"));
}
}