Created
April 1, 2021 00:05
-
-
Save jaimedantas/183b895eaa8513e2e14e88ce38001b17 to your computer and use it in GitHub Desktop.
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
@MicronautTest(propertySources = ["application.yml"]) | |
@Property(name = "microservice.threads", value = "1") | |
class LoadSimulatorTest{ | |
@Inject | |
lateinit var loadSimulator: LoadSimulator | |
@Test | |
@Property(name = "microservice.processingTime", value = "1000") | |
fun shouldTakeTimeDefinedForProcessing() = runBlocking<Unit> { | |
val message = "Hello World!" | |
val time = 1000 | |
val startedTime = LocalDateTime.now() | |
val result = loadSimulator.processLoad() | |
val finishedTime = LocalDateTime.now() | |
val validationResult = ChronoUnit.MILLIS.between(startedTime,finishedTime) >= time | |
assertTrue(validationResult) | |
assertEquals(message, result.message) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment