Add a new section in Lombok builder article - Minor Fixes
This commit is contained in:
parent
56cbfb1c6f
commit
cb8bae53a2
|
@ -8,7 +8,8 @@ import lombok.NonNull;
|
|||
@Getter
|
||||
public class RequiredFieldAnnotation {
|
||||
|
||||
@NonNull String name;
|
||||
@NonNull
|
||||
String name;
|
||||
String description;
|
||||
|
||||
public static RequiredFieldAnnotationBuilder builder(String name) {
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package com.baeldung.lombok.builder;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class RequiredFieldAnnotationTest {
|
||||
public class RequiredFieldAnnotationUnitTest {
|
||||
RequiredFieldAnnotation requiredFieldTest;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
@Before
|
||||
public void setUp() {
|
||||
requiredFieldTest = RequiredFieldAnnotation.builder("NameField").description("Field Description").build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenBuilderWithRequiredParameter_thenParameterIsPresent() {
|
||||
assertEquals(requiredFieldTest.getName(), "NameField");
|
||||
assertEquals("NameField", requiredFieldTest.getName());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue