Skip to content

Commit 3d26f16

Browse files
committed
detekt
1 parent dc61742 commit 3d26f16

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/NotificationStateUtils.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ class InstantConverter : Converter<Instant>() {
2121
override fun fromString(value: String): Instant = Instant.ofEpochMilli(value.toLong())
2222
}
2323

24-
2524
data class DismissedNotification(
25+
@Attribute
2626
val id: String = "",
2727
@Attribute(converter = InstantConverter::class)
28-
val dismissedAt: Instant = Instant.now()
28+
val dismissedAt: Instant = Instant.now(),
2929
)
3030

3131
data class NotificationDismissalConfiguration(
3232
@Property
33-
var dismissedNotifications: MutableSet<DismissedNotification> = mutableSetOf()
33+
var dismissedNotifications: MutableSet<DismissedNotification> = mutableSetOf(),
3434
)
3535

3636
@Service
@@ -47,9 +47,8 @@ class NotificationDismissalState : PersistentStateComponent<NotificationDismissa
4747
cleanExpiredNotifications()
4848
}
4949

50-
fun isDismissed(notificationId: String): Boolean {
51-
return state.dismissedNotifications.any { it.id == notificationId }
52-
}
50+
fun isDismissed(notificationId: String): Boolean =
51+
state.dismissedNotifications.any { it.id == notificationId }
5352

5453
fun dismissNotification(notificationId: String) {
5554
state.dismissedNotifications.add(
@@ -71,7 +70,6 @@ class NotificationDismissalState : PersistentStateComponent<NotificationDismissa
7170
}
7271
}
7372

74-
7573
@Service
7674
@State(name = "notificationEtag", storages = [Storage("aws.xml", roamingType = RoamingType.DISABLED)])
7775
class NotificationEtagState : PersistentStateComponent<NotificationEtagConfiguration> {

plugins/core/jetbrains-community/tst/software/aws/toolkits/jetbrains/core/notifications/NotificationDismissalStateTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
package software.aws.toolkits.jetbrains.core.notifications
55

6-
import org.junit.jupiter.api.Assertions.*
6+
import org.junit.jupiter.api.Assertions.assertEquals
7+
import org.junit.jupiter.api.Assertions.assertFalse
8+
import org.junit.jupiter.api.Assertions.assertTrue
79
import org.junit.jupiter.api.BeforeEach
810
import org.junit.jupiter.api.Test
911
import java.time.Instant
@@ -34,7 +36,7 @@ class NotificationDismissalStateTest {
3436
}
3537

3638
@Test
37-
fun `notifications older than 2 months are removed`() {
39+
fun `notifications older than 2 months are removed`() {
3840
val oldNotification = DismissedNotification(
3941
id = "old-notification",
4042
dismissedAt = Instant.now().minus(61, ChronoUnit.DAYS)

0 commit comments

Comments
 (0)