Skip to content

Commit 5e8abbf

Browse files
author
Olivier von Dach
committed
fixed contract testing configuration
1 parent 49a3af4 commit 5e8abbf

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ dependencies {
8888
testCompileOnly("org.projectlombok:lombok")
8989
testAnnotationProcessor("org.projectlombok:lombok")
9090
testRuntimeOnly("org.postgresql:postgresql")
91+
testRuntimeOnly("com.h2database:h2")
9192
testImplementation("io.qameta.allure:allure-junit5:${property("allure.version")}")
9293

9394
// AT testing

src/contractTest/java/edu/obya/blueprint/customer/cdc/pact/provider/CustomerPactProviderTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import edu.obya.blueprint.customer.domain.model.CustomerId;
1010
import edu.obya.blueprint.customer.domain.service.CustomerRepository;
1111
import io.micrometer.core.instrument.MeterRegistry;
12+
import io.zonky.test.db.AutoConfigureEmbeddedDatabase;
1213
import org.junit.jupiter.api.BeforeEach;
1314
import org.junit.jupiter.api.TestTemplate;
1415
import org.junit.jupiter.api.extension.ExtendWith;
@@ -26,10 +27,11 @@
2627
import static edu.obya.blueprint.customer.domain.model.TestCustomer.TEST_CUSTOMER_ID;
2728
import static org.mockito.ArgumentMatchers.any;
2829

29-
@ActiveProfiles("test")
30+
@ActiveProfiles({"test"})
3031
@Provider("customerAPI")
3132
@PactFolder("customer/cdc/pact")
3233
@Import(CustomerPactContextConfiguration.class)
34+
@AutoConfigureEmbeddedDatabase
3335
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
3436
public class CustomerPactProviderTest {
3537

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
zonky:
2+
test:
3+
database:
4+
type: H2

0 commit comments

Comments
 (0)