should fix issue #23

This commit is contained in:
dartpopikyardo
2016-09-13 22:02:17 +03:00
parent 4f1bb4aa52
commit 91f6fde5cd
2 changed files with 18 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ dependencies {
testCompile project(":common-auth")
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "org.jsoup:jsoup:1.9.2"
}
test {

View File

@@ -4,10 +4,20 @@ package net.chrisrichardson.eventstore.examples.bank.web;
import net.chrisrichardson.eventstorestore.javaexamples.testutil.AbstractRestAPITest;
import net.chrisrichardson.eventstorestore.javaexamples.testutil.AuthenticatedRestTemplate;
import net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.Test;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class EndToEndTest extends AbstractRestAPITest {
private String indexUrl = "http://" + getenv("SERVICE_HOST", "localhost") + ":" + 8080 + "/index.html";
private String getenv(String name, String defaultValue) {
String x = System.getenv(name);
return x == null ? defaultValue : x;
@@ -21,6 +31,13 @@ public class EndToEndTest extends AbstractRestAPITest {
return "http://" + getenv("SERVICE_HOST", "localhost") + ":" + 8080 + "/api" + path;
}
@Test
public void shouldLoadStaticPage() throws IOException {
Document doc = Jsoup.connect(indexUrl).get();
assertNotNull(doc.title());
assertEquals("Money Transfer App", doc.title());
}
@Override
public CustomersTestUtils getCustomersTestUtils() {
return customersTestUtils;