Created
September 29, 2015 12:57
-
-
Save stephan-mueller/c4bdaeed055625e79a2b to your computer and use it in GitHub Desktop.
Test class for the builder {@link CustomerBuilder} with AssertJ assertions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomerBuilderAssertjTest { | |
private Customer customer; | |
@Before | |
public void setUp() throws Exception { | |
customer = Customer.newBuilder() | |
.setFirstName("Max") | |
.setLastName("Mustermann") | |
.setEmail("max.mustermann@openknowledge.de") | |
.build(); | |
} | |
@Test | |
public void build() throws Exception { | |
assertThat(customer).as("check customer for null").isNotNull(); | |
assertThat(customer.getFirstName()).isEqualTo("Max"); | |
assertThat(customer.getLastName()).isEqualTo("Mustermann"); | |
assertThat(customer.getEmail()).isEqualTo("max.mustermann@openknowledge.de"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment