Skip to content

Instantly share code, notes, and snippets.

@woprzech

woprzech/fake.java

Last active Jun 1, 2017
Embed
What would you like to do?
@Profile("transient")
public class FakeAccountRepository implements AccountRepository {
Map<User, Account> accounts = new HashMap<>();
public FakeAccountRepository() {
this.accounts.put(new User("john@bmail.com"), new UserAccount());
this.accounts.put(new User("boby@bmail.com"), new AdminAccount());
}
String getPasswordHash(User user) {
return accounts.get(user).getPasswordHash();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment