-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
56 changed files
with
402 additions
and
541 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
plugins { | ||
kotlin("jvm") version "1.9.24" | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin.coreLibrariesVersion}") | ||
implementation("org.jetbrains.kotlin:kotlin-allopen:${kotlin.coreLibrariesVersion}") | ||
|
||
implementation("org.springframework.boot:spring-boot-gradle-plugin:3.3.4") | ||
implementation("io.spring.gradle:dependency-management-plugin:1.1.6") | ||
} |
23 changes: 0 additions & 23 deletions
23
buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
buildSrc/src/main/kotlin/buildlogic.java-library-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
buildSrc/src/main/kotlin/buildlogic.kotlin-conventions.gradle.kts
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,14 @@ | ||
plugins { | ||
kotlin("jvm") | ||
} | ||
|
||
group = "ru.ifmo.se.dating" | ||
version = "1.0.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(20) | ||
} |
4 changes: 4 additions & 0 deletions
4
buildSrc/src/main/kotlin/buildlogic.kotlin-library-conventions.gradle.kts
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,4 @@ | ||
plugins { | ||
id("buildlogic.kotlin-conventions") | ||
`java-library` | ||
} |
6 changes: 6 additions & 0 deletions
6
buildSrc/src/main/kotlin/buildlogic.spring-conventions.gradle.kts
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,6 @@ | ||
plugins { | ||
id("buildlogic.kotlin-library-conventions") | ||
id("org.springframework.boot") | ||
id("io.spring.dependency-management") | ||
kotlin("plugin.spring") | ||
} |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
plugins { | ||
id("buildlogic.java-library-conventions") | ||
id("buildlogic.kotlin-library-conventions") | ||
} | ||
|
||
dependencies { | ||
api(libs.org.testcontainers.postgresql) | ||
api(libs.junit.junit) | ||
compileOnly(libs.org.projectlombok.lombok) | ||
} |
40 changes: 0 additions & 40 deletions
40
common/testing/src/main/java/ru/ifmo/se/dating/container/Postgres.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
common/testing/src/main/kotlin/ru/ifmo/se/dating/container/Postgres.kt
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,34 @@ | ||
package ru.ifmo.se.dating.container | ||
|
||
import org.testcontainers.containers.PostgreSQLContainer | ||
|
||
class Postgres private constructor() : AutoCloseable { | ||
private val container = PostgreSQLContainer(DOCKER_IMAGE_NAME) | ||
|
||
fun jdbcUrl(): String { | ||
return container.jdbcUrl | ||
} | ||
|
||
fun username(): String { | ||
return container.username | ||
} | ||
|
||
fun password(): String { | ||
return container.password | ||
} | ||
|
||
override fun close() { | ||
container.stop() | ||
container.close() | ||
} | ||
|
||
companion object { | ||
private const val DOCKER_IMAGE_NAME = "postgres" | ||
|
||
fun start(): Postgres { | ||
val postgres = Postgres() | ||
postgres.container.start() | ||
return postgres | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
plugins { | ||
id("buildlogic.java-library-conventions") | ||
id("buildlogic.kotlin-library-conventions") | ||
} |
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
28 changes: 0 additions & 28 deletions
28
matchmaker/app/src/test/java/ru/ifmo/se/dating/matchmaker/DatabaseInitializer.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
matchmaker/app/src/test/java/ru/ifmo/se/dating/matchmaker/MatchmakerStartupTest.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
matchmaker/app/src/test/java/ru/ifmo/se/dating/matchmaker/MatchmakerTestSuite.java
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
matchmaker/app/src/test/java/ru/ifmo/se/dating/matchmaker/api/HttpMonitoringApiTest.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
matchmaker/app/src/test/kotlin/ru/ifmo/se/dating/matchmaker/DatabaseInitializer.kt
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,18 @@ | ||
package ru.ifmo.se.dating.matchmaker | ||
|
||
import org.springframework.boot.test.util.TestPropertyValues | ||
import org.springframework.context.ApplicationContextInitializer | ||
import org.springframework.context.ConfigurableApplicationContext | ||
import ru.ifmo.se.dating.container.Postgres | ||
|
||
class DatabaseInitializer : ApplicationContextInitializer<ConfigurableApplicationContext> { | ||
private val postgres: Postgres = Postgres.start() | ||
|
||
override fun initialize(applicationContext: ConfigurableApplicationContext) { | ||
TestPropertyValues.of( | ||
"spring.datasource.url=${postgres.jdbcUrl()}", | ||
"spring.datasource.username=${postgres.username()}", | ||
"spring.datasource.password=${postgres.password()}", | ||
).applyTo(applicationContext.environment) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
matchmaker/app/src/test/kotlin/ru/ifmo/se/dating/matchmaker/MatchmakerStartupTest.kt
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,10 @@ | ||
package ru.ifmo.se.dating.matchmaker | ||
|
||
import org.junit.Test | ||
|
||
class MatchmakerStartupTest : MatchmakerTestSuite() { | ||
@Test | ||
fun contextLoads() { | ||
// Okay | ||
} | ||
} |
Oops, something went wrong.