Skip to content

Commit 0de2a25

Browse files
committed
Updated user address structure to reflect latest API changes
1 parent f08c85f commit 0de2a25

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.serenitydojo.playwright.toolshop.domain;
2+
3+
public record Address(String street, String city, String state, String country, String postal_code) {
4+
}

src/test/java/com/serenitydojo/playwright/toolshop/domain/User.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
public record User(
99
String first_name,
1010
String last_name,
11-
String address,
12-
String city,
13-
String state,
14-
String country,
15-
String postcode,
11+
Address address,
1612
String phone,
1713
String dob,
1814
String password,
@@ -29,11 +25,13 @@ public static User randomUser() {
2925
return new User(
3026
fake.name().firstName(),
3127
fake.name().lastName(),
32-
fake.address().streetAddress(),
33-
fake.address().city(),
34-
fake.address().state(),
35-
fake.address().country(),
36-
fake.address().postcode(),
28+
new Address(
29+
fake.address().streetName(),
30+
fake.address().city(),
31+
fake.address().state(),
32+
fake.address().country(),
33+
fake.address().postcode()
34+
),
3735
fake.phoneNumber().phoneNumber(),
3836
formattedDate,
3937
"Az123!&xyz",
@@ -46,18 +44,14 @@ public User withPassword(String password) {
4644
first_name,
4745
last_name,
4846
address,
49-
city,
50-
state,
51-
country,
52-
postcode,
5347
phone,
5448
dob,
5549
password,
5650
email);
5751
}
5852

5953
public User withFirstName(String first_name) {
60-
return new User(first_name,last_name,address,city,state,country,postcode,phone,dob,password,email);
54+
return new User(first_name,last_name,address,phone,dob,password,email);
6155
}
6256

6357
}

0 commit comments

Comments
 (0)