Skip to content

Commit 840fe00

Browse files
Fix identical creation dates in tests
1 parent 807718a commit 840fe00

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/app/fyreplace/api/data/dev/DataSeeder.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public User createUser(
112112
user.persist();
113113
}
114114

115+
sleep();
115116
return user;
116117
}
117118

@@ -135,6 +136,7 @@ public Post createPost(final User author, final String text, final boolean publi
135136
post.publish(postsStartingLife, anonymous);
136137
}
137138

139+
sleep();
138140
return post;
139141
}
140142

@@ -146,6 +148,15 @@ public Comment createComment(final User author, final Post post, final String te
146148
comment.post = post;
147149
comment.text = text;
148150
comment.persist();
151+
sleep();
149152
return comment;
150153
}
154+
155+
private void sleep() {
156+
try {
157+
Thread.sleep(1L);
158+
} catch (InterruptedException e) {
159+
throw new RuntimeException(e);
160+
}
161+
}
151162
}

0 commit comments

Comments
 (0)