From cbe31057fcb1f5cb6ee48643634e38cd0286df73 Mon Sep 17 00:00:00 2001 From: Hardik Singh Behl Date: Mon, 18 Nov 2024 13:36:19 +0530 Subject: [PATCH] feature: add movie name to movie provider (#1442) * add support for movie name --- .../providers/entertainment/Movie.java | 10 +-- src/main/resources/en/movie.yml | 85 +++++++++++++++++++ .../providers/entertainment/MovieTest.java | 4 +- 3 files changed, 93 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/datafaker/providers/entertainment/Movie.java b/src/main/java/net/datafaker/providers/entertainment/Movie.java index d8404f281..850be6d96 100644 --- a/src/main/java/net/datafaker/providers/entertainment/Movie.java +++ b/src/main/java/net/datafaker/providers/entertainment/Movie.java @@ -11,12 +11,12 @@ protected Movie(EntertainmentProviders faker) { super(faker); } - /** - * This method generates a random quote from a movie. - * - * @return a string of quote from a movie. - */ public String quote() { return resolve("movie.quote"); } + + public String name() { + return resolve("movie.name"); + } + } diff --git a/src/main/resources/en/movie.yml b/src/main/resources/en/movie.yml index 2512fb58f..3e5ddaf9e 100644 --- a/src/main/resources/en/movie.yml +++ b/src/main/resources/en/movie.yml @@ -13,3 +13,88 @@ en: - "You talking to me?" - "What we've got here is failure to communicate." - "I love the smell of napalm in the morning." + name: + - "Everything Everywhere All at Once" + - "Manchester by the Sea" + - "Marcel the Shell with Shoes On" + - "The Florida Project" + - "First Cow" + - "The Eternal Daughter" + - "Talk to Me" + - "Saint Maud" + - "Uncut Gems" + - "A Ghost Story" + - "The Lighthouse" + - "Hereditary" + - "Green Room" + - "The Iron Claw" + - "The Exorcist" + - "Reservoir Dogs" + - "Pulp Fiction" + - "Inglourious Basterds" + - "Django Unchained" + - "Insomnia" + - "Tenet" + - "Memento" + - "Inception" + - "Interstellar" + - "The Prestige" + - "Batman Begins" + - "The Dark Knight" + - "The Dark Knight Rises" + - "Dunkirk" + - "Oppenheimer" + - "L.A. Confidential" + - "The Godfather" + - "Parasite" + - "Schindler's List" + - "12 Angry Men" + - "Goodfellas" + - "There Will Be Blood" + - "The Truman Show" + - "Forrest Gump" + - "The Dictator" + - "Fight Club" + - "The Matrix" + - "The Silence of the Lambs" + - "Saving Private Ryan" + - "Gladiator" + - "The Hangover" + - "The Departed" + - "The Usual Suspects" + - "The Shining" + - "Good Will Hunting" + - "Requiem for a Dream" + - "Eternal Sunshine of the Spotless Mind" + - "Scarface" + - "Taxi Driver" + - "Heat" + - "American Beauty" + - "To Kill a Mockingbird" + - "Die Hard" + - "The Wolf of Wall Street" + - "Shutter Island" + - "The Sixth Sense" + - "No Country for Old Men" + - "A Beautiful Mind" + - "Raging Bull" + - "Catch Me If You Can" + - "Million Dollar Baby" + - "Gone Girl" + - "Ratatouille" + - "Rocky" + - "Unbreakable" + - "Split" + - "Glass" + - "Knock at the Cabin" + - "Titanic" + - "The Notebook" + - "Jerry Maguire" + - "American Made" + - "Edge of Tomorrow" + - "Collateral" + - "Minority Report" + - "About Time" + - "Arrival" + - "12 Monkeys" + - "Predestination" diff --git a/src/test/java/net/datafaker/providers/entertainment/MovieTest.java b/src/test/java/net/datafaker/providers/entertainment/MovieTest.java index eb38c8911..877fcd248 100644 --- a/src/test/java/net/datafaker/providers/entertainment/MovieTest.java +++ b/src/test/java/net/datafaker/providers/entertainment/MovieTest.java @@ -10,7 +10,9 @@ class MovieTest extends EntertainmentFakerTest { @Override protected Collection providerListTest() { return List.of( - TestSpec.of(movie::quote, "movie.quote") + TestSpec.of(movie::quote, "movie.quote"), + TestSpec.of(movie::name, "movie.name") ); } + }