Murilo Dourado
03/27/2021, 3:47 PMimport org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.4.4"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
kotlin("jvm") version "1.4.31"
kotlin("plugin.spring") version "1.4.31"
kotlin("plugin.jpa") version "1.4.31"
}
group = "com.kotlin"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
runtimeOnly("com.h2database:h2")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(module = "junit")
exclude(module = "mockito-core")
}
testImplementation("io.mockk:mockk:1.11.0")
testImplementation("com.ninja-squad:springmockk:3.0.1")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
Murilo Dourado
03/27/2021, 3:52 PMTomasz Krakowiak
03/31/2021, 7:07 AMGuilherme Delgado
03/31/2021, 10:32 AMNayeem Uzzaman
04/14/2021, 7:23 PMTarun Chawla
04/22/2021, 6:02 PMarchana 0623
05/03/2021, 12:51 PM@Test
fun testRequests() {
withTestApplication({ main() }) {
with(handleRequest(HttpMethod.Get, Resource.path)) {
assertEquals(HttpStatusCode.OK, response.status())
}
}
}
and using mockk.io to mock the other layers but looks like it is not working, it is still trying to connect to actual DB and runs the server at given port if I just remove db related connection initializations..Lucas Milotich
05/04/2021, 7:17 PMDaniel Demidko
05/10/2021, 10:26 AMDaniel Demidko
05/10/2021, 10:42 AMzaleslaw
05/19/2021, 2:12 PMVincent Huang
05/21/2021, 1:51 PMVincent Huang
05/21/2021, 1:56 PMDavid Silva
05/21/2021, 2:04 PMAlina Dolgikh [JB]
Peter
05/28/2021, 6:34 AMAlexander Girke
05/30/2021, 9:58 AMVincent Huang
06/03/2021, 1:56 AMMichael Grigoryan
06/11/2021, 6:32 PMAlex Anisimov
07/01/2021, 8:08 PMgzhenjin
07/22/2021, 9:14 AMgzhenjin
07/22/2021, 9:14 AMAlexander Suraphel
07/27/2021, 2:00 PMAndrew
08/05/2021, 4:32 AMFernando Avanzo
08/06/2021, 2:16 PMAlina Grebenkina
08/16/2021, 12:44 PMantonarhipov
08/31/2021, 1:41 PMtherealbluepandabear
09/22/2021, 10:44 PMtherealbluepandabear
09/22/2021, 10:44 PM