[BAEL-5976]: Extract Values using AssertJ in Java (#13105)
JIRA: https://jira.baeldung.com/browse/BAEL-5976
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
package com.baeldung.assertj.extracting;
|
||||
|
||||
class Address {
|
||||
private String street;
|
||||
private String city;
|
||||
private ZipCode zipCode;
|
||||
|
||||
Address(String street, String city, ZipCode zipCode) {
|
||||
this.street = street;
|
||||
this.city = city;
|
||||
this.zipCode = zipCode;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public ZipCode getZipCode() {
|
||||
return zipCode;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.baeldung.assertj.extracting;
|
||||
|
||||
class Person {
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
private Address address;
|
||||
|
||||
Person(String firstName, String lastName, Address address) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public Address getAddress() {
|
||||
return address;
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.assertj.extracting;
|
||||
|
||||
class ZipCode {
|
||||
private long zipcode;
|
||||
|
||||
ZipCode(long zipcode) {
|
||||
this.zipcode = zipcode;
|
||||
}
|
||||
|
||||
public long getZipcode() {
|
||||
return zipcode;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user