Skip to content

Commit

Permalink
Add ContractTestV2 which implements SpecmaticContractTest interface f…
Browse files Browse the repository at this point in the history
…or running contract tests
  • Loading branch information
yogeshnikam671 committed May 3, 2024
1 parent 706d0cb commit ec837fb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/test/java/com/store/ContractTestV2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.store;

import com.store.model.DB;
import in.specmatic.test.SpecmaticContractTest;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;

public class ContractTestV2 implements SpecmaticContractTest {
private static ConfigurableApplicationContext context;

@BeforeAll
public static void setUp() {
System.setProperty("host", "localhost");
System.setProperty("port", "8090");
System.setProperty("endpointsAPI", "http://localhost:8090/actuator/mappings");
System.setProperty("SPECMATIC_GENERATIVE_TESTS", "true");
System.setProperty("SPECMATIC_TEST_PARALLELISM", "auto");

DB.INSTANCE.resetDB();

context = SpringApplication.run(Application.class);
}

@AfterAll
public static void tearDown() {
context.close();
}
}

0 comments on commit ec837fb

Please sign in to comment.