-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge workshop parts in a single one (#283)
* Merge workshop into a single session. Fix #259
- Loading branch information
Showing
9 changed files
with
129 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import io.ktor.client.call.body | ||
import io.ktor.client.plugins.HttpRequestRetry | ||
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation | ||
import io.ktor.client.request.get | ||
import io.ktor.serialization.kotlinx.json.json | ||
import io.ktor.server.config.ApplicationConfig | ||
import io.ktor.server.testing.TestApplication | ||
import kotlinx.coroutines.test.runTest | ||
import org.jetbrains.kotlinconf.Conference | ||
import org.junit.jupiter.api.Assertions.assertFalse | ||
import org.junit.jupiter.api.Test | ||
|
||
|
||
class ApiTest { | ||
|
||
val app = TestApplication { | ||
environment { | ||
config = ApplicationConfig("test-application.yaml") | ||
} | ||
} | ||
|
||
val client = app.createClient { | ||
install(HttpRequestRetry) { | ||
} | ||
install(ContentNegotiation) { | ||
json() | ||
} | ||
} | ||
|
||
@Test | ||
fun testConferenceCallRepeatable() = runTest { | ||
repeat(10) { | ||
client.get("/conference").body<Conference>() | ||
} | ||
} | ||
|
||
|
||
@Test | ||
fun testWorkshopPartsAreMerged() = runTest { | ||
val conference = client.get("/conference").body<Conference>() | ||
val workshops = conference.sessions.filter { it.tags?.contains("Workshop") == true } | ||
|
||
for (workshop in workshops) { | ||
assertFalse("Part" in workshop.title) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ktor: | ||
deployment: | ||
port: 8080 | ||
|
||
application: | ||
modules: | ||
- org.jetbrains.kotlinconf.backend.MainKt.conferenceBackend | ||
|
||
|
||
sessionize: | ||
url: "https://sessionize.com/api/v2/cdftbl11/view/All" | ||
imagesUrl: "https://sessionize.com/image/" | ||
interval: 60 | ||
|
||
database: | ||
host: "$DB0_HOST:" | ||
user: "$DB0_USERNAME:" | ||
password: "$DB0_PASSWORD:" | ||
database: "$DB0_NAME:" | ||
|
||
poolSize: 5 | ||
|
||
service: | ||
environment: test | ||
secret: "$ADMIN_SECRET:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2761,6 +2761,11 @@ wrappy@1: | |
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" | ||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== | ||
|
||
[email protected]: | ||
version "8.18.0" | ||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" | ||
integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== | ||
|
||
[email protected]: | ||
version "8.5.0" | ||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters