mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
Unify adding staff
Co-authored-by: Denis Natusch <denis.natusch@mailbox.tu-dresden.de> Co-authored-by: Simon Bruder <simon.bruder@mailbox.tu-dresden.de>
This commit is contained in:
parent
403cc56ae0
commit
b4dfa72852
|
@ -17,16 +17,12 @@ public class StaffManagement {
|
|||
this.staffRepository = staffRepository;
|
||||
}
|
||||
|
||||
public Staff addStaff(Staff staff) {
|
||||
return staffRepository.save(staff);
|
||||
}
|
||||
|
||||
public Optional<Staff> findById(Long staffID) {
|
||||
return staffRepository.findById(staffID);
|
||||
}
|
||||
|
||||
public void save(Staff staff) {
|
||||
staffRepository.save(staff);
|
||||
public Staff save(Staff staff) {
|
||||
return staffRepository.save(staff);
|
||||
}
|
||||
|
||||
public Streamable<Staff> findAll() {
|
||||
|
|
|
@ -39,7 +39,7 @@ class StaffControllerIntegrationTests {
|
|||
|
||||
@BeforeEach
|
||||
void setup() throws Exception {
|
||||
defaultEmployee = staffManagement.addStaff(new Staff("Dieter Baum", JobType.COOK));
|
||||
defaultEmployee = staffManagement.save(new Staff("Dieter Baum", JobType.COOK));
|
||||
defaultEmployeeId = defaultEmployee.getId();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue