Skip to content

Instantly share code, notes, and snippets.

@stephan-mueller
Created September 29, 2015 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephan-mueller/c4bdaeed055625e79a2b to your computer and use it in GitHub Desktop.
Save stephan-mueller/c4bdaeed055625e79a2b to your computer and use it in GitHub Desktop.
Test class for the builder {@link CustomerBuilder} with AssertJ assertions
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