Skip to content

Commit

Permalink
fixed environments, internalized main test classes
Browse files Browse the repository at this point in the history
  • Loading branch information
vondacho committed May 20, 2023
1 parent c4144b3 commit 75bb19f
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 35 deletions.
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ dependencies {
exclude(group = "junit", module = "junit")
}
testImplementation("org.springframework.security:spring-security-test")
testImplementation("io.zonky.test:embedded-database-spring-test:${property("embedded-database-spring-test.version")}") {
exclude("net.java.dev.jna", "jna")
}
testImplementation("io.zonky.test:embedded-database-spring-test:${property("embedded-database-spring-test.version")}")
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.mockk:mockk:${property("mockk.version")}")
testImplementation("com.ninja-squad:springmockk:${property("springmockk.version")}")
Expand Down
1 change: 0 additions & 1 deletion doc/tech/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- [Component view](https://www.structurizr.com/share/38199/diagrams#blueprint-api-components)

## AppMap
- [E2E from API layer](https://appmap-viewer.herokuapp.com/appmap/appmap.html?appmap=https://vondacho.github.io/arch-blueprint-java/appmap/edu_obya_blueprint_customer_adapter_rest_CustomerEndpointIT_shouldCreateAndModifyAndDeleteCustomer.appmap.json)
- [E2E from Service layer](https://appmap-viewer.herokuapp.com/appmap/appmap.html?appmap=https://vondacho.github.io/arch-blueprint-java/appmap/edu_obya_blueprint_customer_application_CustomerServiceIT_shouldCreateAndFindAndModifyAndRemoveACustomer.appmap.json)
- [E2E from Data layer](https://appmap-viewer.herokuapp.com/appmap/appmap.html?appmap=https://vondacho.github.io/arch-blueprint-java/appmap/edu_obya_blueprint_customer_adapter_jpa_CustomerRepositoryIT_shouldCreateAndFindAndModifyAndRemoveACustomer.appmap.json)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import org.springframework.boot.test.context.SpringBootTest
@Suite
@SelectClasspathResource("features/basic")
@ConfigurationParameter(key = Constants.GLUE_PROPERTY_NAME, value = "edu.obya.blueprint.basic.at")
class BasicAT
internal class BasicAT

@CucumberContextConfiguration
@SpringBootTest
class BasicATBootstrap
internal class BasicATBootstrap

@SpringBootConfiguration
class BasicATSpringBootConfiguration
internal class BasicATSpringBootConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import org.springframework.test.context.ActiveProfiles
@Suite
@SelectClasspathResource("features/client")
@ConfigurationParameter(key = Constants.GLUE_PROPERTY_NAME, value = "edu.obya.blueprint.client.at")
class ClientAT
internal class ClientAT

@ActiveProfiles("test", "r2dbc")
@ActiveProfiles("test", "r2dbc", "at")
@AutoConfigureEmbeddedDatabase
@EnableAutoConfiguration
@CucumberContextConfiguration
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
class ClientATBootstrap {
internal class ClientATBootstrap {

@Autowired
lateinit var clientState: ClientState
Expand Down Expand Up @@ -67,4 +67,4 @@ class ClientATBootstrap {
}

@SpringBootConfiguration
class ClientATSpringBootConfiguration
internal class ClientATSpringBootConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import reactor.core.publisher.Mono
import kotlin.io.encoding.Base64
import kotlin.io.encoding.ExperimentalEncodingApi

class ClientWebApiClient(private val webClient: WebClient) : edu.obya.blueprint.client.at.api.ClientApiClient {
class ClientWebApiClient(private val webClient: WebClient) : ClientApiClient {

override fun addClient(input: TestClientInput): Mono<TestResult<ClientId, HttpStatus>> {
return webClient.post().uri("clients")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import org.springframework.boot.test.context.SpringBootTest
@Suite
@SelectClasspathResource("features/problemsolving")
@ConfigurationParameter(key = Constants.GLUE_PROPERTY_NAME, value = "edu.obya.blueprint.problemsolving.at")
class ProblemSolvingAT
internal class ProblemSolvingAT

@CucumberContextConfiguration
@SpringBootTest
class ProblemSolvingATBootstrap
internal class ProblemSolvingATBootstrap

@SpringBootConfiguration
class ProblemSolvingATSpringBootConfiguration
internal class ProblemSolvingATSpringBootConfiguration
9 changes: 9 additions & 0 deletions src/acceptanceTest/resources/application-at.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server:
port: 9090
address: localhost

zonky:
test:
database:
provider: DOCKER
type: POSTGRES
17 changes: 0 additions & 17 deletions src/acceptanceTest/resources/application-test.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import reactor.core.publisher.Mono
import java.util.*
import java.util.function.Supplier

@ActiveProfiles("test")
@ActiveProfiles("test", "cdc")
@Provider("clientAPI")
@PactFolder("client/cdc/pact")
@Import(ClientPactContextConfiguration::class)
@AutoConfigureEmbeddedDatabase
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class ClientPactProviderTest {
internal class ClientPactProviderTest {

@LocalServerPort
var port = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ zonky:
test:
database:
type: POSTGRES
provider: ZONKY
provider: DOCKER

0 comments on commit 75bb19f

Please sign in to comment.