|
|
|
@ -59,9 +59,9 @@ public class LoanTest { |
|
|
|
|
|
|
|
|
|
String update_state = "returned"; |
|
|
|
|
|
|
|
|
|
loanRepository.updateLoan(1L,update_state); |
|
|
|
|
|
|
|
|
|
Optional<Loan> opt_loan = loanRepository.findById(1L); |
|
|
|
|
loanRepository.updateLoan(0L,update_state); |
|
|
|
|
|
|
|
|
|
Optional<Loan> opt_loan = loanRepository.findById(0L); |
|
|
|
|
|
|
|
|
|
Loan loan2 = opt_loan.get(); |
|
|
|
|
assertTrue(update_state.equals(loan2.getState())); |
|
|
|
@ -72,9 +72,9 @@ public class LoanTest { |
|
|
|
|
@Order(3) |
|
|
|
|
void testDeleteLoan() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long date_start = 1234; |
|
|
|
|
long date_end = 2345; |
|
|
|
|
int start_size = loanRepository.getSize(); |
|
|
|
|
long date_start = 1876; |
|
|
|
|
long date_end = 9876; |
|
|
|
|
String state = "loaning"; |
|
|
|
|
|
|
|
|
|
Item item = null; |
|
|
|
@ -85,12 +85,12 @@ public class LoanTest { |
|
|
|
|
|
|
|
|
|
loanRepository.addLoan(loan); |
|
|
|
|
|
|
|
|
|
Optional<Loan> opt_loan2 = loanRepository.findById(1L); |
|
|
|
|
Optional<Loan> opt_loan2 = loanRepository.findById(0L); |
|
|
|
|
|
|
|
|
|
Loan book2 = opt_loan2.get(); |
|
|
|
|
long ID = book2.getId(); |
|
|
|
|
|
|
|
|
|
int start_size = loanRepository.getSize(); |
|
|
|
|
|
|
|
|
|
loanRepository.deleteLoanById(ID); |
|
|
|
|
|
|
|
|
|
int size = loanRepository.getSize(); |
|
|
|
|