Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rubengees committed Jul 9, 2021
1 parent 388acd5 commit 041f714
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import org.springframework.boot.test.context.SpringBootTest
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.stereotype.Component
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS

@DirtiesContext(classMode = BEFORE_CLASS)
@SpringBootTest(classes = [AnnotationCollectorIntegrationTests.PostProcessorConfiguration::class])
class AnnotationCollectorIntegrationTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ class EmqxExtension : BeforeAllCallback {
System.setProperty("mqtt.port", emqx.getMappedPort(1883).toString())
System.setProperty("mqtt.username", "admin")
System.setProperty("mqtt.password", "public")
System.setProperty("mqtt.ssl", "false")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.stereotype.Component
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS

@DirtiesContext(classMode = BEFORE_CLASS)
@ExtendWith(EmqxExtension::class)
@SpringBootTest(
classes = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import com.hivemq.client.mqtt.mqtt5.message.publish.Mqtt5Publish
import org.awaitility.kotlin.await
import org.awaitility.kotlin.has
import org.awaitility.kotlin.untilCallTo
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.stereotype.Component
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS
import org.springframework.test.context.DynamicPropertyRegistry
import org.springframework.test.context.DynamicPropertySource

@DirtiesContext(classMode = BEFORE_CLASS)
@ExtendWith(EmqxExtension::class)
@SpringBootTest(
classes = [
Expand All @@ -25,9 +29,9 @@ class Mqtt5AutoConfigurationTest {
companion object {

@JvmStatic
@BeforeAll
fun setUp() {
System.setProperty("mqtt.version", "5")
@DynamicPropertySource
fun mqttVersion(registry: DynamicPropertyRegistry) {
registry.add("mqtt.version") { "5" }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.stereotype.Component
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS

@DirtiesContext(classMode = BEFORE_CLASS)
@ExtendWith(EmqxExtension::class)
@SpringBootTest(
classes = [
Expand Down

0 comments on commit 041f714

Please sign in to comment.