mirror of https://github.com/usbharu/Hideout.git
test: テストを修正
This commit is contained in:
parent
f5fc4fd0ee
commit
cb886fc763
|
@ -3,7 +3,6 @@ package dev.usbharu.hideout.core.domain.model.actor
|
|||
import dev.usbharu.hideout.core.domain.event.actor.ActorEvent
|
||||
import dev.usbharu.hideout.core.domain.model.media.MediaId
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.assertDoesNotThrow
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import utils.AssertDomainEvent.assertContainsEvent
|
||||
import utils.AssertDomainEvent.assertEmpty
|
||||
|
@ -147,26 +146,4 @@ class ActorsTest {
|
|||
|
||||
assertContainsEvent(actor, ActorEvent.UPDATE.eventName)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun administratorロールを持っている人はroleを設定できる() {
|
||||
val admin = TestActorFactory.create(roles = setOf(Role.ADMINISTRATOR))
|
||||
|
||||
val actor = TestActorFactory.create()
|
||||
|
||||
assertDoesNotThrow {
|
||||
actor.setRole(setOf(Role.MODERATOR), admin)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun administratorロールを持ってないとはroleを設定できない() {
|
||||
val admin = TestActorFactory.create(roles = setOf(Role.MODERATOR))
|
||||
|
||||
val actor = TestActorFactory.create()
|
||||
|
||||
assertThrows<IllegalArgumentException> {
|
||||
actor.setRole(setOf(Role.MODERATOR), admin)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue