|
|
|
@ -26,14 +26,14 @@ public class StaffTest { |
|
|
|
|
@Order(1) |
|
|
|
|
void testAddStaff() { |
|
|
|
|
|
|
|
|
|
String firstname = "Ivan"; |
|
|
|
|
String lastname = "Donati"; |
|
|
|
|
String city = "Milano"; |
|
|
|
|
String idka = "lihwelhqluchwlir8"; |
|
|
|
|
String ruolo = "frontoffice"; |
|
|
|
|
|
|
|
|
|
String lname = "Library bria 2"; |
|
|
|
|
String ladress = "via chissa dove"; |
|
|
|
|
String firstname = "test_add_staff_name"; |
|
|
|
|
String lastname = "test_add_staff_lastname"; |
|
|
|
|
String city = "test_add_staff_city"; |
|
|
|
|
String idka = "test_add_staff_idka"; |
|
|
|
|
String ruolo = "test_add_staff_role"; |
|
|
|
|
|
|
|
|
|
String lname = "test_add_staff_loc_name"; |
|
|
|
|
String ladress = "test_add_staff_loc_adress"; |
|
|
|
|
Location location = new Location(lname, ladress); |
|
|
|
|
locationRepository.addLocation(location); |
|
|
|
|
|
|
|
|
@ -55,13 +55,13 @@ public class StaffTest { |
|
|
|
|
void testUpdateStaff() { |
|
|
|
|
|
|
|
|
|
// creo una locazione
|
|
|
|
|
String lname = "Library cosa 2"; |
|
|
|
|
String ladress = "via chissa dove"; |
|
|
|
|
String lname = "test_update_staff_loc_name"; |
|
|
|
|
String ladress = "test_update_staff_loc_adress"; |
|
|
|
|
Location location = new Location(lname, ladress); |
|
|
|
|
|
|
|
|
|
// creo una seconda locazione
|
|
|
|
|
String newlName = "Library destra 5"; |
|
|
|
|
String newlAdress = "via prossima stella"; |
|
|
|
|
String newlName = "test_update_staff_loc_newname"; |
|
|
|
|
String newlAdress = "test_update_staff_loc_newname"; |
|
|
|
|
Location newlocation = new Location(newlName, newlAdress); |
|
|
|
|
|
|
|
|
|
int losize = locationRepository.getSize(); |
|
|
|
@ -74,11 +74,12 @@ public class StaffTest { |
|
|
|
|
assertEquals(newlosize, losize + 2); // ci sono 2 locazioni aggunte
|
|
|
|
|
|
|
|
|
|
// creo un membro dello staff
|
|
|
|
|
String firstname = "Maccio"; |
|
|
|
|
String lastname = "Donati"; |
|
|
|
|
String city = "Milano"; |
|
|
|
|
String idka = "lihwelhqluchwlir8"; |
|
|
|
|
String ruolo = "frontoffice"; |
|
|
|
|
String firstname = "test_update_staff_name"; |
|
|
|
|
String lastname = "test_update_staff_lastname"; |
|
|
|
|
String city = "test_update_staff_city"; |
|
|
|
|
String idka = "test_update_staff_idka"; |
|
|
|
|
String ruolo = "test_update_staff_role"; |
|
|
|
|
|
|
|
|
|
Staff newstaff = new Staff(firstname, lastname, city, idka, ruolo); |
|
|
|
|
|
|
|
|
|
int size = staffRepository.getSize(); |
|
|
|
@ -92,11 +93,11 @@ public class StaffTest { |
|
|
|
|
Staff editStaff = staffRepository.searchStaffByidka(idka); |
|
|
|
|
|
|
|
|
|
long id = editStaff.getId(); |
|
|
|
|
String newfirstname = "Ivans"; |
|
|
|
|
String newlastname = "Donatis"; |
|
|
|
|
String newcity = "Milanos"; |
|
|
|
|
String newidka = "lihwelhkluchwlir5"; |
|
|
|
|
String newruolo = "spazzino"; |
|
|
|
|
String newfirstname = "test_update_staff_newname"; |
|
|
|
|
String newlastname = "test_update_staff_newlastname"; |
|
|
|
|
String newcity = "test_update_staff_newcity"; |
|
|
|
|
String newidka = "test_update_staff_newidka"; |
|
|
|
|
String newruolo = "test_update_staff_newrole"; |
|
|
|
|
|
|
|
|
|
staffRepository.updateStaff(id, newfirstname, newlastname, newcity, newidka, newruolo, newlocation); |
|
|
|
|
|
|
|
|
@ -117,14 +118,14 @@ public class StaffTest { |
|
|
|
|
@Order(3) |
|
|
|
|
void testDeleteStaff() { |
|
|
|
|
|
|
|
|
|
String firstname = "John"; |
|
|
|
|
String lastname = "Donati"; |
|
|
|
|
String city = "Milano"; |
|
|
|
|
String idka = "lihwelhsfghhwlir8"; |
|
|
|
|
String ruolo = "manager"; |
|
|
|
|
String firstname = "test_delete_staff_name"; |
|
|
|
|
String lastname = "test_delete_staff_lastname"; |
|
|
|
|
String city = "test_delete_staff_city"; |
|
|
|
|
String idka = "test_delete_staff_idka"; |
|
|
|
|
String ruolo = "test_delete_staff_role"; |
|
|
|
|
|
|
|
|
|
String lname = "Library siniz 2"; |
|
|
|
|
String ladress = "via sassa dove"; |
|
|
|
|
String lname = "test_delete_staff_loc_name"; |
|
|
|
|
String ladress = "test_delete_staff_loc_adress"; |
|
|
|
|
Location location = new Location(lname, ladress); |
|
|
|
|
locationRepository.addLocation(location); |
|
|
|
|
|
|
|
|
|