Skip to content

Commit

Permalink
Prevent starting EmbeddedServer unnecessarily in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkobor committed Oct 1, 2020
1 parent 24d6a99 commit b45bb7f
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.kotest.core.spec.style.BehaviorSpec
import io.kotest.matchers.string.shouldContain
import io.micronaut.http.client.RxHttpClient
import io.micronaut.http.client.annotation.Client
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest

@MicronautTest
class InfoEndpointTest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import io.micronaut.http.HttpStatus
import io.micronaut.http.client.RxHttpClient
import io.micronaut.http.client.annotation.Client
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest

@Suppress("LongParameterList")
@MicronautTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import io.kotest.core.test.TestResult
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
import io.micronaut.http.HttpStatus
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import io.mockk.clearAllMocks
import io.mockk.spyk
import io.mockk.verify
import io.mockk.verifyOrder

@MicronautTest
@MicronautTest(startApplication = false)
class DatabaseEventHandlerTest(
uptimeEventRepository: UptimeEventRepository,
latencyLogRepository: LatencyLogRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import io.kotest.matchers.shouldBe
import io.micronaut.http.HttpResponse
import io.micronaut.http.HttpStatus
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
import io.mockk.slot
import io.mockk.verify
import io.reactivex.Single

@MicronautTest
@MicronautTest(startApplication = false)
class PagerdutyEventHandlerTest(
private val monitorRepository: MonitorRepository,
private val uptimeEventRepository: UptimeEventRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
import io.kotest.matchers.string.shouldNotContain
import io.micronaut.http.HttpStatus
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import io.mockk.clearAllMocks
import io.mockk.slot
import io.mockk.spyk
import io.mockk.verify
import org.simplejavamail.api.email.Email
import java.time.OffsetDateTime

@MicronautTest
@MicronautTest(startApplication = false)
class SMTPEventHandlerTest(
private val monitorRepository: MonitorRepository,
private val uptimeEventRepository: UptimeEventRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import io.kotest.matchers.string.shouldNotContain
import io.micronaut.http.HttpResponse
import io.micronaut.http.HttpStatus
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
Expand All @@ -36,7 +36,7 @@ import io.mockk.verify
import io.reactivex.Single
import java.time.OffsetDateTime

@MicronautTest
@MicronautTest(startApplication = false)
class SlackEventHandlerTest(
private val monitorRepository: MonitorRepository,
private val uptimeEventRepository: UptimeEventRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import io.kotest.matchers.string.shouldNotContain
import io.micronaut.http.HttpResponse
import io.micronaut.http.HttpStatus
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
Expand All @@ -37,7 +37,7 @@ import io.mockk.verify
import io.reactivex.Single
import java.time.OffsetDateTime

@MicronautTest
@MicronautTest(startApplication = false)
class TelegramEventHandlerTest(
private val monitorRepository: MonitorRepository,
private val uptimeEventRepository: UptimeEventRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import com.kuvaszuptime.kuvasz.mocks.createMonitor
import com.kuvaszuptime.kuvasz.mocks.createUptimeEventRecord
import com.kuvaszuptime.kuvasz.util.getCurrentTimestamp
import io.kotest.matchers.shouldBe
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest

@MicronautTest
@MicronautTest(startApplication = false)
class UptimeEventRepositoryTest(
private val monitorRepository: MonitorRepository,
private val uptimeEventRepository: UptimeEventRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import io.micronaut.http.client.RxHttpClient
import io.micronaut.http.client.annotation.Client
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.security.token.jwt.render.BearerAccessRefreshToken
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest

@MicronautTest
@Property(name = "micronaut.security.enabled", value = "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import io.kotest.inspectors.forNone
import io.kotest.inspectors.forOne
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest

@MicronautTest
@MicronautTest(startApplication = false)
class CheckSchedulerTest(
private val checkScheduler: CheckScheduler,
private val monitorRepository: MonitorRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import com.kuvaszuptime.kuvasz.tables.pojos.LatencyLogPojo
import com.kuvaszuptime.kuvasz.util.getCurrentTimestamp
import io.kotest.matchers.collections.shouldHaveSize
import io.micronaut.context.annotation.Property
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import java.time.OffsetDateTime

@MicronautTest
@MicronautTest(startApplication = false)
@Property(name = "app-config.data-retention-days", value = "7")
class DatabaseCleanerTest(
private val uptimeEventRepository: UptimeEventRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import io.kotest.core.test.TestResult
import io.kotest.matchers.comparables.shouldBeGreaterThan
import io.kotest.matchers.comparables.shouldBeLessThan
import io.kotest.matchers.shouldBe
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import io.mockk.clearMocks
import io.mockk.every
import io.mockk.mockk
Expand All @@ -29,7 +29,7 @@ import io.mockk.verify
import io.reactivex.subscribers.TestSubscriber
import java.time.OffsetDateTime

@MicronautTest
@MicronautTest(startApplication = false)
class SSLCheckerTest(
private val monitorRepository: MonitorRepository,
sslEventRepository: SSLEventRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import io.kotest.matchers.shouldBe
import io.micronaut.http.HttpHeaders
import io.micronaut.http.HttpStatus
import io.micronaut.http.simple.SimpleHttpResponseFactory
import io.micronaut.test.annotation.MicronautTest
import io.micronaut.test.extensions.kotest.annotation.MicronautTest
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.spyk
import io.reactivex.Flowable.fromArray
import io.reactivex.subscribers.TestSubscriber
import java.net.URI

@MicronautTest
@MicronautTest(startApplication = false)
class UptimeCheckerTest(
uptimeChecker: UptimeChecker,
private val monitorRepository: MonitorRepository,
Expand Down

0 comments on commit b45bb7f

Please sign in to comment.