- simplified customers tests

- code clearings
This commit is contained in:
dartpopikyardo
2016-03-02 23:54:02 +03:00
parent 4bc8e8408d
commit 21d21b9833
18 changed files with 153 additions and 234 deletions

View File

@@ -12,5 +12,6 @@ dependencies {
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
testCompile project(":testutil-customers")
testCompile "org.springframework.boot:spring-boot-starter-test"
}

View File

@@ -1,9 +1,7 @@
package net.chrisrichardson.eventstore.javaexamples.banking.web;
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.Address;
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerInfo;
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.CustomerResponse;
import net.chrisrichardson.eventstore.javaexamples.banking.common.customers.Name;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -15,6 +13,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.client.RestTemplate;
import static net.chrisrichardson.eventstorestore.javaexamples.testutil.customers.CustomersTestUtils.generateCustomerInfo;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = CustomersCommandSideServiceTestConfiguration.class)
@WebAppConfiguration
@@ -43,18 +43,4 @@ public class CustomersCommandSideServiceIntegrationTest {
Assert.assertEquals(customerInfo, customerResponse.getCustomerInfo());
}
private CustomerInfo generateCustomerInfo() {
return new CustomerInfo(
new Name("John", "Doe"),
"current@email.com",
"000-00-0000",
"1-111-111-1111",
new Address("street 1",
"street 2",
"City",
"State",
"1111111")
);
}
}

View File

@@ -1,5 +1,6 @@
package net.chrisrichardson.eventstore.javaexamples.banking.web;
import net.chrisrichardson.eventstore.javaexamples.banking.commonauth.AuthConfiguration;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -12,7 +13,7 @@ import java.util.Arrays;
import java.util.List;
@Configuration
@Import(CustomersCommandSideServiceConfiguration.class)
@Import({CustomersCommandSideServiceConfiguration.class, AuthConfiguration.class})
public class CustomersCommandSideServiceTestConfiguration {
@Bean