From 6fc697a5444b9a0f0c3666b0fd5becb16a46252c Mon Sep 17 00:00:00 2001 From: Chirag Mangukia Date: Fri, 30 Sep 2022 18:30:01 +0530 Subject: [PATCH] Added MoneyHeist Provider --- README.md | 1 + .../java/net/datafaker/movie/MoneyHeist.java | 25 +++++++++++++++++++ .../net/datafaker/movie/MovieProviders.java | 4 +++ .../net/datafaker/service/files/EnFile.java | 1 + src/main/resources/en/money_heist.yml | 6 +++++ .../net/datafaker/movie/MoneyHeistTest.java | 23 +++++++++++++++++ 6 files changed, 60 insertions(+) create mode 100644 src/main/java/net/datafaker/movie/MoneyHeist.java create mode 100644 src/main/resources/en/money_heist.yml create mode 100644 src/test/java/net/datafaker/movie/MoneyHeistTest.java diff --git a/README.md b/README.md index 248bf1872..497f53588 100644 --- a/README.md +++ b/README.md @@ -315,6 +315,7 @@ Providers * Military * Minecraft * Money +* Money Heist * Mood * Mountains * Mountaineering diff --git a/src/main/java/net/datafaker/movie/MoneyHeist.java b/src/main/java/net/datafaker/movie/MoneyHeist.java new file mode 100644 index 000000000..a0f90d740 --- /dev/null +++ b/src/main/java/net/datafaker/movie/MoneyHeist.java @@ -0,0 +1,25 @@ +package net.datafaker.movie; + +import net.datafaker.base.AbstractProvider; + +/** + * @since 1.7.0 + */ +public class MoneyHeist extends AbstractProvider { + + protected MoneyHeist(MovieProviders faker) { + super(faker); + } + + public String character() { + return resolve("money_heist.characters"); + } + + public String heist() { + return resolve("money_heist.heists"); + } + + public String quote() { + return resolve("money_heist.quotes"); + } +} diff --git a/src/main/java/net/datafaker/movie/MovieProviders.java b/src/main/java/net/datafaker/movie/MovieProviders.java index fde91059d..4f44280a1 100644 --- a/src/main/java/net/datafaker/movie/MovieProviders.java +++ b/src/main/java/net/datafaker/movie/MovieProviders.java @@ -111,6 +111,10 @@ default Kaamelott kaamelott() { default LordOfTheRings lordOfTheRings() { return getProvider(LordOfTheRings.class, LordOfTheRings::new); } + + default MoneyHeist moneyHeist() { + return getProvider(MoneyHeist.class, MoneyHeist::new); + } default Movie movie() { return getProvider(Movie.class, Movie::new); diff --git a/src/main/java/net/datafaker/service/files/EnFile.java b/src/main/java/net/datafaker/service/files/EnFile.java index 6e1f8361c..bc62109c2 100644 --- a/src/main/java/net/datafaker/service/files/EnFile.java +++ b/src/main/java/net/datafaker/service/files/EnFile.java @@ -152,6 +152,7 @@ public String getPath() { "military.yml", "minecraft.yml", "money.yml", + "money_heist.yml", "most_interesting_man_in_the_world.yml", "mood.yml", "movie.yml", diff --git a/src/main/resources/en/money_heist.yml b/src/main/resources/en/money_heist.yml new file mode 100644 index 000000000..49381e20e --- /dev/null +++ b/src/main/resources/en/money_heist.yml @@ -0,0 +1,6 @@ +en: + faker: + money_heist: + characters: ["Tokyo", "The Professor", "Lisbon", "Berlin", "Moscow", "Nairobi", "Rio", "Denver", "Stockholm", "Arturo Román", "Alison Parker ", "Helsinki", "Bogotá", "Palermo", "Alicia Sierra ", "Marseille", "Manila", "Colonel Luis Tamayo", "Logroño", "Pamplona", "César Gandía", "Ángel Rubio", "Suárez", "Colonel Luis Prieto"] + heists: ["Royal Mint of Spain", "Bank of Spain"] + quotes: ["The plan is designed to survive any setbacks, including my death", "You’re the sexiest woman in the world but I love you for your brains", "I am offering you resurrection, A second life", "Sometimes, a truce is the most important part of a war", "In this world, everything is governed by balance. There is what you stand to gain and what you stand to lose. And when you think you've got nothing to lose, you become overconfident", "Time is greater than money", "Maybe we are all immature to some extent", "You can't get out of the Bank of Spain alive. It is impossible. But I will get you out of there", "Death is simply just a word, a priori. It comprises everything that doesn’t exist. On the other hand, once you’re dead, you won’t remember you were alive", "Death can be the greatest opportunity of your life", "No matter how tough things get, children always turn out okay", "I’ve spent my life being a bit of a son of a bitch, but today I think I want to die with dignity", "In heists, love can get multiplied"] diff --git a/src/test/java/net/datafaker/movie/MoneyHeistTest.java b/src/test/java/net/datafaker/movie/MoneyHeistTest.java new file mode 100644 index 000000000..aa0b205db --- /dev/null +++ b/src/test/java/net/datafaker/movie/MoneyHeistTest.java @@ -0,0 +1,23 @@ +package net.datafaker.movie; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class MoneyHeistTest extends MovieFakerTest { + + @Test + void character() { + assertThat(faker.moneyHeist().character()).isNotEmpty(); + } + + @Test + void heist() { + assertThat(faker.moneyHeist().heist()).isNotEmpty(); + } + + @Test + void quote() { + assertThat(faker.moneyHeist().quote()).isNotEmpty(); + } +}