Improve tests #90
@@ -22,7 +22,7 @@ import org.koin.test.get
|
|||||||
@KtorExperimentalLocationsAPI
|
@KtorExperimentalLocationsAPI
|
||||||
@KtorExperimentalAPI
|
@KtorExperimentalAPI
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Tags(Tag("functional"))
|
@Tags(Tag("functional"), Tag("mail"))
|
||||||
class MailerTest : KoinTest, AutoCloseKoinTest() {
|
class MailerTest : KoinTest, AutoCloseKoinTest() {
|
||||||
@InternalCoroutinesApi
|
@InternalCoroutinesApi
|
||||||
@ExperimentalCoroutinesApi
|
@ExperimentalCoroutinesApi
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.TestInstance
|
|||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_METHOD)
|
@TestInstance(TestInstance.Lifecycle.PER_METHOD)
|
||||||
@Tags(Tag("functional"))
|
@Tags(Tag("functional"), Tag("notification"))
|
||||||
class NotificationConsumerTest {
|
class NotificationConsumerTest {
|
||||||
companion object {
|
companion object {
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Tags
|
|||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
@Tags(Tag("functional"))
|
@Tags(Tag("functional"), Tag("notification"))
|
||||||
internal class NotificationsPushTest {
|
internal class NotificationsPushTest {
|
||||||
companion object {
|
companion object {
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.junit.jupiter.api.TestInstance
|
|||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Tags(Tag("functional"))
|
@Tags(Tag("functional"), Tag("utils"))
|
||||||
class ResourcesKtTest {
|
class ResourcesKtTest {
|
||||||
@Test
|
@Test
|
||||||
fun readResource() {
|
fun readResource() {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import java.util.UUID
|
|||||||
@KtorExperimentalAPI
|
@KtorExperimentalAPI
|
||||||
@ExperimentalCoroutinesApi
|
@ExperimentalCoroutinesApi
|
||||||
@TestInstance(PER_CLASS)
|
@TestInstance(PER_CLASS)
|
||||||
@Tags(Tag("functional"))
|
@Tags(Tag("functional"), Tag("view"))
|
||||||
class ViewTest {
|
class ViewTest {
|
||||||
@Test
|
@Test
|
||||||
fun `test View Article`() {
|
fun `test View Article`() {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test
|
|||||||
import org.junit.jupiter.api.TestInstance
|
import org.junit.jupiter.api.TestInstance
|
||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Tags(Tag("integration"), Tag("article"), Tag("opinion"))
|
@Tags(Tag("integration"), Tag("opinion"))
|
||||||
class `Opinion routes` : BaseTest() {
|
class `Opinion routes` : BaseTest() {
|
||||||
@Test
|
@Test
|
||||||
fun `I can get all opinion choices`() {
|
fun `I can get all opinion choices`() {
|
||||||
@@ -48,6 +48,7 @@ class `Opinion routes` : BaseTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Tag("article")
|
||||||
fun `I can create opinion on article`() {
|
fun `I can create opinion on article`() {
|
||||||
withIntegrationApplication {
|
withIntegrationApplication {
|
||||||
`Given I have citizen`("Isaac", "Newton", id = "2f414045-95d9-42ca-a3a9-8cdde52ad253")
|
`Given I have citizen`("Isaac", "Newton", id = "2f414045-95d9-42ca-a3a9-8cdde52ad253")
|
||||||
@@ -89,6 +90,7 @@ class `Opinion routes` : BaseTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Tag("article")
|
||||||
fun `I can receive opinion aggregation with article`() {
|
fun `I can receive opinion aggregation with article`() {
|
||||||
withIntegrationApplication {
|
withIntegrationApplication {
|
||||||
`Given I have an opinion choice`("Opinion6")
|
`Given I have an opinion choice`("Opinion6")
|
||||||
@@ -120,6 +122,7 @@ class `Opinion routes` : BaseTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Tag("article")
|
||||||
fun `I can get all my opinion of one article`() {
|
fun `I can get all my opinion of one article`() {
|
||||||
withIntegrationApplication {
|
withIntegrationApplication {
|
||||||
`Given I have citizen`("Albert", "Einstein", id = "c1542096-3431-432d-8e35-9dc071d4c818")
|
`Given I have citizen`("Albert", "Einstein", id = "c1542096-3431-432d-8e35-9dc071d4c818")
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import fr.dcproject.component.article.database.ArticleRepository as ArticleRepo
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("article"))
|
||||||
internal class `Article Access Control` {
|
internal class `Article Access Control` {
|
||||||
private val tesla = CitizenCreator(
|
private val tesla = CitizenCreator(
|
||||||
id = UUID.fromString("e6efc288-4283-4729-a268-6debb18de1a0"),
|
id = UUID.fromString("e6efc288-4283-4729-a268-6debb18de1a0"),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import org.junit.jupiter.api.parallel.ExecutionMode.CONCURRENT
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("citizen"))
|
||||||
internal class `Citizen Access Control` {
|
internal class `Citizen Access Control` {
|
||||||
private val tesla = CitizenCart(
|
private val tesla = CitizenCart(
|
||||||
user = User(
|
user = User(
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import java.util.UUID
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("comment"))
|
||||||
internal class `Comment Access Control` {
|
internal class `Comment Access Control` {
|
||||||
private val tesla = Citizen(
|
private val tesla = Citizen(
|
||||||
user = User(
|
user = User(
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import java.util.UUID
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("follow"))
|
||||||
internal class `Follow Access Control` {
|
internal class `Follow Access Control` {
|
||||||
private val tesla = CitizenCreator(
|
private val tesla = CitizenCreator(
|
||||||
user = UserCreator(
|
user = UserCreator(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import java.util.UUID
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("opinion"))
|
||||||
internal class `Opinion Access Control` {
|
internal class `Opinion Access Control` {
|
||||||
private val tesla = CitizenCreator(
|
private val tesla = CitizenCreator(
|
||||||
user = UserCreator(
|
user = UserCreator(
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import java.util.UUID
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("opinion"))
|
||||||
internal class `OpinionChoice Access Control` {
|
internal class `OpinionChoice Access Control` {
|
||||||
private val tesla = CitizenRef(
|
private val tesla = CitizenRef(
|
||||||
id = UUID.fromString("e6efc288-4283-4729-a268-6debb18de1a0"),
|
id = UUID.fromString("e6efc288-4283-4729-a268-6debb18de1a0"),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import java.util.UUID
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("vote"))
|
||||||
internal class `Vote Access Control` {
|
internal class `Vote Access Control` {
|
||||||
private val tesla = Citizen(
|
private val tesla = Citizen(
|
||||||
id = UUID.fromString("a1e35c99-9d33-4fb4-9201-58d7071243bb"),
|
id = UUID.fromString("a1e35c99-9d33-4fb4-9201-58d7071243bb"),
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import fr.dcproject.component.workgroup.database.WorkgroupForView as WorkgroupEn
|
|||||||
|
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
@Execution(CONCURRENT)
|
@Execution(CONCURRENT)
|
||||||
@Tags(Tag("security"), Tag("unit"))
|
@Tags(Tag("security"), Tag("unit"), Tag("workgroup"))
|
||||||
internal class `Workgroup Access Control` {
|
internal class `Workgroup Access Control` {
|
||||||
private val tesla = CitizenCreator(
|
private val tesla = CitizenCreator(
|
||||||
user = UserCreator(
|
user = UserCreator(
|
||||||
|
|||||||
Reference in New Issue
Block a user