Package com.cis.gorecipe.controller
Class RecipeControllerTest
java.lang.Object
com.cis.gorecipe.BaseTest
com.cis.gorecipe.controller.RecipeControllerTest
This class houses the unit/integration tests for all RecipeController API endpoints
-
Field Summary
FieldsFields inherited from class com.cis.gorecipe.BaseTest
clarifaiService, classLoader, encoder, foodImageRepository, ingredientRepository, mockMvc, recipeRepository, s3Service, serializer, spoonacularService, userRepository, wac -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTest whether a valid recipe can be addedvoidTest whether a recipe that exists can be deletedvoidTest whether the API will reject an attempt to delete a recipe that doesn't existvoidTest whether a list of all recipes can be retrievedvoidTest whether a recipe can be retrieved via its IDvoidTest whether the API will reject an attempt to get a recipe using an invalid IDvoidTest whether a subset of recipes can be returned based on a search queryMethods inherited from class com.cis.gorecipe.BaseTest
setDatasourceProperties, setupMockMvc
-
Field Details
-
logger
private final org.slf4j.Logger logger -
controller
-
-
Constructor Details
-
RecipeControllerTest
RecipeControllerTest()
-
-
Method Details
-
testAddRecipe
Test whether a valid recipe can be added- Throws:
Exception
-
testDeleteRecipe
Test whether a recipe that exists can be deleted- Throws:
Exception
-
testDeleteRecipeDoesntExist
Test whether the API will reject an attempt to delete a recipe that doesn't exist- Throws:
Exception
-
testGetRecipe
Test whether a recipe can be retrieved via its ID- Throws:
Exception
-
testGetRecipeDoesntExist
Test whether the API will reject an attempt to get a recipe using an invalid ID- Throws:
Exception
-
testGetAllRecipes
Test whether a list of all recipes can be retrieved- Throws:
Exception
-
testSearchRecipes
Test whether a subset of recipes can be returned based on a search query- Throws:
Exception
-