fixed tests
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
package net.chrisrichardson.eventstore.javaexamples.banking.web;
|
package net.chrisrichardson.eventstore.javaexamples.banking.web;
|
||||||
|
|
||||||
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.*;
|
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo;
|
||||||
|
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerResponse;
|
||||||
import net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils;
|
import net.chrisrichardson.eventstorestore.javaexamples.testutil.CustomersTestUtils;
|
||||||
import org.apache.tomcat.jni.Thread;
|
|
||||||
import org.junit.Assert;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -13,7 +12,6 @@ import org.springframework.boot.test.SpringApplicationConfiguration;
|
|||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
import org.springframework.test.context.web.WebAppConfiguration;
|
import org.springframework.test.context.web.WebAppConfiguration;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
import rx.Observable;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
@@ -51,12 +49,6 @@ public class CustomersQuerySideServiceIntegrationTest {
|
|||||||
final CustomerResponse customerResponse = restTemplate.postForEntity(baseUrl("/customers"), customerInfo, CustomerResponse.class).getBody();
|
final CustomerResponse customerResponse = restTemplate.postForEntity(baseUrl("/customers"), customerInfo, CustomerResponse.class).getBody();
|
||||||
final String customerId = customerResponse.getId();
|
final String customerId = customerResponse.getId();
|
||||||
|
|
||||||
try {
|
|
||||||
java.lang.Thread.sleep(10000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
customersTestUtils.assertCustomerResponse(customerId, customerInfo);
|
customersTestUtils.assertCustomerResponse(customerId, customerInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,12 +51,6 @@ public abstract class AbstractRestAPITest {
|
|||||||
Assert.assertNotNull(fromAccountId);
|
Assert.assertNotNull(fromAccountId);
|
||||||
Assert.assertNotNull(toAccountId);
|
Assert.assertNotNull(toAccountId);
|
||||||
|
|
||||||
try {
|
|
||||||
Thread.sleep(10000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
assertAccountBalance(fromAccountId, initialFromAccountBalance);
|
assertAccountBalance(fromAccountId, initialFromAccountBalance);
|
||||||
assertAccountBalance(toAccountId, initialToAccountBalance);
|
assertAccountBalance(toAccountId, initialToAccountBalance);
|
||||||
|
|
||||||
@@ -104,12 +98,6 @@ public abstract class AbstractRestAPITest {
|
|||||||
Assert.assertNotNull(customerId);
|
Assert.assertNotNull(customerId);
|
||||||
assertEquals(customerInfo, customerResponse.getCustomerInfo());
|
assertEquals(customerInfo, customerResponse.getCustomerInfo());
|
||||||
|
|
||||||
try {
|
|
||||||
Thread.sleep(10000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
getCustomersTestUtils().assertCustomerResponse(customerId, customerInfo);
|
getCustomersTestUtils().assertCustomerResponse(customerId, customerInfo);
|
||||||
|
|
||||||
final CreateAccountResponse account = getAuthenticatedRestTemplate().postForEntity(baseUrl("/accounts"),
|
final CreateAccountResponse account = getAuthenticatedRestTemplate().postForEntity(baseUrl("/accounts"),
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import org.springframework.web.client.RestTemplate;
|
|||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.awaitSuccessfulRequest;
|
|
||||||
import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.eventually;
|
import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.eventually;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user