Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MBTI feature #728

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
1.1
ak-maker committed May 26, 2022
commit 16eddc588822dcaf1d26d4df347c64d903d60a9b
33 changes: 33 additions & 0 deletions src/main/java/com/github/javafaker/Mbti.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.github.javafaker;

public class Mbti {
private final Faker faker;
private final String choice;

public Mbti(final Faker faker) {
this.faker = faker;
choice = faker.resolve("mbti.choice");
}

public String type() {
return faker.resolve("mbti.".concat(choice).concat(".type"));
}

public String name() {
return faker.resolve("mbti.".concat(choice).concat(".name"));
}

public String characteristic() {
return faker.resolve("mbti.".concat(choice).concat(".characteristic"));
}

public String personage() {
return faker.resolve("mbti.".concat(choice).concat(".personage"));
}

public String merit(){return faker.resolve("mbti.".concat(choice).concat(".merit"));}

public String weakness(){return faker.resolve("mbti.".concat(choice).concat(".weakness"));}


}
116 changes: 116 additions & 0 deletions src/main/resources/en/mbti.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
en:
faker:
mbti:
choice: ["A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","A11","A12","A13","A14","A15","A16"]
A1:
type: ["ISTJ"]
name: ["Logistician Personality"]
characteristic: ["If you respect your reputation, surround yourself with good people","It's better to be alone than with the wrong person."]
personage: ["Denzel Washington","Natalie Portman","George Herbert Walker Bush","Eddard Stark"]
merit: ["Be honest and direct","Strong-willed and conscientious","Very responsible"]
weakness: ["stubborn","insensitive","Blame yourself often and unreasonably"]
A2:
type: ["ISTP"]
name: ["Virtuoso Personality"]
characteristic: ["Dare to be different","What everyone agrees on is boring"]
personage: ["Olivia Wilde","Bear Grylls","Milla Jovovich","Tom Cruise","Arya Stark"]
merit: ["Optimistic and energetic","Creativity and practicality","Know how to prioritize","Greatness in crisis"]
weakness: ["stubborn","insensitive","Easy to be bored","risk taking behavior"]
A3:
type: ["ESTP"]
name: ["Entrepreneur Personality"]
characteristic: ["Never confuse action with action","Most people are not paying attention"]
personage: ["Ernest Miller Hemingway","Eddie Murphy","Madonna Ciccone"]
merit: ["bold","Rational and practical","original","sociability"]
weakness: ["insensitive","impatient","Provocative"]
A4:
type: ["ESTJ"]
name: ["Executive Personality"]
characteristic: ["A man of dignity should fight for what is right","It is praiseworthy that a man dare to accept his mistakes"]
personage: ["Sonia Sotomayor","John Davison Rockefeller","Francis Albert Sinatra"]
merit: ["dedicate oneself to work","have a strong will","Loyalty, patience and dependability"]
weakness: ["Inflexible and stubborn","Uncomfortable with unconventional situations","Too much focus on social status","difficult to relax"]
A5:
type: ["ISFJ"]
name: ["Defender Personality"]
characteristic: ["Seeing is believing.","Protect you as much as possible"]
personage: ["Beyonce Giselle Knowles","Her Majesty Queen Elizabeth II","Captain America"]
merit: ["supportive","Reliability and patience","Imaginative and observant"]
weakness: ["Too modest and shy","Taking things too personally","Suppress their feelings"]
A6:
type: ["ISFP"]
name: ["Adventurer Personality"]
characteristic: ["Happy with who you are","Meaning exists in every corner of life"]
personage: ["Lana Del Rey","Avril Ramona Lavigne","Britney Spears"]
merit: ["charming","Be sensitive to others","imaginative"]
weakness: ["Very independent","be nervous easily","Fluctuating self-esteem"]
A7:
type: ["ESFP"]
name: ["Entertainer Personality"]
characteristic: ["We Are Stars","Deserve to shine"]
personage: ["Elton John","Marilyn Monroe","Adele","Miley Cyrus"]
merit: ["bold","Aesthetics and performance techniques","outsight"]
weakness: ["sensitive","Poor long term planners","lack of concentration"]
A8:
type: ["ESFJ"]
name: ["Consul Personality"]
characteristic: ["Respect the wisdom of the leader","amicable relationship"]
personage: ["Taylor Swift","Jennifer Garner","Cersei Lannister"]
merit: ["Strong practical ability","strong sense of responsibility","Very loyal and friendly"]
weakness: ["Worried about their social status","Unwillingness to innovate or improvise","Too needy"]
A9:
type: ["INFJ"]
name: ["Advocate Personality"]
characteristic: ["help each other","keep fighting"]
personage: ["Martin Luther King","Nicole Kidman","Aragorn"]
merit: ["creativity","insight","altruism"]
weakness: ["Sensitive to criticism","perfectionism","Prone To Job Burnout"]
A10:
type: ["INFP"]
name: ["Mediator Personality"]
characteristic: ["The gift of empathy","tell the truth","Looking for call"]
personage: ["William Shakespeare","William Wordsworth","Frodo Baggins"]
merit: ["understanding","open-minded","creativity"]
weakness: ["unrealistic","self-segregation","emotional fragility"]
A11:
type: ["ENFP"]
name: ["Campaigner Personality"]
characteristic: ["One idea can change the world","Don't lose that little bit of craziness"]
personage: ["Robert Downey Jr","Robin Williams","Spider-Man"]
merit: ["inquisitive","insight","Excellent communicator"]
weakness: ["Eagerness to Please","disorderly and unsystematic","restlessness"]
A12:
type: ["ENFJ"]
name: ["Protagonist Personality"]
characteristic: ["Have firm faith in people","No hardship can prevent support for a just cause that is firmly believed"]
personage: ["Barack Obama","John Cusack","Daenerys Targaryen"]
merit: ["embrace abjure","reliable","charismatic"]
weakness: ["unrealistic","Too idealistic","condescending"]
A13:
type: ["INTJ"]
name: ["Architect Personality"]
characteristic: ["The right attitude can achieve any goal","Never waver in matters of principle","People think more when they're alone"]
personage: ["Michelle LaVaughn Obama","Elon Musk","Christopher Nolan","Petyr Baelish"]
merit: ["rationality","Informed","versatility"]
weakness: ["arrogance","preciosity","bellicose"]
A14:
type: ["INTP"]
name: ["Logician Personality"]
characteristic: ["The unexamined life is not worth living","The beginning of wisdom is doubt"]
personage: ["Bill Gates","Kristen Stewart","Albert Einstein","Elliot Page"]
merit: ["analysis","original","open-minded"]
weakness: ["be disjointed","insensitive","dissatisfaction"]
A15:
type: ["ENTP"]
name: ["Debater Personality"]
characteristic: ["There are no rules, only goals","Seemingly hard work makes people miss opportunities"]
personage: ["Adam Savage","Tom Hanks","Tyrion Lannister"]
merit: ["a wide range of knowledge","A good brainstormer"]
weakness: ["Very controversial","Difficulty concentrating","Don't like practical problems"]
A16:
type: ["ENTJ"]
name: ["Commander Personality"]
characteristic: ["Happiness comes from the joy of achievement","Develop interpersonal skills"]
personage: ["Steve Jobs","Margaret Hilda Thatcher","Gordon Ramsay"]
merit: ["efficient","Charming and inspiring","have a strong will"]
weakness: ["Stubborn and domineering","Unforgivingness","have a stony heart"]
41 changes: 41 additions & 0 deletions src/test/java/com/github/javafaker/MbtiTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.github.javafaker;


import org.junit.Test;

import static com.github.javafaker.matchers.MatchesRegularExpression.matchesRegularExpression;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;

public class MbtiTest extends AbstractFakerTest{
public void type() {
assertThat(faker.mbti().type(), matchesRegularExpression("[A-Za-z,\\-\\.\\(\\) ]+"));
assertThat(faker.mbti().characteristic(), not(isEmptyOrNullString()));
}
@Test
public void name() {
assertThat(faker.mbti().name(), matchesRegularExpression("[A-Za-z,\\-\\.\\(\\) ]+"));
assertThat(faker.mbti().characteristic(), not(isEmptyOrNullString()));
}
@Test
public void characteristic() {
assertThat(faker.mbti().personage(), matchesRegularExpression("[A-Za-z,\\-\\.\\(\\) '\"!?`;: ]+"));
assertThat(faker.mbti().characteristic(), not(isEmptyOrNullString()));
}
@Test
public void personage() {
assertThat(faker.mbti().personage(), matchesRegularExpression("[A-Za-z,\\-\\.\\(\\) ]+"));
assertThat(faker.mbti().characteristic(), not(isEmptyOrNullString()));
}
@Test
public void merit() {
assertThat(faker.mbti().merit(), matchesRegularExpression("[A-Za-z,\\-\\.\\(\\) ]+"));
assertThat(faker.mbti().characteristic(), not(isEmptyOrNullString()));
}
@Test
public void weakness() {
assertThat(faker.mbti().weakness(), matchesRegularExpression("[A-Za-z,\\-\\.\\(\\) ]+"));
assertThat(faker.mbti().characteristic(), not(isEmptyOrNullString()));
}
}