Add remaining examples
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
package com.baeldung.immutable.default_;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ImmutablePersonDefaultTest {
|
||||
|
||||
@Test
|
||||
public void whenInstantiating_shouldUseDefaultValue() throws Exception {
|
||||
|
||||
final com.baeldung.immutable.default_.ImmutablePerson john = com.baeldung.immutable.default_.ImmutablePerson.builder().name("John").build();
|
||||
|
||||
assertThat(john.getAge()).isEqualTo(42);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user