@@ -0,0 +1,2031 @@
+/**%0A * This source file is subject to the license that is bundled with this package in the file LICENSE.%0A */%0Apackage com.codeup.application.actions;%0A%0Aimport com.codeup.application.MoviesConsole;%0Aimport com.codeup.movies.Categories;%0Aimport com.codeup.movies.Category;%0Aimport com.codeup.movies.Movie;%0Aimport com.codeup.movies.catalog.SearchByCategory;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class SearchByCategoryActionTest %7B%0A    @Test%0A    public void it_shows_the_movies_in_a_given_category() %7B%0A        int defaultId = 0;%0A        when(categories.all()).thenReturn(allCategories);%0A        when(console.chooseACategoryFrom(allCategories)).thenReturn(animated);%0A        when(searchMovies.inCategory(defaultId)).thenReturn(movies);%0A%0A        action.execute();%0A%0A        verify(console).showMovies(movies);%0A    %7D%0A%0A    @Before%0A    public void configureAction() %7B%0A        Category drama = Category.named(%22drama%22);%0A        Category musical = Category.named(%22musical%22);%0A        animated = Category.named(%22animated%22);%0A        allCategories = Arrays.asList(drama, musical, animated);%0A%0A        movies = new ArrayList%3C%3E();%0A        movies.add(Movie.publish(%22Shrek%22, 5, %22shrek.png%22, Collections.singletonList(animated)));%0A        movies.add(Movie.publish(%22Home%22, 4, %22home.png%22, Collections.singletonList(animated)));%0A%0A        action = new SearchByCategoryAction(searchMovies, console, categories);%0A    %7D%0A%0A    private SearchByCategoryAction action;%0A%0A    private List%3CCategory%3E allCategories;%0A    private Category animated;%0A    private List%3CMovie%3E movies;%0A%0A    @Mock%0A    private SearchByCategory searchMovies;%0A%0A    @Mock%0A    private MoviesConsole console;%0A%0A    @Mock%0A    private Categories categories;%0A%7D%0A

Add tests for SearchByCategoryAction class.