-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathContractTest.java
More file actions
31 lines (26 loc) · 916 Bytes
/
ContractTest.java
File metadata and controls
31 lines (26 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.store;
import com.store.model.DB;
import io.specmatic.stub.ContractStub;
import io.specmatic.test.SpecmaticContractTest;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.TestInstance;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.IOException;
import static io.specmatic.stub.API.createStub;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class ContractTest implements SpecmaticContractTest {
private static ContractStub stub = null;
@BeforeAll
public static void setup() throws Exception {
DB.INSTANCE.resetDB();
stub = createStub("localhost", 9000);
}
@AfterAll
public static void tearDown() throws IOException {
if(stub != null) {
stub.close();
}
}
}