Skip to content

Commit

Permalink
Fixed test cases affected by the updated ER Diagram.
Browse files Browse the repository at this point in the history
  • Loading branch information
nhkhai committed Mar 21, 2024
1 parent 950df59 commit 1e38657
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void createCustomerTest() throws Exception {

// Step 1: Create a Customer object
Customer newCustomer = Customer.builder().firstName("Jackie").lastName("Chan").country("Hong Kong")
.address("123 HK St").postalCode(654321).mobileNumber(87654321)
.address("123 HK St").postalCode(654321).phoneNumber(87654321)
.email("[email protected]").build();

// Step 2: Convert the Java object to JSON using ObjectMapper.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class IntegrationTest {
public void createCustomerTest() {
// 1. Setup.
Customer testObject1 = Customer.builder().firstName("Jackie").lastName("Chan").country("Hong Kong")
.address("123 HK St").postalCode(654321).mobileNumber(87654321)
.address("123 HK St").postalCode(654321).phoneNumber(87654321)
.email("[email protected]").build();

// mock the save method of the customer repository
Expand All @@ -69,10 +69,10 @@ public void createCustomerTest() {
public void runIntegratedTest() throws Exception {
// Step 1: Create the test objects.
Customer testObject1 = Customer.builder().firstName("Jackie").lastName("Chan").country("Hong Kong")
.address("123 HK St").postalCode(654321).mobileNumber(87654321)
.address("123 HK St").postalCode(654321).phoneNumber(87654321)
.email("[email protected]").build();
Customer testObject2 = Customer.builder().firstName("Jackie").lastName("Chang").country("Hong Kong")
.address("123 HK St").postalCode(654321).mobileNumber(87654321)
.address("123 HK St").postalCode(654321).phoneNumber(87654321)
.email("[email protected]").build();

// Step 2: Convert the Java objects to JSON using ObjectMapper.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void createCustomerTest() {
// 1. SETUP
// Create a new customer.
Customer customer = Customer.builder().firstName("John").lastName("Wick").country("USA").address("123 Main St")
.postalCode(123456).mobileNumber(12345678).email("[email protected]").build();
.postalCode(123456).phoneNumber(12345678).email("[email protected]").build();

// Mock the save method of the customer repository.
when((customerRepository.save(customer))).thenReturn(customer);
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/sg/com/smartinventory/useCases/UseCaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class UseCaseTest {
public void createCustomerTest() {
// 1. Setup.
Customer testObject1 = Customer.builder().firstName("Jackie").lastName("Chan").country("Hong Kong")
.address("123 HK St").postalCode(654321).mobileNumber(87654321)
.address("123 HK St").postalCode(654321).phoneNumber(87654321)
.email("[email protected]").build();

// mock the save method of the customer repository
Expand All @@ -69,10 +69,10 @@ public void createCustomerTest() {
public void runIntegratedTest() throws Exception {
// Step 1: Create the test objects.
Customer testObject1 = Customer.builder().firstName("Jackie").lastName("Chan").country("Hong Kong")
.address("123 HK St").postalCode(654321).mobileNumber(87654321)
.address("123 HK St").postalCode(654321).phoneNumber(87654321)
.email("[email protected]").build();
Customer testObject2 = Customer.builder().firstName("Jackie").lastName("Chang").country("Hong Kong")
.address("123 HK St").postalCode(654321).mobileNumber(87654321)
.address("123 HK St").postalCode(654321).phoneNumber(87654321)
.email("[email protected]").build();

// Step 2: Convert the Java objects to JSON using ObjectMapper.
Expand Down

0 comments on commit 1e38657

Please sign in to comment.