From 2b0c405378007c5d063982992d06b628b91ad549 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 1 Sep 2016 08:08:30 +0300 Subject: [PATCH] fixed tests --- .../CustomersQuerySideServiceIntegrationTest.java | 12 ++---------- .../javaexamples/testutil/AbstractRestAPITest.java | 12 ------------ .../javaexamples/testutil/CustomersTestUtils.java | 1 - 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java b/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java index fb4cd23..badb967 100644 --- a/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java +++ b/java-spring/customers-query-side-service/src/test/java/net/chrisrichardson/eventstore/javaexamples/banking/web/CustomersQuerySideServiceIntegrationTest.java @@ -1,9 +1,8 @@ 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 org.apache.tomcat.jni.Thread; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; 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.web.WebAppConfiguration; import org.springframework.web.client.RestTemplate; -import rx.Observable; import javax.annotation.PostConstruct; @@ -51,12 +49,6 @@ public class CustomersQuerySideServiceIntegrationTest { final CustomerResponse customerResponse = restTemplate.postForEntity(baseUrl("/customers"), customerInfo, CustomerResponse.class).getBody(); final String customerId = customerResponse.getId(); - try { - java.lang.Thread.sleep(10000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - customersTestUtils.assertCustomerResponse(customerId, customerInfo); } diff --git a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java index 6055ed1..a780590 100644 --- a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java +++ b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/AbstractRestAPITest.java @@ -51,12 +51,6 @@ public abstract class AbstractRestAPITest { Assert.assertNotNull(fromAccountId); Assert.assertNotNull(toAccountId); - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - assertAccountBalance(fromAccountId, initialFromAccountBalance); assertAccountBalance(toAccountId, initialToAccountBalance); @@ -104,12 +98,6 @@ public abstract class AbstractRestAPITest { Assert.assertNotNull(customerId); assertEquals(customerInfo, customerResponse.getCustomerInfo()); - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - getCustomersTestUtils().assertCustomerResponse(customerId, customerInfo); final CreateAccountResponse account = getAuthenticatedRestTemplate().postForEntity(baseUrl("/accounts"), diff --git a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java index 4fc4fe1..a9e6e6e 100644 --- a/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java +++ b/java-spring/testutil/src/main/java/net/chrisrichardson/eventstorestore/javaexamples/testutil/CustomersTestUtils.java @@ -6,7 +6,6 @@ import org.springframework.web.client.RestTemplate; import java.util.concurrent.CompletableFuture; -import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.awaitSuccessfulRequest; import static net.chrisrichardson.eventstorestore.javaexamples.testutil.TestUtil.eventually; /**