forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PaymentServiceContractTest.java
41 lines (34 loc) · 1.23 KB
/
PaymentServiceContractTest.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
40
41
package mock.contract;
import com.intuit.karate.Results;
import com.intuit.karate.Runner;
import org.springframework.context.ConfigurableApplicationContext;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
/**
*
* @author pthomas3
*/
class PaymentServiceContractTest {
static ConfigurableApplicationContext context;
static String queueName = "DEMO.CONTRACT";
@BeforeAll
static void beforeAll() {
context = PaymentService.start(queueName, false);
}
@Test
void testPaymentService() {
String paymentServiceUrl = "http://localhost:" + PaymentService.getPort(context);
Results results = Runner.path("classpath:mock/contract/payment-service.feature")
.configDir("classpath:mock/contract")
.systemProperty("payment.service.url", paymentServiceUrl)
.systemProperty("shipping.queue.name", queueName)
.parallel(1);
assertTrue(results.getFailCount() == 0, results.getErrorMessages());
}
@AfterAll
static void afterAll() {
PaymentService.stop(context);
}
}