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 Summary
Modifier and TypeFieldDescriptionprivate DashboardPersonaleService
private JwtService
private MenuDAO
(package private) org.springframework.test.web.servlet.MockMvc
private ProdottoDAO
private ProdottoService
private Set
<Ristoratore> private RistoranteController
private RistoranteDAO
private Set
<Ristorante> private RistoratoreDAO
private TavoloDAO
private RistoranteController
private UserService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
AddMenu()
Testa l'endpoint per aggiungere un menu ad un ristorante effetuando una richiesta con parametri validi(package private) void
Testa l'endpoint per aggiungere un prodotto al Menu effettuando una richiesta con parametri validi(package private) void
Testa l'endpoint di inserimento ristorante effettuando una richiesta con una mail non associata nessun ristoratore(package private) void
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(package private) void
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(package private) void
Testa l'endpoint di getRistoranti associati ad un ristoratore effettuando una richiesta con parametri validi(package private) void
Testa l'endpoint per ottenere i dettagli di un menu dato il suo id effettuando una richiesta con parametri validi(package private) void
Testa l'endpoint per ottenere i menu associati ad un ristorante effettuando una richiesta con parametri validi(package private) void
Testa l'endpoint di getRistorante tramite id effettuando una richiesta con parametri validi(package private) void
Testa l'endpoint di inserimento ristorante effettuando una richiesta con parametri validi(package private) void
Testa la funzionalità per aggiungere un tavolo ad un ristorante(package private) void
Testa l'endpoint per ottenere la lista di prodotti associati ad un menu dato il suo ID, effettuando una richiesta con parametri validi(package private) void
Testa l'endpoint di rimozione di un prodotto dal menu effettuando una richiesta con parametri validi(package private) void
setUp()
(package private) void
Testa l'endpoint per recuperare i tavoli associati ad un ristorante effettuando una richiesta con parametri validi.(package private) void
Testa l'endpoint per ottenere i dettagli di un tavolo dato il suo ID effettuando una richiesta con parametri validi(package private) void
tearDown()
(package private) void
Testa l'endpoint di modifica dati di un ristorante effettuando una richiesta con parametri validi
-
Field Details
-
ristoranteController
-
jwtService
-
ristoranteDAO
-
tavoloDAO
-
userService
-
ristoratoreDAO
-
prodottoDAO
-
prodottoService
-
dashboardPersonaleService
-
underTest
-
mockMvc
@Autowired org.springframework.test.web.servlet.MockMvc mockMvc -
RisSet
-
Ristoranti
-
Tables
-
Menus
-
-
Constructor Details
-
RistoranteControllerTest
RistoranteControllerTest()
-
-
Method Details
-
setUp
@BeforeEach void setUp() -
tearDown
@AfterEach void tearDown() -
insertRistorante
Testa l'endpoint di inserimento ristorante effettuando una richiesta con parametri validi- Throws:
Exception
-
getRistorante
Testa l'endpoint di getRistorante tramite id effettuando una richiesta con parametri validi- Throws:
Exception
-
getAllRistorantiByRistoratore
Testa l'endpoint di getRistoranti associati ad un ristoratore effettuando una richiesta con parametri validi- Throws:
Exception
-
updateRistorante
Testa l'endpoint di modifica dati di un ristorante effettuando una richiesta con parametri validi- Throws:
Exception
-
AddMenu
Testa l'endpoint per aggiungere un menu ad un ristorante effetuando una richiesta con parametri validi- Throws:
Exception
-
addProductToMenu
Testa l'endpoint per aggiungere un prodotto al Menu effettuando una richiesta con parametri validi- Throws:
Exception
-
removeProductFromMenu
Testa l'endpoint di rimozione di un prodotto dal menu effettuando una richiesta con parametri validi- Throws:
Exception
-
getMenusByRestaurantID
Testa l'endpoint per ottenere i menu associati ad un ristorante effettuando una richiesta con parametri validi- Throws:
Exception
-
getMenuByID
Testa l'endpoint per ottenere i dettagli di un menu dato il suo id effettuando una richiesta con parametri validi- Throws:
Exception
-
insertTavolo
Testa la funzionalità per aggiungere un tavolo ad un ristorante- Throws:
Exception
-
prodottiByIDMenu
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
Testa l'endpoint per recuperare i tavoli associati ad un ristorante effettuando una richiesta con parametri validi.- Throws:
Exception
-
TavoloByID
Testa l'endpoint per ottenere i dettagli di un tavolo dato il suo ID effettuando una richiesta con parametri validi- Throws:
Exception
-
failInsertRistorante
Testa l'endpoint di inserimento ristorante effettuando una richiesta con una mail non associata nessun ristoratore- Throws:
Exception
-
failUpdateRistoranteNotOwner
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
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
-