-
Notifications
You must be signed in to change notification settings - Fork 27
/
FakeTestUtil.java
48 lines (36 loc) · 1.01 KB
/
FakeTestUtil.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package dev.nmarulo.depensaapp;
import net.datafaker.Faker;
public final class FakeTestUtil {
public static final Faker faker;
static {
faker = new Faker();
}
public static Integer randomInteger() {
return faker.random()
.nextInt(1, 1000);
}
public static Long randomLong() {
return faker.random()
.nextLong(1, 1000);
}
public static String randomWord() {
return faker.lorem()
.word();
}
public static String randomSentence() {
return faker.lorem()
.sentence(2, 10);
}
public static String randomEmail() {
return faker.internet()
.emailAddress();
}
public static String randomPassword() {
return faker.internet()
.password(60, 60);
}
public static String randomUsername() {
return faker.internet()
.username();
}
}