feature: #6: Add cucumber test for article routes

This commit is contained in:
2019-08-01 00:58:41 +02:00
parent 7acb2b3e40
commit 63a50dcb92
9 changed files with 213 additions and 12 deletions

View File

@@ -6,9 +6,10 @@ import org.koin.dsl.module
import java.io.File
import fr.dcproject.repository.Article as ArticleRepository
val config = Config()
@KtorExperimentalAPI
val Module = module {
val config = Config()
single { config }

View File

@@ -21,10 +21,17 @@ class Article(override var requester: Requester) : RepositoryI<ArticleEntity> {
}
}
fun find(page: Int = 1, limit: Int = 50, sort: String? = null, direction: Direction? = null, search: String? = null): Paginated<ArticleEntity> {
fun find(
page: Int = 1,
limit: Int = 50,
sort: String? = null,
direction: Direction? = null,
search: String? = null
): Paginated<ArticleEntity> {
return requester
.getFunction("find_articles")
.select(page, limit,
.select(
page, limit,
"sort" to sort?.toSnakeCase(),
"direction" to direction,
"search" to search