Open Bisllly opened 1 year ago
Auto-generated getters, setters, constructors and more... https://projectlombok.org/features/
use @Getter, @Setter, and @Constructor to implicitly generate getters, setter and constructor:
package student.student_add_test.entity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; @Getter @Setter @AllArgsConstructor public class Student { String firstName; String lastName; String email; }
result: able to use getter, setter and constructor without having them in entity:
entity
@Before public void setUp() { student = new Student("Chilll", "Braauoo", "bingchilling@gmail.com"); //constructor } @Test public void testAddStudent() { Enter.theValue(student.getFirstName()).into(StudentUI.INPUT_ID_FIRST_NAME); //getter createStudentPage.fillLastName(StudentUI.INPUT_ID_LAST_NAME, student.getLastName()); createStudentPage.fillEmail(StudentUI.INPUT_ID_EMAIL, student.getEmail()); }
https://www.baeldung.com/lombok-builder
https://plugins.jetbrains.com/plugin/6585-builder-generator
1. Lombok
Auto-generated getters, setters, constructors and more... https://projectlombok.org/features/
Example:
use @Getter, @Setter, and @Constructor to implicitly generate getters, setter and constructor:
result: able to use getter, setter and constructor without having them in
entity
: