- refactored the tests

- moved some dto classes into common module
This commit is contained in:
Main
2016-08-09 22:58:00 +03:00
parent 39309f23a1
commit b0855ebd81
9 changed files with 66 additions and 45 deletions

View File

@@ -3,8 +3,11 @@ 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.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
public class EndToEndTest extends AbstractRestAPITest {
private String getenv(String name, String defaultValue) {
@@ -12,10 +15,22 @@ public class EndToEndTest extends AbstractRestAPITest {
return x == null ? defaultValue : x;
}
CustomersTestUtils customersTestUtils;
@PostConstruct
private void init() {
customersTestUtils = new CustomersTestUtils(restTemplate, baseUrl("/customers/"));
}
public String baseUrl(String path) {
return "http://" + getenv("SERVICE_HOST", "localhost") + ":" + 8080 + "/" + path;
}
@Override
public CustomersTestUtils getCustomersTestUtils() {
return customersTestUtils;
}
RestTemplate restTemplate = new RestTemplate();
@Override