Skip to content

Commit

Permalink
feature: add movie name to movie provider (#1442)
Browse files Browse the repository at this point in the history
* add support for movie name
  • Loading branch information
hardikSinghBehl authored Nov 18, 2024
1 parent 562ceed commit cbe3105
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main/java/net/datafaker/providers/entertainment/Movie.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

}
85 changes: 85 additions & 0 deletions src/main/resources/en/movie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class MovieTest extends EntertainmentFakerTest {
@Override
protected Collection<TestSpec> providerListTest() {
return List.of(
TestSpec.of(movie::quote, "movie.quote")
TestSpec.of(movie::quote, "movie.quote"),
TestSpec.of(movie::name, "movie.name")
);
}

}

0 comments on commit cbe3105

Please sign in to comment.