Class RecipeControllerTest

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

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

    • logger

      private final org.slf4j.Logger logger
    • controller

      @Autowired RecipeController controller
  • Constructor Details

    • RecipeControllerTest

      RecipeControllerTest()
  • Method Details

    • testAddRecipe

      @DirtiesContext @Test public void testAddRecipe() throws Exception
      Test whether a valid recipe can be added
      Throws:
      Exception
    • testDeleteRecipe

      @DirtiesContext @Test public void testDeleteRecipe() throws Exception
      Test whether a recipe that exists can be deleted
      Throws:
      Exception
    • testDeleteRecipeDoesntExist

      @Test public void testDeleteRecipeDoesntExist() throws Exception
      Test whether the API will reject an attempt to delete a recipe that doesn't exist
      Throws:
      Exception
    • testGetRecipe

      @DirtiesContext @Test public void testGetRecipe() throws Exception
      Test whether a recipe can be retrieved via its ID
      Throws:
      Exception
    • testGetRecipeDoesntExist

      @Test public void testGetRecipeDoesntExist() throws Exception
      Test whether the API will reject an attempt to get a recipe using an invalid ID
      Throws:
      Exception
    • testGetAllRecipes

      @DirtiesContext @Test public void testGetAllRecipes() throws Exception
      Test whether a list of all recipes can be retrieved
      Throws:
      Exception
    • testSearchRecipes

      @Test public void testSearchRecipes() throws Exception
      Test whether a subset of recipes can be returned based on a search query
      Throws:
      Exception