-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ContractTestV2 which implements SpecmaticContractTest interface f…
…or running contract tests
- Loading branch information
1 parent
706d0cb
commit ec837fb
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
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(); | ||
} | ||
} |