Skip to content

Commit

Permalink
Bugfix for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
r-monti committed Jan 19, 2024
1 parent 620b6d8 commit 7b48c94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/java/model/DAO/DAOPersonalInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ public boolean updatePersonalInfoAndUserFromId(int id, String FirstName, String
return true; // Entrambi gli aggiornamenti hanno avuto successo
}
} catch (SQLException e) {
logger.error("Error ", e);
if (e.getSQLState().equals("23000") && e.getErrorCode() == 1062) {
} else {
// Gestione di altre eccezioni
logger.error("Errore query", e);
}
} finally {
try {
DAOConnection.releaseConnection(connection);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/controller/ScheduleManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void testDuplicateSchedule() throws IOException

servlet.doPost(request,response);

verify(response).sendRedirect("JSP/schedule.jsp?errorMessage=Seleziona una data non esistente perfavore.");
verify(response).sendRedirect("JSP/schedule.jsp?errorMessage=Seleziona una data non esistente per favore.");
}

@Test
Expand Down Expand Up @@ -158,7 +158,7 @@ void testCreateScheduleIncorrectDate() throws IOException

servlet.doPost(request,response);

verify(response).sendRedirect("JSP/schedule.jsp?errorMessage=Seleziona una data non esistente perfavore.");
verify(response).sendRedirect("JSP/schedule.jsp?errorMessage=Seleziona una data non esistente per favore.");
}

@AfterAll
Expand Down

0 comments on commit 7b48c94

Please sign in to comment.