File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
main/kotlin/org/gitanimals/render
test/kotlin/org/gitanimals/render/domain Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -145,13 +145,13 @@ class User(
145145 }
146146
147147 @JsonIgnore
148- fun isContributionUpdatedBeforeOneHour (): Boolean {
148+ fun isContributionUpdatedLongAgo (): Boolean {
149149 val currentYear = instant().toZonedDateTime(ZoneId .of(" UTC" )).year
150150 val currentYearContribution =
151151 contributions.firstOrNull { it.year == currentYear } ? : return true
152152
153153 return currentYearContribution.lastUpdatedContribution.isBefore(
154- Instant .now().minus(1 , ChronoUnit .HOURS )
154+ Instant .now().minus(10 , ChronoUnit .MINUTES )
155155 )
156156 }
157157
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ class UserService(
4545 return increasedContributionCount
4646 }
4747
48- fun isContributionUpdatedBeforeOneHour (name : String ): Boolean =
49- getUserByName(name).isContributionUpdatedBeforeOneHour ()
48+ fun isContributionUpdatedLongAgo (name : String ): Boolean =
49+ getUserByName(name).isContributionUpdatedLongAgo ()
5050
5151 fun getUserByName (name : String ): User = userRepository.findByName(name)
5252 ? : throw IllegalArgumentException (" Cannot find exists user by name \" $name \" " )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class VisitedEventListener(
3535
3636 logger.info(" [VisitedEventListener] Increase visit to user. username: \" $username \" " )
3737
38- if (! userService.isContributionUpdatedBeforeOneHour (username)) {
38+ if (userService.isContributionUpdatedLongAgo (username). not ( )) {
3939 return
4040 }
4141
Original file line number Diff line number Diff line change @@ -74,14 +74,14 @@ internal class UserTest(
7474 )
7575
7676 it("true를 반환한다.") {
77- user.isContributionUpdatedBeforeOneHour () shouldBeEqual true
77+ user.isContributionUpdatedLongAgo () shouldBeEqual true
7878 }
7979 }
8080
8181 context("user의 현재년도에 해당하는 contribution을 찾을 수 없는 경우,") {
8282 val user = user()
8383 it("true를 반환한다.") {
84- user.isContributionUpdatedBeforeOneHour () shouldBeEqual true
84+ user.isContributionUpdatedLongAgo () shouldBeEqual true
8585 }
8686 }
8787
@@ -96,7 +96,7 @@ internal class UserTest(
9696 )
9797 )
9898 it("false를 반환한다.") {
99- user.isContributionUpdatedBeforeOneHour () shouldBeEqual false
99+ user.isContributionUpdatedLongAgo () shouldBeEqual false
100100 }
101101 }
102102 }
You can’t perform that action at this time.
0 commit comments