Class FoodImageControllerTest

java.lang.Object
com.cis.gorecipe.BaseTest
com.cis.gorecipe.controller.FoodImageControllerTest

class FoodImageControllerTest extends BaseTest
This class houses the unit/integration tests for all FoodController API endpoints
  • Field Details

    • logger

      private final org.slf4j.Logger logger
    • controller

      @Autowired FoodImageController controller
  • Constructor Details

    • FoodImageControllerTest

      FoodImageControllerTest()
  • Method Details

    • testUploadImage

      @DirtiesContext @Test public void testUploadImage() throws Exception
      Test whether a JPG image can be uploaded and will return a list of ingredients
      Throws:
      Exception
    • testUploadImageUserNotExists

      @Test public void testUploadImageUserNotExists() throws Exception
      Test whether the API will reject an attempt to upload an image by a user that doesn't exist
      Throws:
      Exception
    • testUploadWrongImageType

      @DirtiesContext @Test public void testUploadWrongImageType() throws Exception
      Test whether the API will reject an upload of the wrong image type (e.g. BMP, SVG, etc.)
      Throws:
      Exception
    • testGetUserImages

      @DirtiesContext @Test public void testGetUserImages() throws Exception
      Test whether the images uploaded by a specific user can be retrieved
      Throws:
      Exception
    • testGetUserNotExistsImages

      @Test public void testGetUserNotExistsImages() throws Exception
      Test whether the API will reject an attempt to the images of a user that doesn't exist
      Throws:
      Exception
    • testGetImage

      @DirtiesContext @Test public void testGetImage() throws Exception
      Test whether a specified image can be retrieved
      Throws:
      Exception
    • testGetImageNotExists

      @Test public void testGetImageNotExists() throws Exception
      Test whether the API will reject an attempt to retrieve an image that doesn't exist
      Throws:
      Exception