forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PaymentContractTest.java
executable file
·39 lines (32 loc) · 1.06 KB
/
PaymentContractTest.java
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
32
33
34
35
36
37
38
39
package payment.producer.contract;
import com.intuit.karate.Results;
import com.intuit.karate.Runner;
import org.junit.jupiter.api.AfterAll;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.context.ConfigurableApplicationContext;
import payment.producer.PaymentService;
/**
*
* @author pthomas3
*/
class PaymentContractTest {
static ConfigurableApplicationContext context;
@BeforeAll
static void beforeAll() {
context = PaymentService.start();
}
@Test
void testReal() {
String paymentServiceUrl = "http://localhost:" + PaymentService.getPort(context);
Results results = Runner.path("classpath:payment/producer/contract/payment-contract.feature")
.systemProperty("payment.service.url", paymentServiceUrl)
.parallel(1);
assertTrue(results.getFailCount() == 0, results.getErrorMessages());
}
@AfterAll
static void afterAll() {
PaymentService.stop(context);
}
}