Package com.cis.gorecipe.controller
Class FoodImageControllerTest
java.lang.Object
com.cis.gorecipe.BaseTest
com.cis.gorecipe.controller.FoodImageControllerTest
This class houses the unit/integration tests for all FoodController 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 specified image can be retrievedvoidTest whether the API will reject an attempt to retrieve an image that doesn't existvoidTest whether the images uploaded by a specific user can be retrievedvoidTest whether the API will reject an attempt to the images of a user that doesn't existvoidTest whether a JPG image can be uploaded and will return a list of ingredientsvoidTest whether the API will reject an attempt to upload an image by a user that doesn't existvoidTest whether the API will reject an upload of the wrong image type (e.g.Methods inherited from class com.cis.gorecipe.BaseTest
setDatasourceProperties, setupMockMvc
-
Field Details
-
logger
private final org.slf4j.Logger logger -
controller
-
-
Constructor Details
-
FoodImageControllerTest
FoodImageControllerTest()
-
-
Method Details
-
testUploadImage
Test whether a JPG image can be uploaded and will return a list of ingredients- Throws:
Exception
-
testUploadImageUserNotExists
Test whether the API will reject an attempt to upload an image by a user that doesn't exist- Throws:
Exception
-
testUploadWrongImageType
Test whether the API will reject an upload of the wrong image type (e.g. BMP, SVG, etc.)- Throws:
Exception
-
testGetUserImages
Test whether the images uploaded by a specific user can be retrieved- Throws:
Exception
-
testGetUserNotExistsImages
Test whether the API will reject an attempt to the images of a user that doesn't exist- Throws:
Exception
-
testGetImage
Test whether a specified image can be retrieved- Throws:
Exception
-
testGetImageNotExists
Test whether the API will reject an attempt to retrieve an image that doesn't exist- Throws:
Exception
-