Skip to content

Commit

Permalink
test: Fix MovieControllerTest.createMovie
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilKes committed Feb 13, 2024
1 parent 63b7885 commit 034ba66
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@ public class MovieControllerTest {
@MockBean
private MovieService movieService;

private List<Movie> testMovies = Arrays.asList(createMovie("Movie 1"),
createMovie("Movie 2"),
createMovie("Movie 3"),
createMovie("Movie 4"));
private List<Movie> testMovies = Arrays.asList(createMovie("Movie 1", 1L),
createMovie("Movie 2", 2L),
createMovie("Movie 3", 3L),
createMovie("Movie 4", 4L));

private static long movieIdCounter = 1;

private static Movie createMovie(String name) {
private static Movie createMovie(String name, Long id) {
Movie movie = new Movie();
movie.setDate(new Date());
movie.setMovId(movieIdCounter++);
movie.setMovId(id);
movie.setName(name);
movie.setLength(100L);
movie.setDescription("A Movie");
Expand Down

0 comments on commit 034ba66

Please sign in to comment.