Class RistoranteControllerTest

java.lang.Object
it.unisa.thespoon.ristorante.controller.RistoranteControllerTest

@SpringBootTest @AutoConfigureMockMvc @Rollback @Import(RestExceptionHandler.class) @ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) class RistoranteControllerTest extends Object
Author:
Jacopo Gennaro Esposito La classe si occupa di testare gli enpoint delle API del sottosistema ristorante
  • Field Details

  • Constructor Details

    • RistoranteControllerTest

      RistoranteControllerTest()
  • Method Details

    • setUp

      @BeforeEach void setUp()
    • tearDown

      @AfterEach void tearDown()
    • insertRistorante

      @Test void insertRistorante() throws Exception
      Testa l'endpoint di inserimento ristorante effettuando una richiesta con parametri validi
      Throws:
      Exception
    • getRistorante

      @Test void getRistorante() throws Exception
      Testa l'endpoint di getRistorante tramite id effettuando una richiesta con parametri validi
      Throws:
      Exception
    • getAllRistorantiByRistoratore

      @Test void getAllRistorantiByRistoratore() throws Exception
      Testa l'endpoint di getRistoranti associati ad un ristoratore effettuando una richiesta con parametri validi
      Throws:
      Exception
    • updateRistorante

      @Test void updateRistorante() throws Exception
      Testa l'endpoint di modifica dati di un ristorante effettuando una richiesta con parametri validi
      Throws:
      Exception
    • AddMenu

      @Test void AddMenu() throws Exception
      Testa l'endpoint per aggiungere un menu ad un ristorante effetuando una richiesta con parametri validi
      Throws:
      Exception
    • addProductToMenu

      @Test void addProductToMenu() throws Exception
      Testa l'endpoint per aggiungere un prodotto al Menu effettuando una richiesta con parametri validi
      Throws:
      Exception
    • removeProductFromMenu

      @Test void removeProductFromMenu() throws Exception
      Testa l'endpoint di rimozione di un prodotto dal menu effettuando una richiesta con parametri validi
      Throws:
      Exception
    • getMenusByRestaurantID

      @Test void getMenusByRestaurantID() throws Exception
      Testa l'endpoint per ottenere i menu associati ad un ristorante effettuando una richiesta con parametri validi
      Throws:
      Exception
    • getMenuByID

      @Test void getMenuByID() throws Exception
      Testa l'endpoint per ottenere i dettagli di un menu dato il suo id effettuando una richiesta con parametri validi
      Throws:
      Exception
    • insertTavolo

      @Test void insertTavolo() throws Exception
      Testa la funzionalità per aggiungere un tavolo ad un ristorante
      Throws:
      Exception
    • prodottiByIDMenu

      @Test void prodottiByIDMenu() throws Exception
      Testa l'endpoint per ottenere la lista di prodotti associati ad un menu dato il suo ID, effettuando una richiesta con parametri validi
      Throws:
      Exception
    • TavoliRistorante

      @Test void TavoliRistorante() throws Exception
      Testa l'endpoint per recuperare i tavoli associati ad un ristorante effettuando una richiesta con parametri validi.
      Throws:
      Exception
    • TavoloByID

      @Test void TavoloByID() throws Exception
      Testa l'endpoint per ottenere i dettagli di un tavolo dato il suo ID effettuando una richiesta con parametri validi
      Throws:
      Exception
    • failInsertRistorante

      @Test void failInsertRistorante() throws Exception
      Testa l'endpoint di inserimento ristorante effettuando una richiesta con una mail non associata nessun ristoratore
      Throws:
      Exception
    • failUpdateRistoranteNotOwner

      @Test void failUpdateRistoranteNotOwner() throws Exception
      Testa l'endpoint di modifica dati di un ristorante effettuando una richiesta con parametri non validi, in particolare il ristoratore non è proprietario del ristorante che si vuole modificare
      Throws:
      Exception
    • failUpdateRistoranteUserNotFound

      @Test void failUpdateRistoranteUserNotFound() throws Exception
      Testa l'endpoint di modifica dati di un ristorante effettuando una richiesta con parametri non validi, in particolare la mail non risulta associata ad un ristoratore
      Throws:
      Exception