Class RegisterControllerTest

java.lang.Object
com.modulink.service.Register.RegisterControllerTest

@SpringBootTest @AutoConfigureMockMvc @TestMethodOrder(org.junit.jupiter.api.MethodOrderer.OrderAnnotation.class) public class RegisterControllerTest extends Object
Test di integrazione per il processo di registrazione (RegisterController). Simula le richieste del browser per verificare la validazione dei dati.
  • Field Details

    • mockMvc

      @Autowired private org.springframework.test.web.servlet.MockMvc mockMvc
  • Constructor Details

    • RegisterControllerTest

      public RegisterControllerTest()
  • Method Details

    • testTC1_GDU1_NomeVuoto

      @Test @Order(1) public void testTC1_GDU1_NomeVuoto() throws Exception
      Test Case TC1_GDU1: Verifica che la registrazione fallisca se il nome è vuoto. Input: Nome="" (Vuoto) Output atteso: Errore di validazione sul campo nome.
      Throws:
      Exception
    • testTC2_GDU1_NomeTroppoCorto

      @Test @Order(2) public void testTC2_GDU1_NomeTroppoCorto() throws Exception
      Test Case TC2_GDU1: Verifica che la registrazione fallisca se il nome è troppo corto. Input: Nome="M" (lunghezza 1) Output atteso: Errore di validazione sul campo nome.
      Throws:
      Exception
    • testTC3_GDU1_NomeTroppoLungo

      @Test @Order(3) public void testTC3_GDU1_NomeTroppoLungo() throws Exception
      Test Case TC3_GDU1: Verifica che la registrazione fallisca se il nome è troppo lungo. Input: Nome="AlessandroRobertoMariangelaDanieleArjelAleksandreGiovanni" (lunghezza 57) Output atteso: Errore di validazione sul campo nome.
      Throws:
      Exception
    • testTC4_GDU1_CognomeVuoto

      @Test @Order(4) public void testTC4_GDU1_CognomeVuoto() throws Exception
      Test Case TC4_GDU1: Verifica che la registrazione fallisca se il cognome è vuoto. Input: Cognome="" (Vuoto) Output atteso: Errore di validazione sul campo cognome.
      Throws:
      Exception
    • testTC5_GDU1_CognomeTroppoCorto

      @Test @Order(5) public void testTC5_GDU1_CognomeTroppoCorto() throws Exception
      Test Case TC5_GDU1: Verifica che la registrazione fallisca se il cognome è troppo corto. Input: Cognome="R" (Lunghezza 1) Output atteso: Errore di validazione sul campo cognome.
      Throws:
      Exception
    • testTC6_GDU1_CognomeTroppoLungo

      @Test @Order(6) public void testTC6_GDU1_CognomeTroppoLungo() throws Exception
      Test Case TC6_GDU1: Verifica che la registrazione fallisca se il cognome è troppo lungo. Input: Cognome="RossiCitoBuziCarpentieriChikviladzeCianelliPellegrino" (Lunghezza 53) Output atteso: Errore di validazione sul campo cognome.
      Throws:
      Exception
    • testTC7_GDU1_EmailVuota

      @Test @Order(7) public void testTC7_GDU1_EmailVuota() throws Exception
      Test Case TC7_GDU1: Verifica che la registrazione fallisca se l'email è vuota. Input: Email="" (Vuoto) Output atteso: Errore di validazione sul campo email.
      Throws:
      Exception
    • testTC8_GDU1_EmailTroppoCorta

      @Test @Order(8) public void testTC8_GDU1_EmailTroppoCorta() throws Exception
      Test Case TC8_GDU1: Verifica che la registrazione fallisca se l'email è troppo corta. Input: Email="M" (Lunghezza 1) Output atteso: Errore di validazione sul campo email.
      Throws:
      Exception
    • testTC9_GDU1_EmailTroppoLunga

      @Test @Order(9) public void testTC9_GDU1_EmailTroppoLunga() throws Exception
      Test Case TC9_GDU1: Verifica che la registrazione fallisca se l'email è troppo lunga. Input: Email="mario.rossi.con.un.nome.veramente.molto.molto.lungo@gmail.com" (Lunghezza 60) Output atteso: Errore di validazione sul campo email.
      Throws:
      Exception
    • testTC10_GDU1_EmailGiaEsistente

      @Test @Order(10) public void testTC10_GDU1_EmailGiaEsistente() throws Exception
      Test Case TC10_GDU1: Verifica che la registrazione fallisca se l'email esiste già. Input: Email="robbencito@gmail.com" (Già esistente nel database di test) Output atteso: Errore di validazione sul campo email (mail.found).
      Throws:
      Exception
    • testTC11_GDU1_EmailFormatoNonValido

      @Test @Order(11) public void testTC11_GDU1_EmailFormatoNonValido() throws Exception
      Test Case TC11_GDU1: Verifica che la registrazione fallisca se il formato dell'email non è valido. Input: Email="MarioRossi.gmail.it" (Manca @) Output atteso: Errore di validazione sul campo email (Pattern).
      Throws:
      Exception
    • testTC12_GDU1_TelefonoFormatoNonValido

      @Test @Order(12) public void testTC12_GDU1_TelefonoFormatoNonValido() throws Exception
      Test Case TC12_GDU1: Verifica che la registrazione fallisca se il formato del telefono non è valido. Input: Telefono="33337698" (Troppo corto / formato errato) Output atteso: Errore di validazione sul campo telefonoutente (Pattern).
      Throws:
      Exception
    • testTC13_GDU1_PasswordVuota

      @Test @Order(13) public void testTC13_GDU1_PasswordVuota() throws Exception
      Test Case TC13_GDU1: Verifica che la registrazione fallisca se la password è vuota. Input: Password="" (Vuoto) Output atteso: Errore di validazione sul campo password.
      Throws:
      Exception
    • testTC14_GDU1_PasswordTroppoCorta

      @Test @Order(14) public void testTC14_GDU1_PasswordTroppoCorta() throws Exception
      Test Case TC14_GDU1: Verifica che la registrazione fallisca se la password è troppo corta. Input: Password="P" (Lunghezza 1) Output atteso: Errore di validazione sul campo password.
      Throws:
      Exception
    • testTC15_GDU1_PasswordTroppoLunga

      @Test @Order(15) public void testTC15_GDU1_PasswordTroppoLunga() throws Exception
      Test Case TC15_GDU1: Verifica che la registrazione fallisca se la password è troppo lunga. Input: Password con più di 50 caratteri Output atteso: Errore di validazione sul campo password.
      Throws:
      Exception
    • testTC16_GDU1_ConfermaPasswordVuota

      @Test @Order(16) public void testTC16_GDU1_ConfermaPasswordVuota() throws Exception
      Test Case TC16_GDU1: Verifica che la registrazione fallisca se la conferma password è vuota. Input: Conferma Password="" (Vuoto) Output atteso: Errore di validazione sul campo confermaPassword.
      Throws:
      Exception
    • testTC17_GDU1_ConfermaPasswordTroppoCorta

      @Test @Order(17) public void testTC17_GDU1_ConfermaPasswordTroppoCorta() throws Exception
      Test Case TC17_GDU1: Verifica che la registrazione fallisca se la conferma password è troppo corta. Input: Conferma Password="P" (Lunghezza 1) Output atteso: Errore di validazione sul campo confermaPassword.
      Throws:
      Exception
    • testTC18_GDU1_ConfermaPasswordTroppoLunga

      @Test @Order(18) public void testTC18_GDU1_ConfermaPasswordTroppoLunga() throws Exception
      Test Case TC18_GDU1: Verifica che la registrazione fallisca se la conferma password è troppo lunga. Input: Conferma Password con più di 50 caratteri Output atteso: Errore di validazione sul campo confermaPassword.
      Throws:
      Exception
    • testTC19_GDU1_PasswordNonCoincidono

      @Test @Order(19) public void testTC19_GDU1_PasswordNonCoincidono() throws Exception
      Test Case TC19_GDU1: Verifica che la registrazione fallisca se le password non coincidono. Input: Password="Password123", Conferma Password="Password12" Output atteso: Errore di validazione (password mismatch).
      Throws:
      Exception
    • testTC20_GDU1_FileNonImmagine

      @Test @Order(20) public void testTC20_GDU1_FileNonImmagine() throws Exception
      Test Case TC20_GDU1: Verifica che la registrazione fallisca se il file caricato non è un'immagine. Input: Immagine="RAD.pdf" (File PDF) Output atteso: Errore di validazione sul campo immagineProfilo.
      Throws:
      Exception
    • testTC21_GDU1_FileTroppoGrande

      @Test @Order(21) public void testTC21_GDU1_FileTroppoGrande() throws Exception
      Test Case TC21_GDU1: Verifica che la registrazione fallisca se l'immagine supera i 12MB. Input: Immagine="Foto4k.jpg" (20MB) Output atteso: Errore di validazione (simulato) sul campo immagineProfilo.
      Throws:
      Exception
    • testTC22_GDU1_RegistrazioneSuccesso

      @Test @Order(22) public void testTC22_GDU1_RegistrazioneSuccesso() throws Exception
      Test Case TC22_GDU1: Verifica che la registrazione avvenga con successo con dati validi. Input: Dati validi (Email e Telefono unici) Output atteso: Redirect alla pagina di login con messaggio di successo.
      Throws:
      Exception